home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / lib / rpm-2.5.5 / find-provides < prev    next >
Encoding:
Text File  |  1999-08-10  |  482 b   |  19 lines

  1. #!/bin/bash
  2.  
  3. # This script reads filenames from STDIN and outputs any relevant provides
  4. # information that needs to be included in the package.
  5.  
  6. filelist=$(grep "\\.so" | grep -v "^/lib/ld.so" | xargs file -L 2>/dev/null | grep "ELF.*shared object" | cut -d: -f1)
  7.  
  8. for f in $filelist; do
  9.     soname=$(objdump -p $f | awk '/SONAME/ {print $2}')
  10.  
  11.     if [ "$soname" != "" ]; then
  12.         if [ ! -L $f ]; then
  13.             echo $soname
  14.     fi
  15.     else
  16.     echo ${f##*/}
  17.     fi
  18. done | sort -u
  19.