Share Pastebin
Guest
Public paste!

edogawaconan

By: a guest | Feb 22nd, 2009 | Syntax: None | Size: 0.49 KB | Hits: 185 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. #!/bin/sh
  2.  
  3. if [ -x $1 ] || [ -x $2 ]; then
  4.         echo "Usage: getdeps package-name list-output-file"
  5.         exit
  6. fi
  7. if [ ! -f $1 ]; then
  8.         echo "File \""$1"\" not found"
  9.         exit
  10. fi
  11. sudo /usr/bin/pacman -Sp `cat $1 | grep "^makedepends" | cut -b 13- | sed -e 's/^(//g' -e 's/)$//g' -e "s,',,g"` | tail -n +2 > $2
  12. sudo /usr/bin/pacman -Sp `cat $1 | grep "^depends" | cut -b 9- | sed -e 's/^(//g' -e 's/)$//g' -e "s,',,g"` | tail -n +2 >> $2
  13. echo "Finished parsing file \""$1"\""