sign the created Release files with our own dummy key "Joe Sixpack"
authorDavid Kalnischkies <kalnischkies@gmail.com>
Wed, 18 Aug 2010 22:32:56 +0000 (00:32 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Wed, 18 Aug 2010 22:32:56 +0000 (00:32 +0200)
test/integration/framework
test/integration/joesixpack.pub [new file with mode: 0644]
test/integration/joesixpack.sec [new file with mode: 0644]

index e964235..01b795b 100644 (file)
@@ -82,7 +82,7 @@ setupenvironment() {
        local OLDWORKINGDIRECTORY=$(pwd)
        trap "cd /; rm -rf $TMPWORKINGDIRECTORY; cd $OLDWORKINGDIRECTORY" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
        cd $TMPWORKINGDIRECTORY
-       mkdir rootdir aptarchive
+       mkdir rootdir aptarchive keys
        cd rootdir
        mkdir -p etc/apt/apt.conf.d etc/apt/sources.list.d etc/apt/trusted.gpg.d etc/apt/preferences.d var/cache
        mkdir -p var/log/apt var/lib/apt
@@ -93,7 +93,7 @@ setupenvironment() {
        else
                touch var/lib/dpkg/status
        fi
-       touch var/lib/apt/extended_states var/lib/dpkg/available
+       touch var/lib/dpkg/available
        mkdir -p usr/lib/apt
        ln -s ${BUILDDIRECTORY}/methods usr/lib/apt/methods
        cd ..
@@ -103,6 +103,8 @@ setupenvironment() {
        else
                touch aptarchive/Packages
        fi
+       cp $(find $TESTDIR -name '*.pub' -o -name '*.sec') keys/
+       ln -s ${TMPWORKINGDIRECTORY}/keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
        echo "Dir \"${TMPWORKINGDIRECTORY}/rootdir\";" > aptconfig.conf
        echo "Debug::NoLocking \"true\";" >> aptconfig.conf
        echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf
@@ -275,7 +277,7 @@ buildaptarchivefromincoming() {
        msgdone "info"
        msgninfo "\tGenerate Release files… "
        for dir in $(find ./dists -mindepth 1 -maxdepth 1 -type d); do
-               aptftparchive -qq release $dir | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
+               aptftparchive -qq release $dir -o APT::FTPArchive::Release::Codename="$(echo "$dir" | cut -d'/' -f 3)" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
        done
        cd - > /dev/null
        msgdone "info"
@@ -342,7 +344,14 @@ setupaptarchive() {
        else
                setupflataptarchive
        fi
+       msgninfo "\tSign archive with Joe Sixpack key… "
+       for RELEASE in $(find aptarchive/ -name Release); do
+               gpg --no-default-keyring --secret-keyring ./keys/joesixpack.sec --keyring ./keys/joesixpack.pub --default-key Joe -abs -o ${RELEASE}.gpg ${RELEASE}
+       done
+       msgdone "info"
+       msgninfo "\tSync APT's cache with the archive… "
        aptget update -qq
+       msgdone "info"
 }
 
 diff() {
diff --git a/test/integration/joesixpack.pub b/test/integration/joesixpack.pub
new file mode 100644 (file)
index 0000000..2b40b97
Binary files /dev/null and b/test/integration/joesixpack.pub differ
diff --git a/test/integration/joesixpack.sec b/test/integration/joesixpack.sec
new file mode 100644 (file)
index 0000000..92aaada
Binary files /dev/null and b/test/integration/joesixpack.sec differ