diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-24 16:34:12 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-24 16:34:12 +0200 |
commit | 7c122f33c4bf8caec1cf8b250d512b65c3c574ca (patch) | |
tree | 81786b34b546c76a27027df3a671bf35ef1aa15e /test/integration/create-test-data | |
parent | 99016ee630714bf906b1f58f6a898226bce0bb03 (diff) | |
parent | 662603c40b8b38e487f76e7aceb773c935203cea (diff) |
merged from debian-experimental-ma0.8.0
Diffstat (limited to 'test/integration/create-test-data')
-rwxr-xr-x | test/integration/create-test-data | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/integration/create-test-data b/test/integration/create-test-data new file mode 100755 index 000000000..ff9405502 --- /dev/null +++ b/test/integration/create-test-data @@ -0,0 +1,33 @@ +#!/bin/sh +set +e # its okay to fail in these script, most of the time the apt* stuff will generate errors + +local TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +BUILDDIRECTORY="${TESTDIR}/../../build/bin" + +GENERATE=$1 +CODENAME=$2 +shift 2 + +WORKDIR=$(mktemp -d) +trap "rm -rf $WORKDIR" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM +touch $WORKDIR/status +TMPGEN=$WORKDIR/Packages +export LANG=C + +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#") +aptcache show $LISTOFPKGS --no-all-versions 2> /dev/null > $TMPGEN +sed -i $TMPGEN \ + -e '/^ / d' \ + -e '/^SHA1: / d' -e '/^SHA256: / d' \ + -e '/^Homepage: / d' -e '/^Tag: / d' \ + -e '/^Xul-Appid: / d' \ + -e '/^Status: / d' + +if echo "$GENERATE" | grep '^status-' > /dev/null; then + sed -i $TMPGEN -e '/^Package: / a\ +Status: install ok installed' \ + -e '/^Filename: / d' -e '/^Size: / d' -e '/^MD5sum: / d' +fi + +apt-sortpkgs $TMPGEN > $GENERATE |