3 # Original Author: Tim Mooney (mooney@plains.nodak.edu)
4 # $Id: hpux.prov,v 1.3 1998/06/14 16:03:14 ewt Exp $
6 # This file is distributed under the terms of the GNU Public License
8 # find-provides is part of RPM, the Red Hat Package Manager. find-provides
9 # reads a list of full pathnames (in a package) on stdin, and outputs all
10 # shared libraries provided by (contained in) the package.
13 # On HP-UX, use `chatr' to find what libraries a package provides
15 # Example chatr output:
17 #$chatr /usr/lib/libc.sl
21 # shared library dynamic path search:
22 # SHLIB_PATH disabled second
23 # embedded path disabled first Not Defined
26 # shared library list:
27 # dynamic /usr/lib/libdld.1
28 # static branch prediction disabled
29 # kernel assisted branch predictionenabled
30 # lazy swap allocationdisabled
31 # text segment lockingdisabled
32 # data segment lockingdisabled
34 # instruction page size: 4K
37 PATH=/usr/bin:/usr/sbin:/usr/ccs/bin
42 chatr $f 2>/dev/null | awk '
51 # We have seen the internal name: section (yet)?
53 found_internal_name = 0;
56 # assume it is a shared library, until record 2 proves us wrong.
58 isa_shared_library = 1;
61 # Uncomment the next line for some debugging info.
62 #{ print NR , ":", $0 }
65 # save the first line in case there is no internal name built
74 # Check the second line (record). Clear the flag if it is not a
77 NR == 2 && $0 !~ /^[ ]+shared library[ ]*$/ {
78 # It is not a shared library. Bow out early
79 isa_shared_library = 0;
84 # If we see this, we know we have passed all the information we care
87 /^ +shared library list: *$/ || /^ +static branch prediction/ {
92 in_internal_name == 1 {
94 # We found the library internal name. If it does not contain
95 # a path, print it. At least a couple of the system libraries
96 # have a full path as the internal name (this is probably a bug).
99 numfields = split($0, internal_name, "/")
100 print internal_name[numfields]
106 # Set a flag for the EXIT section, to indicate that we found
109 found_internal_name = 1;
113 # we have hit the internal name section. Set the flag
115 /^ +internal name: *$/ {
120 # Uncomment the next line for debugging info
121 #{ print "END: NR: ", NR }
122 if ( (isa_shared_library == 0) || (NR < 2) ) {
123 # both of these indicate error conditions, for which we
124 # should not generate any output.
127 if (found_internal_name == 1) {
131 # chop the : off the end of the line
133 colon = index(my_name, ":")
135 temp = substr(my_name, 1, colon)
139 numfields = split(temp, basename, "/")
140 # Uncomment the next line for debugging info
141 #print "In END:", numfields, ":", temp
142 print basename[numfields]
149 #comment out the previous line and uncomment the next line when debugging