author | Danek Duvall <danek.duvall@oracle.com> |
Thu, 14 Apr 2016 13:02:34 -0700 | |
branch | s11u3-sru |
changeset 5770 | 13a69f5db75f |
parent 5632 | 4056b7992034 |
child 5571 | bd6c9b9b753f |
child 7036 | 9bdfcd8747ba |
permissions | -rw-r--r-- |
5632
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
1 |
# If invoked with -v FUNCTION=name, then just print $1 (s|/|---|). |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
2 |
# Otherwise we expect to be invoked with TARGET=<whatever>, then if |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
3 |
# s|/|---| on $1 matches TARGET, we generate a manifest. |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
4 |
{ |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
5 |
if (substr($1, 1, 1) == "#") { # Skip comments. |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
6 |
continue |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
7 |
} |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
8 |
fmri=$1 |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
9 |
split(fmri, a, "@") |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
10 |
gsub("/", "---", a[1]) |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
11 |
target = sprintf("%s.p5m", a[1]) |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
12 |
if (FUNCTION == "name") { |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
13 |
printf "%s\n", target |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
14 |
continue |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
15 |
} |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
16 |
if (target != TARGET) { |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
17 |
continue |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
18 |
} |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
19 |
printf "set name=pkg.fmri value=pkg:/%s\n", fmri |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
20 |
if (NF == 2) { |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
21 |
print "set name=pkg.renamed value=true" |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
22 |
printf "depend type=require fmri=%s\n", $2 |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
23 |
} else { |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
24 |
print "set name=pkg.obsolete value=true" |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
25 |
} |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
26 |
print "set name=org.opensolaris.consolidation value=$(CONSOLIDATION)" |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
27 |
exit 0 # We're done; no point continuing. |
4056b7992034
21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
28 |
} |