home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / misc / src / rpm / autodeps / linux.req < prev    next >
Text File  |  1997-09-17  |  564b  |  19 lines

  1. #!/bin/sh
  2.  
  3. # note this works for both a.out and ELF executables
  4. # it also auto-generates requirment lines for shell scripts
  5.  
  6. ulimit -c 0
  7.  
  8. filelist=`sed "s/['\"]/\\\&/g"`
  9. exelist=`echo $filelist | xargs -r file | fgrep executable | cut -d: -f1 `
  10. scriptlist=`echo $filelist | xargs -r file | egrep ":.*(perl |script )" | cut -d: -f1 `
  11.  
  12. for f in $exelist; do
  13.     ldd $f | awk '/=>/ { print $1 }'
  14. done | sort -u | sed "s/['\"]/\\\&/g" | xargs -r -n 1 basename | sort -u
  15.  
  16. for f in $scriptlist; do
  17.     head -1 $f | sed -e 's/^\#\![     ]*//' | cut -d" " -f1
  18. done | sort -u
  19.