Marcel Telka
2024-04-06 c6bd7ea5379c1336eacc0c15a4b21e330089a22c
commit | author | age
263031 1 # If invoked with -v FUNCTION=name, then just print $1 (s|/|---|).
AP 2 # Otherwise we expect to be invoked with TARGET=<whatever>, then if
3 # s|/|---| on $1 matches TARGET, we generate a manifest.
4 {
5   if (substr($1, 1, 1) == "#") { # Skip comments.
41c752 6     next
263031 7   }
AP 8   fmri=$1
9   split(fmri, a, "@")
10   gsub("/", "---", a[1])
11   target = sprintf("%s.p5m", a[1])
12   if (FUNCTION == "name") {
13     printf "%s\n", target
41c752 14     next
263031 15   }
AP 16   if (target != TARGET) {
41c752 17     next
263031 18   }
AP 19   printf "set name=pkg.fmri value=pkg:/%s\n", fmri
79f2f2 20   
ba3e05 21   if (NF == 3 || (NF ==2  && $2 != "noincorporate")) {
263031 22     print "set name=pkg.renamed value=true"
AP 23     printf "depend type=require fmri=%s\n", $2
24   } else {
25     print "set name=pkg.obsolete value=true"
26   }
79f2f2 27   
AP 28   if ($NF == "noincorporate") {
29     print "set name=pkg.tmp.noincorporate value=true"
30   }
263031 31   print "set name=org.opensolaris.consolidation value=$(CONSOLIDATION)"
AP 32   exit 0 # We're done; no point continuing.
33 }