*** empty log message ***
authorewt <devnull@localhost>
Mon, 23 Mar 1998 16:26:10 +0000 (16:26 +0000)
committerewt <devnull@localhost>
Mon, 23 Mar 1998 16:26:10 +0000 (16:26 +0000)
CVS patchset: 2042
CVS date: 1998/03/23 16:26:10

autodeps/hpux.prov [new file with mode: 0644]
autodeps/hpux.req [new file with mode: 0644]

diff --git a/autodeps/hpux.prov b/autodeps/hpux.prov
new file mode 100644 (file)
index 0000000..c07b6b3
--- /dev/null
@@ -0,0 +1,145 @@
+#! /usr/bin/ksh
+
+# Original Author: Tim Mooney (mooney@plains.nodak.edu)
+# This file is distributed under the terms of the GNU Public License
+#
+# find-provides is part of RPM, the RedHat 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.
+#
+#
+# On HP-UX, use `chatr' to find what libraries a package provides
+#
+# Example chatr output:
+#
+#$chatr /usr/lib/libc.sl
+#
+#/usr/lib/libc.sl: 
+#         shared library 
+#         shared library dynamic path search:
+#             SHLIB_PATH     disabled  second 
+#             embedded path  disabled  first  Not Defined
+#         internal name:
+#             libc.1
+#         shared library list:
+#             dynamic   /usr/lib/libdld.1
+#         static branch prediction disabled
+#         kernel assisted branch predictionenabled
+#         lazy swap allocationdisabled
+#         text segment lockingdisabled
+#         data segment lockingdisabled
+#         data page size: 4K
+#         instruction page size: 4K
+#
+
+for f in `cat -`
+do
+       chatr $f 2>/dev/null | awk '
+
+               BEGIN { 
+                       FS = " ";
+                       RS = "\n";
+
+                       in_internal_name = 0;
+
+                       #
+                       # We have seen the internal name: section (yet)?
+                       #
+                       found_internal_name = 0;
+
+                       #
+                       # assume it is a shared library, until record 2 proves us wrong.
+                       #
+                       isa_shared_library = 1;
+               }
+
+               # Uncomment the next line for some debugging info.
+               #{ print NR , ":", $0  }
+
+               #
+               # save the first line in case there is no internal name built
+               # into this object.
+               #
+               NR == 1 {
+                       my_name = $0
+                       opened_something = 1;
+               }
+
+               #
+               # Check the second line (record).  Clear the flag if it is not a
+               # shared library.
+               #
+               NR == 2 && $0 !~ /^[    ]+shared library[       ]*$/ {
+                       # It is not a shared library.  Bow out early
+                       isa_shared_library = 0;
+                       exit
+               }
+
+               #
+               # If we see this, we know we have passed all the information we care
+               # about, so exit.
+               #
+               /^ +shared library list: *$/ || /^ +static branch prediction/ {
+                       in_internal_name = 0
+                       exit
+               }
+
+               in_internal_name == 1 {
+               
+                       # We found the library internal name.  If it does not contain
+                       # a path, print it.  At least a couple of the system libraries
+                       # have a full path as the internal name (this is probably a bug).
+
+                       if ( $0 ~ /\// ) {
+                               numfields = split($0, internal_name, "/")
+                               print internal_name[numfields]
+                       } else {
+                               print $1
+                       }
+
+                       #
+                       # Set a flag for the EXIT section, to indicate that we found
+                       # an internal name
+                       #
+                       found_internal_name = 1;
+               }
+
+               #
+               # we have hit the internal name section.  Set the flag
+               #
+               /^ +internal name: *$/ {
+                       in_internal_name = 1
+               }
+
+               END {
+                       # Uncomment the next line for debugging info
+                       #{ print "END: NR: ", NR }
+                       if ( (isa_shared_library == 0) || (NR < 2) ) {
+                               # both of these indicate error conditions, for which we
+                               # should not generate any output.
+                               exit;
+                       } else {
+                               if (found_internal_name == 1) {
+                                       exit;
+                               } else {
+                                       #
+                                       # chop the : off the end of the line
+                                       #
+                                       colon = index(my_name, ":")
+                                       colon = colon - 1
+                                       temp = substr(my_name, 1, colon)
+                                       #
+                                       # get the basename
+                                       #
+                                       numfields = split(temp, basename, "/")
+                                       # Uncomment the next line for debugging info
+                                       #print "In END:",  numfields, ":", temp
+                                       print basename[numfields]
+                                       exit
+                               }
+                       }
+               }
+       ' # end of awk
+done | sort -u
+#comment out the previous line and uncomment the next line when debugging
+#done
diff --git a/autodeps/hpux.req b/autodeps/hpux.req
new file mode 100644 (file)
index 0000000..cacb35d
--- /dev/null
@@ -0,0 +1,72 @@
+#! /usr/bin/ksh
+
+# Original Author: Tim Mooney (mooney@plains.nodak.edu)
+# This file is distributed under the terms of the GNU Public License
+#
+# find-requires is part of RPM, the RedHat Package Manager.  find-requires
+# reads a list of full pathnames (in a package) on stdin, and outputs all
+# shared libraries the package requires to run correctly.
+#
+# On HP-UX, use `chatr' to find the library dependencies for an executable
+#
+# Example chatr output:
+#
+#$chatr /usr/bin/chatr
+#/usr/bin/chatr: 
+#         shared executable 
+#         shared library dynamic path search:
+#             SHLIB_PATH     disabled  second 
+#             embedded path  disabled  first  Not Defined
+#         internal name:
+#             chatr
+#         shared library list:
+#             dynamic   /usr/lib/libc.1
+#         shared library binding:
+#             deferred 
+#         static branch prediction disabled
+#         kernel assisted branch predictionenabled
+#         lazy swap allocationdisabled
+#         text segment lockingdisabled
+#         data segment lockingdisabled
+#         data page size: 4K
+#         instruction page size: 4K
+
+#
+# TVM: it might be better to re-write this so that `file' isn't used, since
+# it can all be done with `chatr' (note the second line of chatr output tells
+# whether it's a shared executable or not), but this works.
+#
+filelist=`sed "s/['\"]/\\\&/g" | xargs file | grep executable | cut -d: -f1`
+
+for f in $filelist
+do
+       chatr $f | awk '
+
+               #
+               # For you non-awk-ers, no single quotes in comments -- the shell
+               # sees them and things get hosed.
+               #
+
+               BEGIN { 
+                       in_shlib_list = 0;
+                       FS = " ";
+                       RS = "\n";
+               }
+
+               in_shlib_list == 1 && /dynamic[         ]+\// {
+               
+                       # split the line on "/" and print out the last element
+                       numfields = split($0,fields,"/")
+                       print fields[numfields]
+
+               }
+
+               /^ +shared library list: *$/ {
+                       in_shlib_list = 1
+               }
+
+               /^ +shared library binding: *$/ {
+                       exit
+               }
+       ' # end of awk
+done | sort -u