aboutsummaryrefslogtreecommitdiff
path: root/scripts/firstversions.awk
blob: 236d90ec97ee4755daaba76839dbae6f5ae08918 (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
# Script to preprocess Versions.all lists based on "earliest version"
# specifications in the shlib-versions file.

NF == 3 && $2 == ":" { firstversion[$1] = $3; next }

NF == 2 && $2 == "{" { thislib = $1; print; next }

$1 == "}" {
  if (firstversion[thislib]) {
    # We haven't seen the stated version, but have produced
    # others pointing to it, so we synthesize it now.
    printf "  %s\n", firstversion[thislib];
  }
  print;
  next;
}

{
  if (! firstversion[thislib])
    print;
  else if ($1 == firstversion[thislib]) {
    print;
    firstversion[thislib] = 0;
  }
  else
    print $1, "=", firstversion[thislib];
}