summaryrefslogtreecommitdiff
path: root/test/integration/test-pdiff-usage
blob: 0a82930185fd6a620bac924f43c3c4e8bf04b488 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
set -e

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
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
generatereleasefiles
signreleasefiles
find aptarchive -name 'Packages*' -type f -delete
aptget update -qq

testnopackage oldstuff
testequal "$(cat ${PKGFILE}-new)
" aptcache show apt newstuff