about summary refs log tree commit diff
path: root/scripts/firstversions.awk
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/firstversions.awk')
-rw-r--r--scripts/firstversions.awk27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/firstversions.awk b/scripts/firstversions.awk
new file mode 100644
index 0000000000..236d90ec97
--- /dev/null
+++ b/scripts/firstversions.awk
@@ -0,0 +1,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];
+}