]> git.saurik.com Git - apt.git/blob - test/integration/test-pdiff-usage
merged from the debian-sid branch
[apt.git] / test / integration / test-pdiff-usage
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6
7 setupenvironment
8 configarchitecture "i386"
9
10 buildaptarchive
11 setupflataptarchive
12 changetowebserver
13 signreleasefiles
14 aptget update -qq
15
16 testnopackage newstuff
17 PKGFILE="${TESTDIR}/$(echo "$(basename $0)" | sed 's#^test-#Packages-#')"
18 testequal "$(cat ${PKGFILE})
19 " aptcache show apt oldstuff
20
21 cp ${PKGFILE}-new aptarchive/Packages
22 cat aptarchive/Packages | gzip > aptarchive/Packages.gz
23 cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2
24 cat aptarchive/Packages | lzma > aptarchive/Packages.lzma
25 rm -rf aptarchive/Packages.diff
26 aptftparchive release aptarchive/ > aptarchive/Release
27 mkdir -p aptarchive/Packages.diff
28 PATCHFILE="aptarchive/Packages.diff/$(date +%Y-%m-%d-%H%M.%S)"
29 diff -e ${PKGFILE} ${PKGFILE}-new > ${PATCHFILE} || true
30 cat $PATCHFILE | gzip > ${PATCHFILE}.gz
31 PATCHINDEX="aptarchive/Packages.diff/Index"
32 echo "SHA1-Current: $(sha1sum ${PKGFILE}-new | cut -d' ' -f 1) $(stat -c%s ${PKGFILE}-new)
33 SHA1-History:
34 9f4148e06d7faa37062994ff10d0c842d7017513 33053002 2010-08-18-2013.28
35 $(sha1sum $PKGFILE | cut -d' ' -f 1) $(stat -c%s $PKGFILE) $(basename $PATCHFILE)
36 SHA1-Patches:
37 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-0814.28
38 $(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX
39 sed -i aptarchive/Release \
40 -e "/^MD5Sum:/ a\
41 \ $(md5sum $PATCHINDEX | cut -d' ' -f 1) $(stat -c%s $PATCHINDEX) Packages.diff/Index" \
42 -e "/^SHA1:/ a\
43 \ $(sha1sum $PATCHINDEX | cut -d' ' -f 1) $(stat -c%s $PATCHINDEX) Packages.diff/Index" \
44 -e "/^SHA256:/ a\
45 \ $(sha256sum $PATCHINDEX | cut -d' ' -f 1) $(stat -c%s $PATCHINDEX) Packages.diff/Index"
46 signreleasefiles
47 aptget update -qq
48
49 testnopackage oldstuff
50 testequal "$(cat ${PKGFILE}-new)
51 " aptcache show apt newstuff