tools/generate-history
author Petr Sumbera <petr.sumbera@oracle.com>
Mon, 26 Sep 2016 08:04:04 -0700
branchs11u3-sru
changeset 7036 9bdfcd8747ba
parent 5632 4056b7992034
permissions -rw-r--r--
22839226 Migrate Desktop meta-packages to Userland gate 24757632 S11 needs to deliver in Desktop incorporation some intel only packages
# If invoked with -v FUNCTION=name, then just print $1 (s|/|---|).
# Otherwise we expect to be invoked with TARGET=<whatever>, then if
# s|/|---| on $1 matches TARGET, we generate a manifest.
{
  if (substr($1, 1, 1) == "#") { # Skip comments.
    continue
  }
  if ($NF ~ /^arch=/) {
    arch=$NF;
    split(arch, a, "=")
    if (a[2] != MACH)
      continue
    NF--;
  }
  fmri=$1
  split(fmri, a, "@")
  gsub("/", "---", a[1])
  target = sprintf("%s.p5m", a[1])
  if (FUNCTION == "name") {
    printf "%s\n", target
    continue
  }
  if (target != TARGET) {
    continue
  }
  printf "set name=pkg.fmri value=pkg:/%s\n", fmri
  if ($NF ~ /^incorporate=/) {
    incorporate=$NF;
    NF--;
  }
  if (NF == 2) {
    print "set name=pkg.renamed value=true"
    printf "depend type=require fmri=%s\n", $2
  } else {
    print "set name=pkg.obsolete value=true"
  }
  if (incorporate) {
    printf "set name=org.opensolaris.consolidation %s value=$(CONSOLIDATION)\n",
      incorporate
  } else {
    print "set name=org.opensolaris.consolidation value=$(CONSOLIDATION)"
  }
  exit 0 # We're done; no point continuing.
}