tools/generate-history
author David Hollister <david.hollister@oracle.com>
Wed, 12 Oct 2016 14:01:13 -0600
changeset 7094 61352b4e5af5
parent 5571 bd6c9b9b753f
permissions -rw-r--r--
24797203 OpenStack RBAC profiles allow reading too many files 24797238 keystone RBAC and SMF should point at Apache log files 24797256 cinder RBAC and SMF should point at Apache log files 24830959 horizon RBAC and SMF should point at Apache log files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4813
5e86eaf216ff 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|/|---|).
5e86eaf216ff 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
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     3
# s|/|---| on $1 matches TARGET, we generate a manifest.
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     4
{
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     5
  if (substr($1, 1, 1) == "#") { # Skip comments.
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     6
    continue
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     7
  }
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     8
  fmri=$1
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     9
  split(fmri, a, "@")
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    10
  gsub("/", "---", a[1])
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    11
  target = sprintf("%s.p5m", a[1])
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    12
  if (FUNCTION == "name") {
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    13
    printf "%s\n", target
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    14
    continue
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    15
  }
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    16
  if (target != TARGET) {
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    17
    continue
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    18
  }
5e86eaf216ff 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
5571
bd6c9b9b753f 22839226 Migrate Desktop meta-packages to Userland gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 4813
diff changeset
    20
  if ($NF ~ /^incorporate=/) {
bd6c9b9b753f 22839226 Migrate Desktop meta-packages to Userland gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 4813
diff changeset
    21
    incorporate=$NF;
bd6c9b9b753f 22839226 Migrate Desktop meta-packages to Userland gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 4813
diff changeset
    22
    NF--;
bd6c9b9b753f 22839226 Migrate Desktop meta-packages to Userland gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 4813
diff changeset
    23
  }
4813
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    24
  if (NF == 2) {
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    25
    print "set name=pkg.renamed value=true"
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    26
    printf "depend type=require fmri=%s\n", $2
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    27
  } else {
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    28
    print "set name=pkg.obsolete value=true"
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    29
  }
5571
bd6c9b9b753f 22839226 Migrate Desktop meta-packages to Userland gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 4813
diff changeset
    30
  if (incorporate) {
bd6c9b9b753f 22839226 Migrate Desktop meta-packages to Userland gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 4813
diff changeset
    31
    printf "set name=org.opensolaris.consolidation %s value=$(CONSOLIDATION)\n",
bd6c9b9b753f 22839226 Migrate Desktop meta-packages to Userland gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 4813
diff changeset
    32
      incorporate
bd6c9b9b753f 22839226 Migrate Desktop meta-packages to Userland gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 4813
diff changeset
    33
  } else {
bd6c9b9b753f 22839226 Migrate Desktop meta-packages to Userland gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 4813
diff changeset
    34
    print "set name=org.opensolaris.consolidation value=$(CONSOLIDATION)"
bd6c9b9b753f 22839226 Migrate Desktop meta-packages to Userland gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 4813
diff changeset
    35
  }
4813
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    36
  exit 0 # We're done; no point continuing.
5e86eaf216ff 21699326 Userland package history simplification
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    37
}