1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

* 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.
This commit is contained in:
Roland McGrath
2003-03-28 22:25:57 +00:00
parent 7e30918b78
commit f0248ca59c
2 changed files with 26 additions and 17 deletions

View File

@@ -1,5 +1,11 @@
2003-03-28 Roland McGrath <roland@redhat.com> 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 * scripts/abilist.awk: When given -v combine=1, do parse_names and
emit a single output stream with lib name in stanza header lines. emit a single output stream with lib name in stanza header lines.

View File

@@ -10,8 +10,7 @@ BEGIN {
# Per-file header. # Per-file header.
/[^ :]+\.so\.[0-9]+:[ ]+.file format .*$/ { /[^ :]+\.so\.[0-9]+:[ ]+.file format .*$/ {
if (parse_names && soname != "") emit(0);
emit(1);
sofullname = $1; sofullname = $1;
sub(/:$/, "", sofullname); sub(/:$/, "", sofullname);
@@ -19,9 +18,14 @@ BEGIN {
sub(/^.*\//, "", soname); sub(/^.*\//, "", soname);
sub(/\.so\.[0-9]+$/, "", soname); sub(/\.so\.[0-9]+$/, "", soname);
suppress = ((filename_regexp != "" && sofullname !~ filename_regexp) \
|| (libname_regexp != "" && soname !~ libname_regexp));
next next
} }
suppress { next }
# Normalize columns. # Normalize columns.
/^[0-9a-fA-F]+ / { sub(/ /, " - ") } /^[0-9a-fA-F]+ / { sub(/ /, " - ") }
@@ -74,6 +78,9 @@ $2 == "g" || $2 == "w" && NF == 7 {
if (desc == "") if (desc == "")
desc = " " symbol " " type size; desc = " " symbol " " type size;
if (combine)
version = soname " " version (combine_fullname ? " " sofullname : "");
if (version in versions) { if (version in versions) {
versions[version] = versions[version] "\n" desc; 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 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; nverslist = 0;
for (version in versions) { for (version in versions) {
if (nverslist == 0) { if (nverslist == 0) {
@@ -119,9 +132,6 @@ function emit(tofile) {
++nverslist; ++nverslist;
} }
if (combine)
tofile = 0;
if (tofile) { if (tofile) {
out = prefix soname ".symlist"; out = prefix soname ".symlist";
if (soname in outfiles) if (soname in outfiles)
@@ -141,12 +151,9 @@ function emit(tofile) {
outpipe = "sort >> " out; outpipe = "sort >> " out;
} }
else { else {
if (combine_fullname) if (combine)
print prefix soname, version, sofullname; print "";
else if (combine) print prefix version;
print prefix soname, version;
else
print version;
outpipe = "sort"; outpipe = "sort";
} }
print versions[version] | outpipe; print versions[version] | outpipe;
@@ -162,9 +169,5 @@ function emit(tofile) {
} }
END { END {
if (! parse_names) emit(1);
emit(0);
else if (soname != "") {
emit(1);
}
} }