
edogawaconan
By: a guest on Feb 22nd, 2009 | syntax:
None | size: 0.49 KB | hits: 187 | expires: Never
#!/bin/sh
if [ -x $1 ] || [ -x $2 ]; then
echo "Usage: getdeps package-name list-output-file"
exit
fi
if [ ! -f $1 ]; then
echo "File \""$1"\" not found"
exit
fi
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
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
echo "Finished parsing file \""$1"\""