blob: 3cab39bd6b629c34f2f4373ada6c59bfe098c06d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
# We do the work in the BEGIN action instead of using pattern matching because
# we expect the fmri to be at or near the first line of each input file, and
# this way lets us avoid reading the rest of the file after we find what we
# need.
#
# We keep track of a failure to locate an fmri, so we can exit with an error
# code which will cause the make run to fail, but we still attempt to process
# each package on the command line, in hope of maybe giving some additional
# useful info.
#
BEGIN {
if (ARGC < 2) {
exit
}
retcode = 0
for (i = 1; i < ARGC; i++) {
do {
e = getline f < ARGV[i]
} while ((e == 1) && (f !~ /name=pkg.fmri/))
if (e == 1) {
l = split(f, a, "=")
fmri = a[l]
facet = 0
do {
e = getline f < ARGV[i]
if (e == 1 &&
f ~ /org.opensolaris.incorp-facet.*=true/)
facet = 1
} while ((e == 1) && (f ~ /^set name=/))
close(ARGV[i])
printf("depend fmri=%s type=$(PKGDEP_TYPE)", fmri)
if (facet)
printf(" vlfacet=true")
print ""
} else {
print "no fmri in " ARGV[i] >> "/dev/stderr"
retcode = 2
}
}
exit retcode
}
|