2 set +e
# its okay to fail in these script, most of the time the apt* stuff will generate errors
4 if [ -z "$1" -o -z "$2" ]; then
5 echo "Usage: $0 file codename pkg…"
9 TESTDIR
="$(readlink -f "$(dirname "$0")")"
10 . "$TESTDIR/framework
"
11 BUILDDIRECTORY="${TESTDIR}/..
/..
/build
/bin
"
18 trap "rm -rf $WORKDIR" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
20 TMPGEN=$WORKDIR/Packages
23 LISTOFPKGS=$(aptget install $* -t $CODENAME -so Dir::state::status=$WORKDIR/status -o Dir::Cache::archives=$WORKDIR -o pkgCacheGen::Essential=none -o APT::Immediate-Configure=0 2> /dev/null | awk '/^Inst/ {print $2}' | sed -e "s#\$#/$CODENAME#")
24 if [ -z "$LISTOFPKGS" ]; then
25 echo "List of packages is empty
: run apt
-get install command again
for you now
"
26 aptget install $* -t $CODENAME -so Dir::state::status=$WORKDIR/status -o Dir::Cache::archives=$WORKDIR -o pkgCacheGen::Essential=none -o APT::Immediate-Configure=0
29 aptcache show $LISTOFPKGS --no-all-versions 2> $WORKDIR/error.lst > $TMPGEN
32 -e '/^SHA1: / d' -e '/^SHA256: / d' \
33 -e '/^Homepage: / d' -e '/^Tag: / d' \
34 -e '/^Xul-Appid: / d' \
37 if [ "$CODENAME" = "experimental
" ]; then
38 aptcache show $(cat $WORKDIR/error.lst | cut -d"'" -f 4 | sed -e 's#$#/sid#') --no-all-versions 2> /dev/null >> $TMPGEN
41 if echo "$GENERATE" | grep '^status-' > /dev/null; then
42 sed -i $TMPGEN -e '/^Package: / a\
43 Status: install ok installed' \
44 -e '/^Filename: / d' -e '/^Size: / d' -e '/^MD5sum: / d'
47 apt-sortpkgs $TMPGEN > $GENERATE