summaryrefslogtreecommitdiff
path: root/test/integration/test-pdiff-usage
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-09-03 14:04:50 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-09-03 14:04:50 +0200
commit0205540433440a9ff4ad4ea4cce44c700a4b401c (patch)
tree97809e2e38482d3d7f124b30552a0936adf4d405 /test/integration/test-pdiff-usage
parent24baab5c477bf1e57a0b169a7bac1d2e9ab0c974 (diff)
parent2c6baa5a1f935eb3b8d4eb9fdef62e696416e27a (diff)
merged from lp:~donkult/apt/sid
Diffstat (limited to 'test/integration/test-pdiff-usage')
-rwxr-xr-xtest/integration/test-pdiff-usage51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage
new file mode 100755
index 000000000..85cbe9082
--- /dev/null
+++ b/test/integration/test-pdiff-usage
@@ -0,0 +1,51 @@
+#!/bin/sh
+set -e
+
+local TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+buildaptarchive
+setupflataptarchive
+changetowebserver
+signreleasefiles
+aptget update -qq
+
+testnopackage newstuff
+PKGFILE="${TESTDIR}/$(echo "$(basename $0)" | sed 's#^test-#Packages-#')"
+testequal "$(cat ${PKGFILE})
+" aptcache show apt oldstuff
+
+cp ${PKGFILE}-new aptarchive/Packages
+cat aptarchive/Packages | gzip > aptarchive/Packages.gz
+cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2
+cat aptarchive/Packages | lzma > aptarchive/Packages.lzma
+rm -rf aptarchive/Packages.diff
+aptftparchive release aptarchive/ > aptarchive/Release
+mkdir -p aptarchive/Packages.diff
+PATCHFILE="aptarchive/Packages.diff/$(date +%Y-%m-%d-%H%M.%S)"
+diff -e ${PKGFILE} ${PKGFILE}-new > ${PATCHFILE} || true
+cat $PATCHFILE | gzip > ${PATCHFILE}.gz
+PATCHINDEX="aptarchive/Packages.diff/Index"
+echo "SHA1-Current: $(sha1sum ${PKGFILE}-new | cut -d' ' -f 1) $(stat -c%s ${PKGFILE}-new)
+SHA1-History:
+ 9f4148e06d7faa37062994ff10d0c842d7017513 33053002 2010-08-18-2013.28
+ $(sha1sum $PKGFILE | cut -d' ' -f 1) $(stat -c%s $PKGFILE) $(basename $PATCHFILE)
+SHA1-Patches:
+ 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-0814.28
+ $(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX
+sed -i aptarchive/Release \
+ -e "/^MD5Sum:/ a\
+ \ $(md5sum $PATCHINDEX | cut -d' ' -f 1) $(stat -c%s $PATCHINDEX) Packages.diff/Index" \
+ -e "/^SHA1:/ a\
+ \ $(sha1sum $PATCHINDEX | cut -d' ' -f 1) $(stat -c%s $PATCHINDEX) Packages.diff/Index" \
+ -e "/^SHA256:/ a\
+ \ $(sha256sum $PATCHINDEX | cut -d' ' -f 1) $(stat -c%s $PATCHINDEX) Packages.diff/Index"
+signreleasefiles
+aptget update -qq
+
+testnopackage oldstuff
+testequal "$(cat ${PKGFILE}-new)
+" aptcache show apt newstuff