diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e8f740a..d4e0cab 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -13,8 +13,8 @@ EXTRA_DIST = \ functions files.req.list \ magic.prov magic.req pam.prov pam.req perl.prov perl.req rpmdiff rpmdiff.cgi \ rpm.daily rpm.log rpm.xinetd rpm2cpio.sh \ - shell.req shell.prov sql.prov sql.req strip_files tcl.req trpm u_pkg.sh \ - verify-elf vpkg-provides.sh vpkg-provides2.sh + shell.req shell.prov shlib.req.awk sql.prov sql.req strip_files \ + tcl.req trpm u_pkg.sh verify-elf vpkg-provides.sh vpkg-provides2.sh installprefix = $(DESTDIR) @@ -32,5 +32,5 @@ config_SCRIPTS = \ functions files.req.list \ magic.prov magic.req pam.prov pam.req perl.prov perl.req rpmdiff rpmdiff.cgi \ rpm.daily rpm.log rpm.xinetd rpm2cpio.sh \ - shell.req shell.prov sql.prov sql.req strip_files tcl.req trpm u_pkg.sh \ - verify-elf vpkg-provides.sh vpkg-provides2.sh + shell.req shell.prov shlib.req.awk sql.prov sql.req strip_files \ + tcl.req trpm u_pkg.sh verify-elf vpkg-provides.sh vpkg-provides2.sh diff --git a/scripts/shlib.req.awk b/scripts/shlib.req.awk new file mode 100755 index 0000000..da0ea21 --- /dev/null +++ b/scripts/shlib.req.awk @@ -0,0 +1,41 @@ +#!/bin/awk -f + +BEGIN { + shared=0; version=0; name=""; +} +/^($)/ { + shared=0; version=0; name=""; + next; +} +/^private/ { + shared=0; version=0; name=""; + next; +} +/^Dynamic Section:$/ { + shared=1; + next; +} +/^Version References:$/ { + version=1; + next; +} + +(version==1) && /^ *required from/ { + sub(/:/, "", $3); + name=$3; + next; +} +(shared==1) && /^ *NEEDED/ { + lib[$2]=""; + next; +} +(version==1) && (name!="") && ($4!="") { + if (lib[name]!="") + lib[name]=lib[name] ":"; + lib[name]=lib[name] $4; + next; +} +END { + for (name in lib) + print name ":" lib[name]; +}