instpkg cleanup
[cmdllinux.git] / buildroot / _pacman_ / getdeps.sh
blob46cdc56238366723af9b79c1b58bfb762a8c5b36
1 #! /bin/sh
2 #gather dependencies
4 tempdir=`mktemp -d 2> /dev/null` || tempdir=/tmp/tmpdir$$
5 trap "rm -rf $tempdir" 0 1 2 5 15
7 [ -z "$1" ] && exit 1
9 basedep(){
10 while read line; do grep " $line " /var/lib/instpkg/depends.local.data; done < $tempdir/base
13 grep " $1 " /var/lib/instpkg/depends.local.data | cut -d " " -f 1 > $tempdir/base
14 touch $tempdir/base.old
16 while ! cmp $tempdir/base $tempdir/base.old &> /dev/null; do
17 basedep | cut -d " " -f 1 > $tempdir/expand
18 cat $tempdir/base >> $tempdir/expand
19 cp $tempdir/base $tempdir/base.old
20 sort -u $tempdir/expand > $tempdir/base
21 echo -n > $tempdir/expand
22 done
24 cat $tempdir/base