about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-08-22 07:22:03 +0000
committerRoland McGrath <roland@gnu.org>2002-08-22 07:22:03 +0000
commit5015cde4c8f4d5b50c906967cdf88d8bff82dca1 (patch)
tree6f5b5199b33dd4c5a462960c5bae275218ab4bf6 /scripts
parent90d1d40b27ab1785e309c243e39765ff6cce9442 (diff)
downloadglibc-5015cde4c8f4d5b50c906967cdf88d8bff82dca1.tar.gz
glibc-5015cde4c8f4d5b50c906967cdf88d8bff82dca1.tar.xz
glibc-5015cde4c8f4d5b50c906967cdf88d8bff82dca1.zip
* scripts/firstversions.awk: When encountering a version newer than
	the specified earliest version, be sure to emit the specified earliest
	version first if any renaming of an older version to that has been.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/firstversions.awk27
1 files changed, 21 insertions, 6 deletions
diff --git a/scripts/firstversions.awk b/scripts/firstversions.awk
index 1a500f4f1d..8da92ae485 100644
--- a/scripts/firstversions.awk
+++ b/scripts/firstversions.awk
@@ -27,20 +27,35 @@ $1 == "}" {
   if ((thislib, idx[thislib]) in firstversion) {
     # XXX relative string comparison loses if we ever have multiple digits
     # between dots in GLIBC_x.y[.z] names.
-    f = firstversion[thislib, idx[thislib]];
-    v = f;
+    f = v = firstversion[thislib, idx[thislib]];
     while ($1 >= v) {
-      firstversion[thislib, idx[thislib]] = 0;
+      delete firstversion[thislib, idx[thislib]];
       idx[thislib]++;
       if ((thislib, idx[thislib]) in firstversion)
         v = firstversion[thislib, idx[thislib]];
       else
         break;
     }
-    if ($1 >= v || $1 == f)
+    if ($1 == v || $1 == f)
+      # This version was the specified earliest version itself.
       print;
-    else
-      print $1, "=", v;
+    else if ($1 < v) {
+      # This version is older than the specified earliest version.
+      print "  " $1, "=", v;
+      # Record that V has been referred to, so we will be sure to emit it
+      # if we hit a later one without hitting V itself.
+      usedversion[thislib, v] = 1;
+    }
+    else {
+      # This version is newer than the specified earliest version.
+      # We haven't seen that version itself or else we wouldn't be here
+      # because we would have removed it from the firstversion array.
+      # If there were any earlier versions that used that one, emit it now.
+      if ((thislib, v) in usedversion) {
+        print "  " v;
+      }
+      print "  " $1;
+    }
   }
   else
     print;