summaryrefslogtreecommitdiff
path: root/autodeps
diff options
context:
space:
mode:
Diffstat (limited to 'autodeps')
-rw-r--r--autodeps/hpux.prov2
-rw-r--r--autodeps/hpux.req4
-rw-r--r--autodeps/irix6.prov184
-rw-r--r--autodeps/irix6.req125
-rw-r--r--autodeps/osf.prov23
-rw-r--r--autodeps/osf.req2
6 files changed, 331 insertions, 9 deletions
diff --git a/autodeps/hpux.prov b/autodeps/hpux.prov
index c7872a500..1b6dffe9c 100644
--- a/autodeps/hpux.prov
+++ b/autodeps/hpux.prov
@@ -1,7 +1,7 @@
#! /usr/bin/ksh
# Original Author: Tim Mooney (mooney@plains.nodak.edu)
-# $Id: hpux.prov,v 1.2 1998/05/26 13:28:48 ewt Exp $
+# $Id: hpux.prov,v 1.3 1998/06/14 16:03:14 ewt Exp $
#
# This file is distributed under the terms of the GNU Public License
#
diff --git a/autodeps/hpux.req b/autodeps/hpux.req
index 0b9d90863..37896eb3f 100644
--- a/autodeps/hpux.req
+++ b/autodeps/hpux.req
@@ -1,7 +1,7 @@
#! /usr/bin/ksh
# Original Author: Tim Mooney (mooney@plains.nodak.edu)
-# $Id: hpux.req,v 1.2 1998/05/26 13:28:48 ewt Exp $
+# $Id: hpux.req,v 1.3 1998/06/14 16:03:14 ewt Exp $
#
# This file is distributed under the terms of the GNU Public License
#
@@ -66,7 +66,7 @@ do
#{ print NR, ": ", $0 }
- in_shlib_list == 1 && /dynamic[ ]+\// {
+ in_shlib_list == 1 && /dynamic[ ]+[\/\.]/ {
# split the line on "/" and print out the last element
numfields = split($0,fields,"/")
diff --git a/autodeps/irix6.prov b/autodeps/irix6.prov
index ec3450e6c..0d7a3bfbf 100644
--- a/autodeps/irix6.prov
+++ b/autodeps/irix6.prov
@@ -1,7 +1,189 @@
#! /usr/bin/ksh
# Original Author: Tim Mooney (mooney@plains.nodak.edu)
-# $Id: irix6.prov,v 1.1 1998/06/02 13:48:59 ewt Exp $
+# $Id: irix6.prov,v 1.2 1998/06/14 16:03:14 ewt Exp $
+#
+# This file is distributed under the terms of the GNU Public License
+#
+# find-provides is part of RPM, the Red Hat Package Manager. find-provides
+# reads a list of full pathnames (in a package) on stdin, and outputs all
+# shared libraries provided by (contained in) the package.
+#
+# NOTE: I use `:' as the delimiter (by default) between the library soname
+# and any library version info. This is because IRIX libraries (even
+# system libraries) have "version information" in both the soname and the
+# internal version field, so it's important to be able to separate those
+# fields. If we just used `.', we wouldn't know where the soname ends and
+# the version infromation begins.
+#
+#
+# On IRIX, use `elfdump -L' to find what libraries a package provides
+#
+# Example `elfdump -L' output:
+#
+#$elfdump -L /usr/lib/libc.so
+#
+#
+#/usr/lib/libc.so:
+#
+# **** DYNAMIC SECTION INFORMATION ****
+#.dynamic :
+#[INDEX] Tag Value
+#[0] HASH 0xfa099d0
+#[1] STRTAB 0xfa0027c
+#[2] SYMTAB 0xfa10e3c
+#[3] STRSZ 0x9751
+#[4] SYMENT 0x10
+#[5] INIT 0
+#[6] FINI 0
+#[7] RLDVERS 0x1
+#[8] FLAGS 0x1411
+#[9] BASEADDR 0xfa00000
+#[10] LOCGOTNO 0x3c
+#[11] PROTECT 0x3c
+#[12] HIDDEN 0x12
+#[13] CNFLCTNO 0
+#[14] LBLISTNO 0
+#[15] SYMTABNO 0xd19
+#[16] UNREFEXT 0x8
+#[17] GOTSYM 0x8b3
+#[18] LOCAL 0x12
+#[19] LOCALPG 0x1
+#[20] LOCALPG 0x10
+#[21] PLTGOT 0xfb483b0
+#[22] RLDTXT_ADR0xfb6b580
+#[23] OPTIONS 0xfa000f4
+#[24] SONAME libc.so.1
+#[25] TIMSTAMP Jun 16 18:23:15 1997
+#[26] CHECKSUM 0x92321a0c
+#[27] IVERSION sgi1.0
+#[28] REL 0xfa1dfcc
+#[29] RELSZ 0x1988
+#[30] RELENT 0x8
+#[31] MSYM 0xfa1f954
+#[32] COMPCTSIZE0xc60c
+#No Library List Section in /usr/lib/libc.so
+#
+
+PATH=/usr/bin:/usr/sbin
+export PATH
+
+for f in `cat - | xargs /usr/bin/file | egrep 'ELF.*dynamic lib' | cut -d: -f1`
+do
+ elfdump -L $f 2>/dev/null | awk '
+
+ BEGIN {
+ FS = " ";
+ RS = "\n";
+ OFS = "";
+
+ # The character that should separate the soname from
+ # the version information. If you change this, you
+ # should also change the same variable in the IRIX
+ # find-requires script
+ soname_version_delimiter=":"
+
+ found_soname = 0;
+ found_iversion = 0;
+ }
+
+ # Uncomment the next line for some debugging info.
+ #{ print NR , ":", $0 }
+
+ /[ ]+SONAME .*[ ]*$/ {
+ found_soname = 1;
+ numfields = split($0, internal_name)
+ if (numfields == 3) {
+ soname = $3
+ } else {
+ #
+ # Should never be here.
+ #
+ print "Really odd looking soname:", $0 | "cat 1>&2"
+ exit
+ }
+ }
+
+ /[ ]+IVERSION .*[ ]*$/ {
+ if (found_soname == 1) {
+ numfields = split($0, iversion)
+ if (numfields == 3) {
+ version = $3
+ #
+ # handle libraries with multiple versions, like
+ # 1.1:1.2. Since they really provide both versions,
+ # we need to generate output for each version.
+ #
+ numfields = split(version, versions, ":")
+ if (numfields > 1) {
+ for (i = 1; i < numfields; i++) {
+ print soname, soname_version_delimiter, versions[i]
+ }
+ #
+ # let our END routine print out the *last* version
+ # provided
+ #
+ version = versions[numfields]
+ }
+ #
+ # stick a fork in us.
+ #
+ found_iversion = 1;
+ exit
+ } else {
+ #
+ # handle libraries with comments and other junk in
+ # the version field. IRIX has a number of system libraries
+ # with whitespace and other junk in the version field!
+ #
+ # we discard the whitespace and keep the identifier after
+ # the # sign.
+ #
+ version = iversion[numfields]
+ numfields = split(version, version_junk, "#")
+ if (numfields > 1) {
+ version = version_junk[numfields]
+ found_iversion = 1;
+ }
+ }
+ } else {
+ #
+ # found an iversion without an soname. Is that possible?
+ #
+ print "Found version but no soname:", $0 | "cat 1>&2"
+ exit
+ }
+ }
+
+ #
+ # we could probably watch for some other token (like RELSZ)
+ # that *generally* occurs later in the input than the stuff we watch
+ # for, and exit if we see it, but it is just as easy to read all
+ # the output, even after we have seen what we are looking for.
+ #
+
+ END {
+ # Uncomment the next line for debugging info
+ #{ print "END: NR: ", NR }
+ if ( (found_soname == 1) && (found_iversion == 1) ) {
+ print soname, soname_version_delimiter, version
+ exit
+ } else if (found_soname == 1) {
+ #
+ # no library version information
+ #
+ print soname
+ }
+ # else do nothing
+ }
+ ' # end of awk
+#done | sort -u
+#comment out the previous line and uncomment the next line when debugging
+done
+#! /usr/bin/ksh
+
+# Original Author: Tim Mooney (mooney@plains.nodak.edu)
+# $Id: irix6.prov,v 1.2 1998/06/14 16:03:14 ewt Exp $
#
# This file is distributed under the terms of the GNU Public License
#
diff --git a/autodeps/irix6.req b/autodeps/irix6.req
index 75c0b1b82..48d0e4fd6 100644
--- a/autodeps/irix6.req
+++ b/autodeps/irix6.req
@@ -1,7 +1,130 @@
#! /usr/bin/ksh
# Original Author: Tim Mooney (mooney@plains.nodak.edu)
-# $Id: irix6.req,v 1.1 1998/06/02 13:48:59 ewt Exp $
+# $Id: irix6.req,v 1.2 1998/06/14 16:03:14 ewt Exp $
+#
+# This file is distributed under the terms of the GNU Public License
+#
+# find-requires is part of RPM, the Red Hat Package Manager. find-requires
+# reads a list of full pathnames (in a package) on stdin, and outputs all
+# shared libraries the package requires to execute.
+#
+# NOTE: I use `:' as the delimiter (by default) between the library soname
+# and any library version info. This is because IRIX libraries (even
+# system libraries) have "version information" in both the soname and the
+# internal version field, so it's important to be able to separate those
+# fields. If we just used `.', we wouldn't know where the soname ends and
+# the version infromation begins.
+#
+# On IRIX, use `elfdump -Dl' to find what libraries are required by
+# an executable. `elfdump -L' does what we need too, but it gives us more
+# than we really need.
+#
+# Example `elfdump -Dl' output:
+#
+#$elfdump -Dl /usr/bin/X11/xterm
+#
+#
+#
+#/usr/bin/X11/xterm:
+#
+# **** MIPS LIBLIST INFORMATION ****
+#.liblist :
+#[INDEX] Timestamp Checksum Flags Name Version
+#[1] Nov 23 15:39:02 1997 0x4da65893 ----- libXaw.so.2 sgi2.0
+#[2] Nov 23 15:39:02 1997 0x414eece6 ----- libXmu.so sgi1.0
+#[3] Nov 23 15:39:02 1997 0x6f314e69 ----- libXt.so sgi1.0
+#[4] Nov 23 15:39:02 1997 0xcbe81fff ----- libXext.so sgi1.0
+#[5] Nov 23 15:39:02 1997 0x89ae8e98 ----- libX11.so.1 sgi1.0
+#[6] Oct 27 01:00:29 1997 0x99b27890 ----- libcurses.so sgi1.0
+#[7] Jun 16 18:23:15 1997 0x92321a0c ----- libc.so.1 sgi1.0
+#
+
+#
+# TVM: it might be better to re-write this so that `file' isn't used, since
+# it can all be done with `elfdump', but this works.
+#
+
+PATH=/usr/bin:/usr/sbin
+export PATH
+
+filelist=`cat -`
+
+#
+# Handle scripts first
+#
+for f in `echo $filelist | xargs file | grep 'script text' | cut -d: -f 2 \
+ | awk '{ print $1 }'`
+do
+ print $f
+done | sort -u
+
+
+for f in `echo $filelist | xargs file | egrep 'executable|lib' | cut -d: -f1`
+do
+ #echo "Working on $f"
+ elfdump -Dl $f 2>/dev/null | awk '
+
+ #
+ # For you non-awk-ers, no single quotes in comments -- the shell
+ # sees them and things get hosed.
+ #
+
+ BEGIN {
+ found_column_headers = 0;
+ FS = " ";
+ RS = "\n";
+ OFS="";
+ soname_version_delimiter=":";
+ }
+
+ # uncomment the next line for debugging information
+ #{ print "Saw input:", $0 }
+
+ found_column_headers == 1 && $0 !~ /^$/ {
+
+ # get the library name (field 15) and the library version (field 16)
+ # if present.
+ numfields = split($0,fields)
+ if (numfields == 8) {
+ print fields[8]
+ } else if (numfields == 9) {
+ #
+ print fields[8], soname_version_delimiter, fields[9]
+ } else if (numfields > 9) {
+ #
+ # SGI has this annoying habit of putting comments, complete
+ # with whitespace, in their library IVERSION field. Yuck.
+ #
+ # Handle libraries like this gracefully.
+ #
+ verfields = split(fields[NF], junk, "#")
+ if (verfields == 2) {
+ print fields[8], soname_version_delimiter, junk[2]
+ } else if (verfields > 2) {
+ print fields[8], soname_version_delimiter, junk[verfields]
+ } else {
+ print "Cannot find version:", fields[numfields] | "cat 2>&1"
+ }
+ }
+ }
+
+ /^\[INDEX\].Timestamp.*Checksum.*Flags.*Name.*Version$/ {
+ # we better start paying attention now.
+ found_column_headers = 1
+ #
+ # uncomment the next line for debugging information
+ #print "found the column headers: ", $0
+ }
+
+ ' # end of awk
+done | sort -u
+# comment out the previous line and uncomment the next when debugging
+#done
+#! /usr/bin/ksh
+
+# Original Author: Tim Mooney (mooney@plains.nodak.edu)
+# $Id: irix6.req,v 1.2 1998/06/14 16:03:14 ewt Exp $
#
# This file is distributed under the terms of the GNU Public License
#
diff --git a/autodeps/osf.prov b/autodeps/osf.prov
index e7eeaf52f..9e1b51b42 100644
--- a/autodeps/osf.prov
+++ b/autodeps/osf.prov
@@ -1,9 +1,11 @@
#! /usr/bin/ksh
# Original Author: Tim Mooney (mooney@plains.nodak.edu)
+# $Id: osf.prov,v 1.2 1998/05/29 16:34:27 mooney Exp $
+#
# This file is distributed under the terms of the GNU Public License
#
-# find-provides is part of RPM, the RedHat Package Manager. find-provides
+# find-provides is part of RPM, the Red Hat Package Manager. find-provides
# reads a list of full pathnames (in a package) on stdin, and outputs all
# shared libraries provided by (contained in) the package.
#
@@ -53,6 +55,9 @@
# FLAGS: 0x00000001
#
+PATH=/usr/bin:/usr/sbin:/sbin:/usr/ccs/bin
+export PATH
+
for f in `cat -`
do
odump -D $f 2>/dev/null | awk '
@@ -64,6 +69,18 @@ do
found_soname = 0;
found_iversion = 0;
+
+ #
+ # what character should be used to separate the soname from any
+ # version info? Using a . is actually a bad idea, since some
+ # free/3rd party libraries may be built so that the library
+ # soname may have version info in it too. If we use . as the
+ # separator, it may not be possible to tell where the soname
+ # ends and the internal version info begins. It might be
+ # better to use a - or a : here. If you do so, be sure to
+ # change this setting in find-requires, too.
+ #
+ soname_version_delimiter=".";
}
# Uncomment the next line for some debugging info.
@@ -103,7 +120,7 @@ do
numfields = split(version, versions, ":")
if (numfields > 1) {
for (i = 1; i < numfields; i++) {
- print soname, ".", versions[i]
+ print soname, soname_version_delimiter, versions[i]
}
#
# let our END routine print out the *last* version
@@ -143,7 +160,7 @@ do
# Uncomment the next line for debugging info
#{ print "END: NR: ", NR }
if ( (found_soname == 1) && (found_iversion == 1) ) {
- print soname, ".", version
+ print soname, soname_version_delimiter, version
exit
} else if (found_soname == 1) {
#
diff --git a/autodeps/osf.req b/autodeps/osf.req
index dab930413..b5e091d9c 100644
--- a/autodeps/osf.req
+++ b/autodeps/osf.req
@@ -1,7 +1,7 @@
#! /usr/bin/ksh
# Original Author: Tim Mooney (mooney@plains.nodak.edu)
-# $Id: osf.req,v 1.2 1998/05/26 13:28:48 ewt Exp $
+# $Id: osf.req,v 1.3 1998/06/14 16:03:14 ewt Exp $
#
# This file is distributed under the terms of the GNU Public License
#