summaryrefslogtreecommitdiff
path: root/test/integration/create-test-data
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2011-02-08 10:27:51 +0100
committerMichael Vogt <mvo@debian.org>2011-02-08 10:27:51 +0100
commit09b8bd3226a68272f98e4020d10348ff26642500 (patch)
tree1394a74a187ce61982c6c8649721de2f543459a1 /test/integration/create-test-data
parent7c748f4aa1bd47089672353fd1a401d1c5c94723 (diff)
parent4c6cf49317769725fee34a132c52ec1fe076b8b5 (diff)
merged from lp:~mvo/apt/mvo (which is really lp:~donkult/apt/sid with some updated comments ;)
Diffstat (limited to 'test/integration/create-test-data')
-rwxr-xr-xtest/integration/create-test-data16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/integration/create-test-data b/test/integration/create-test-data
index ff9405502..581b62910 100755
--- a/test/integration/create-test-data
+++ b/test/integration/create-test-data
@@ -1,6 +1,11 @@
#!/bin/sh
set +e # its okay to fail in these script, most of the time the apt* stuff will generate errors
+if [ -z "$1" -o -z "$2" ]; then
+ echo "Usage: $0 file codename pkg…"
+ exit 1
+fi
+
local TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
BUILDDIRECTORY="${TESTDIR}/../../build/bin"
@@ -16,7 +21,12 @@ 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
+if [ -z "$LISTOFPKGS" ]; then
+ echo "List of packages is empty: run apt-get install command again for you now"
+ aptget install $* -t $CODENAME -so Dir::state::status=$WORKDIR/status -o Dir::Cache::archives=$WORKDIR -o pkgCacheGen::Essential=none -o APT::Immediate-Configure=0
+ exit 1
+fi
+aptcache show $LISTOFPKGS --no-all-versions 2> $WORKDIR/error.lst > $TMPGEN
sed -i $TMPGEN \
-e '/^ / d' \
-e '/^SHA1: / d' -e '/^SHA256: / d' \
@@ -24,6 +34,10 @@ sed -i $TMPGEN \
-e '/^Xul-Appid: / d' \
-e '/^Status: / d'
+if [ "$CODENAME" = "experimental" ]; then
+ aptcache show $(cat $WORKDIR/error.lst | cut -d"'" -f 4 | sed -e 's#$#/sid#') --no-all-versions 2> /dev/null >> $TMPGEN
+fi
+
if echo "$GENERATE" | grep '^status-' > /dev/null; then
sed -i $TMPGEN -e '/^Package: / a\
Status: install ok installed' \