about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--scripts/abilist.awk37
2 files changed, 26 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 53e6cfd961..7dbe76da04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2003-03-28  Roland McGrath  <roland@redhat.com>
 
+	* scripts/abilist.awk: If given -v filename_regexp and/or -v
+	libname_regexp when parsing names, then produce output only
+	for those matching the given regexps.  In combine mode, save all
+	stanzas for a final sorting by stanza header at the end.
+	Emit a blank line between stanzas.
+
 	* scripts/abilist.awk: When given -v combine=1, do parse_names and
 	emit a single output stream with lib name in stanza header lines.
 
diff --git a/scripts/abilist.awk b/scripts/abilist.awk
index 69da4512bf..c0b123f528 100644
--- a/scripts/abilist.awk
+++ b/scripts/abilist.awk
@@ -10,8 +10,7 @@ BEGIN {
 
 # Per-file header.
 /[^ :]+\.so\.[0-9]+:[ 	]+.file format .*$/ {
-  if (parse_names && soname != "")
-    emit(1);
+  emit(0);
 
   sofullname = $1;
   sub(/:$/, "", sofullname);
@@ -19,9 +18,14 @@ BEGIN {
   sub(/^.*\//, "", soname);
   sub(/\.so\.[0-9]+$/, "", soname);
 
+  suppress = ((filename_regexp != "" && sofullname !~ filename_regexp) \
+	      || (libname_regexp != "" && soname !~ libname_regexp));
+
   next
 }
 
+suppress { next }
+
 # Normalize columns.
 /^[0-9a-fA-F]+      / { sub(/      /, "  -   ") }
 
@@ -74,6 +78,9 @@ $2 == "g" || $2 == "w" && NF == 7 {
   if (desc == "")
     desc = " " symbol " " type size;
 
+  if (combine)
+    version = soname " " version (combine_fullname ? " " sofullname : "");
+
   if (version in versions) {
     versions[version] = versions[version] "\n" desc;
   }
@@ -90,7 +97,13 @@ NF == 0 || /DYNAMIC SYMBOL TABLE/ || /file format/ { next }
   print "Don't grok this line:", $0
 }
 
-function emit(tofile) {
+function emit(end) {
+  if (! parse_names || soname == "")
+    return;
+  if (combine && !end)
+    return;
+  tofile = !combine;
+
   nverslist = 0;
   for (version in versions) {
     if (nverslist == 0) {
@@ -119,9 +132,6 @@ function emit(tofile) {
     ++nverslist;
   }
 
-  if (combine)
-    tofile = 0;
-
   if (tofile) {
     out = prefix soname ".symlist";
     if (soname in outfiles)
@@ -141,12 +151,9 @@ function emit(tofile) {
       outpipe = "sort >> " out;
     }
     else {
-      if (combine_fullname)
-	print prefix soname, version, sofullname;
-      else if (combine)
-	print prefix soname, version;
-      else
-	print version;
+      if (combine)
+	print "";
+      print prefix version;
       outpipe = "sort";
     }
     print versions[version] | outpipe;
@@ -162,9 +169,5 @@ function emit(tofile) {
 }
 
 END {
-  if (! parse_names)
-    emit(0);
-  else if (soname != "") {
-    emit(1);
-  }
+  emit(1);
 }