]> git.saurik.com Git - apt.git/blame - test/integration/create-test-data
test/integration/framework: set proper dir::state::status
[apt.git] / test / integration / create-test-data
CommitLineData
7d0627b6
DK
1#!/bin/sh
2set +e # its okay to fail in these script, most of the time the apt* stuff will generate errors
3
4local TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6BUILDDIRECTORY="${TESTDIR}/../../build/bin"
7
8GENERATE=$1
9CODENAME=$2
10shift 2
11
12WORKDIR=$(mktemp -d)
13trap "rm -rf $WORKDIR" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
14touch $WORKDIR/status
15TMPGEN=$WORKDIR/Packages
16export LANG=C
17
18LISTOFPKGS=$(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#")
19aptcache show $LISTOFPKGS --no-all-versions 2> /dev/null > $TMPGEN
20sed -i $TMPGEN \
21 -e '/^ / d' \
22 -e '/^SHA1: / d' -e '/^SHA256: / d' \
23 -e '/^Homepage: / d' -e '/^Tag: / d' \
24 -e '/^Xul-Appid: / d' \
25 -e '/^Status: / d'
26
27if echo "$GENERATE" | grep '^status-' > /dev/null; then
28 sed -i $TMPGEN -e '/^Package: / a\
29Status: install ok installed' \
30 -e '/^Filename: / d' -e '/^Size: / d' -e '/^MD5sum: / d'
31fi
32
33apt-sortpkgs $TMPGEN > $GENERATE