From 9b78cda6873104b80ffdbc8b5d3965575ce0a31d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 18:55:46 +0100 Subject: add a way to add packages to generate a dists style environment without actually building all these packages --- test/integration/framework | 70 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 21 deletions(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index 2422f0886..5d849bda2 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -307,6 +307,37 @@ buildaptftparchivedirectorystructure() { done } +insertpackage() { + local RELEASE="$1" + local NAME="$2" + local ARCH="$3" + local VERSION="$4" + local DEPENDENCIES="$5" + local ARCHS="$ARCH" + if [ "$ARCHS" = "all" ]; then + ARCHS="$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')" + fi + for BUILDARCH in $ARCHS; do + local PPATH="aptarchive/dists/${RELEASE}/main/binary-${BUILDARCH}" + mkdir -p $PPATH aptarchive/dists/${RELEASE}/main/source + touch aptarchive/dists/${RELEASE}/main/source/Sources + local FILE="${PPATH}/Packages" + echo "Package: $NAME +Priority: optional +Section: other +Installed-Size: 23356 +Maintainer: Joe Sixpack +Architecture: $ARCH +Version: $VERSION" >> $FILE + test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE + echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + If you find such a package installed on your system, + YOU did something horribly wrong! They are autogenerated + und used only by testcases for APT and surf no other propose… +" >> $FILE + done +} + buildaptarchivefromincoming() { msginfo "Build APT archive for ${CCMD}$(basename $0)${CINFO} based on incoming packages…" cd aptarchive @@ -315,36 +346,33 @@ buildaptarchivefromincoming() { [ -e dists ] || buildaptftparchivedirectorystructure msgninfo "\tGenerate Packages, Sources and Contents files… " aptftparchive -qq generate ftparchive.conf - msgdone "info" - msgninfo "\tGenerate Release files… " - for dir in $(find ./dists -mindepth 1 -maxdepth 1 -type d); do - 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" + generatereleasefiles } buildaptarchivefromfiles() { msginfo "Build APT archive for ${CCMD}$(basename $0)${CINFO} based on prebuild files…" - cd aptarchive - if [ -f Packages ]; then - msgninfo "\tPackages file… " - cat Packages | gzip > Packages.gz - cat Packages | bzip2 > Packages.bz2 - cat Packages | lzma > Packages.lzma - msgdone "info" - fi - if [ -f Sources ]; then - msgninfo "\tSources file… " - cat Sources | gzip > Sources.gz - cat Sources | bzip2 > Sources.bz2 - cat Sources | lzma > Sources.lzma + find aptarchive -name 'Packages' -o -name 'Sources' | while read line; do + msgninfo "\t${line} file… " + cat ${line} | gzip > ${line}.gz + cat ${line} | bzip2 > ${line}.bz2 + cat ${line} | lzma > ${line}.lzma msgdone "info" + done + generatereleasefiles +} + +generatereleasefiles() { + msgninfo "\tGenerate Release files… " + if [ -e aptarchive/dists ]; then + for dir in $(find ./aptarchive/dists -mindepth 1 -maxdepth 1 -type d); do + aptftparchive -qq release $dir -o APT::FTPArchive::Release::Codename="$(echo "$dir" | cut -d'/' -f 4)" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference + done + else + aptftparchive -qq release ./aptarchive | sed -e '/0 Release$/ d' > aptarchive/Release # remove the self reference fi - msgninfo "\tRelease file… " - aptftparchive -qq release . | sed -e '/0 Release$/ d' > Release # remove the self reference msgdone "info" - cd .. } setupdistsaptarchive() { -- cgit v1.2.3 From 35faae110d5b0265fa2f8ea7f4e092b736161397 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 18:56:36 +0100 Subject: if the codename is "experimental" add NotAutomatic:yes by default --- test/integration/framework | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index 5d849bda2..63962858a 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -367,7 +367,12 @@ generatereleasefiles() { msgninfo "\tGenerate Release files… " if [ -e aptarchive/dists ]; then for dir in $(find ./aptarchive/dists -mindepth 1 -maxdepth 1 -type d); do - aptftparchive -qq release $dir -o APT::FTPArchive::Release::Codename="$(echo "$dir" | cut -d'/' -f 4)" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference + local CODENAME="$(echo "$dir" | cut -d'/' -f 4)" + aptftparchive -qq release $dir -o APT::FTPArchive::Release::Codename="${CODENAME}" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference + if [ "$CODENAME" = "experimental" ]; then + sed -i '/^Date: / a\ +NotAutomatic: yes' $dir/Release + fi done else aptftparchive -qq release ./aptarchive | sed -e '/0 Release$/ d' > aptarchive/Release # remove the self reference -- cgit v1.2.3 From f425d4d5d65b317b84fd56ea40f469ca008b7773 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 19:14:26 +0100 Subject: ensure that the build methods are used and not these on the system --- test/integration/framework | 1 + 1 file changed, 1 insertion(+) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index 63962858a..bc427c544 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -116,6 +116,7 @@ setupenvironment() { echo "Dir::state::status \"${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status\";" >> aptconfig.conf echo "Debug::NoLocking \"true\";" >> aptconfig.conf echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf + echo "Dir::Bin::Methods \"${BUILDDIRECTORY}/methods\";" >> aptconfig.conf echo "Dir::Bin::dpkg \"fakeroot\";" >> aptconfig.conf echo "DPKG::options:: \"dpkg\";" >> aptconfig.conf echo "DPKG::options:: \"--root=${TMPWORKINGDIRECTORY}/rootdir\";" >> aptconfig.conf -- cgit v1.2.3 From 0dc05bf095ebe2908f7d9096b3914b8c988c023e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 19:15:19 +0100 Subject: =?UTF-8?q?$!=20doesn't=20worked=20on=20the=20first=20try=20someho?= =?UTF-8?q?w,=20now=20it=20does=20and=20its=20(a=20lot)=20cleaner=20than?= =?UTF-8?q?=20using=20this=20ps=20"magic"=20as=20this=20fails=20now=20and?= =?UTF-8?q?=20then=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/integration/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index bc427c544..a0bad4170 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -445,7 +445,7 @@ signreleasefiles() { changetowebserver() { if which weborf > /dev/null; then weborf -xb aptarchive/ 2>&1 > /dev/null & - CURRENTTRAP="kill $(ps | grep weborf | sed -e 's#^[ ]*##' | cut -d' ' -f 1); $CURRENTTRAP" + CURRENTTRAP="kill $!; $CURRENTTRAP" trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM local APTARCHIVE="file://$(readlink -f ./aptarchive)" for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do -- cgit v1.2.3 From b6b5a542bd5a2580fff3d3ec2ce91a41e9622d6d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 19:23:54 +0100 Subject: add framework code to run the installed aptitude with the current build library in the test environment --- test/integration/framework | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index a0bad4170..8abefc814 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -78,6 +78,15 @@ aptkey() { runapt apt-key $*; } dpkg() { $(which dpkg) --root=${TMPWORKINGDIRECTORY}/rootdir --force-not-root --force-bad-path --log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log $* } +aptitude() { + if [ -f ./aptconfig.conf ]; then + APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which aptitude) $* + elif [ -f ../aptconfig.conf ]; then + APT_CONFIG=../aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which aptitude) $* + else + LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which aptitude) $* + fi +} setupenvironment() { TMPWORKINGDIRECTORY=$(mktemp -d) -- cgit v1.2.3 From 4a4ea26c2d0f89c13e0ccf6fb2d96ad1caa6427d Mon Sep 17 00:00:00 2001 From: Andres Mejia Date: Tue, 30 Nov 2010 19:25:39 +0100 Subject: Add support for providing and autocopying Sources files along the way of status and Packages files with a testcase --- test/integration/framework | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index 8abefc814..7af59deb0 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -119,6 +119,12 @@ setupenvironment() { else touch aptarchive/Packages fi + local SOURCESSFILE=$(echo "$(basename $0)" | sed -e 's/^test-/Sources-/' -e 's/^skip-/Sources-/') + if [ -f "${TESTDIR}/${SOURCESSFILE}" ]; then + cp "${TESTDIR}/${SOURCESSFILE}" aptarchive/Sources + else + touch aptarchive/Sources + 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 -- cgit v1.2.3 From db4b5f77e1f9f64a54baeff74c0400f0134c1d0d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 19:29:22 +0100 Subject: do not touch Packages and Sources in the framework if the files do not exist to not generate sources.list entries later for them --- test/integration/framework | 4 ---- 1 file changed, 4 deletions(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index 7af59deb0..aa8cdacc6 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -116,14 +116,10 @@ setupenvironment() { local PACKAGESFILE=$(echo "$(basename $0)" | sed -e 's/^test-/Packages-/' -e 's/^skip-/Packages-/') if [ -f "${TESTDIR}/${PACKAGESFILE}" ]; then cp "${TESTDIR}/${PACKAGESFILE}" aptarchive/Packages - else - touch aptarchive/Packages fi local SOURCESSFILE=$(echo "$(basename $0)" | sed -e 's/^test-/Sources-/' -e 's/^skip-/Sources-/') if [ -f "${TESTDIR}/${SOURCESSFILE}" ]; then cp "${TESTDIR}/${SOURCESSFILE}" aptarchive/Sources - else - touch aptarchive/Sources fi cp $(find $TESTDIR -name '*.pub' -o -name '*.sec') keys/ ln -s ${TMPWORKINGDIRECTORY}/keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg -- cgit v1.2.3 From 2c085486d34c45e123c24b0e36294245fd5bf734 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 3 Dec 2010 17:06:34 +0100 Subject: * apt-pkg/depcache.cc: - add SetCandidateRelease() to set a candidate version and the candidates of dependencies if needed to a specified release (Closes: #572709) - change pkg/release behavior to use the new SetCandidateRelease so installing packages from experimental or backports is easier --- test/integration/framework | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index aa8cdacc6..4bbe1b408 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -134,6 +134,7 @@ setupenvironment() { echo "DPKG::options:: \"--force-not-root\";" >> aptconfig.conf echo "DPKG::options:: \"--force-bad-path\";" >> aptconfig.conf echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf + echo 'quiet::NoUpdate "true";' >> aptconfig.conf export LC_ALL=C msgdone "info" } @@ -337,10 +338,11 @@ insertpackage() { echo "Package: $NAME Priority: optional Section: other -Installed-Size: 23356 +Installed-Size: 42 Maintainer: Joe Sixpack Architecture: $ARCH -Version: $VERSION" >> $FILE +Version: $VERSION +Filename: pool/main/${NAME}/${NAME}_${VERSION}_${ARCH}.deb" >> $FILE test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} If you find such a package installed on your system, @@ -380,8 +382,8 @@ generatereleasefiles() { if [ -e aptarchive/dists ]; then for dir in $(find ./aptarchive/dists -mindepth 1 -maxdepth 1 -type d); do local CODENAME="$(echo "$dir" | cut -d'/' -f 4)" - aptftparchive -qq release $dir -o APT::FTPArchive::Release::Codename="${CODENAME}" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference - if [ "$CODENAME" = "experimental" ]; then + aptftparchive -qq release $dir -o APT::FTPArchive::Release::Suite="${CODENAME}" -o APT::FTPArchive::Release::Codename="${CODENAME}" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference + if [ "$CODENAME" = "experimental" -o "$CODENAME" = "experimental2" ]; then sed -i '/^Date: / a\ NotAutomatic: yes' $dir/Release fi -- cgit v1.2.3 From 39cc82288036a005226564fadd05ef19ef0037bb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 16 Jan 2011 13:33:24 +0100 Subject: implement i quiet run-tests mode which prints only one line per testcase --- test/integration/framework | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index 4bbe1b408..5d54e49b6 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -39,6 +39,10 @@ fi if [ $MSGLEVEL -le 2 ]; then msgmsg() { true; } msgnmsg() { true; } + msgtest() { true; } + msgpass() { echo -n " ${CPASS}P${CNORMAL}" >&2; } + msgskip() { echo -n " ${CWARNING}S${CNORMAL}" >&2; } + msgfail() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; } fi if [ $MSGLEVEL -le 3 ]; then msginfo() { true; } -- cgit v1.2.3 From fe0f7911b650918e1d511b3453664a07f6d966d0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 20 Jan 2011 14:53:52 +0100 Subject: - try downloading clearsigned InRelease before trying Release.gpg * apt-pkg/deb/deblistparser.cc: - rewrite LoadReleaseInfo to cope with clearsigned Releasefiles --- test/integration/framework | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index 5d54e49b6..cb3fca35d 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -383,6 +383,7 @@ buildaptarchivefromfiles() { generatereleasefiles() { msgninfo "\tGenerate Release files… " + local DATE="${1:-now}" if [ -e aptarchive/dists ]; then for dir in $(find ./aptarchive/dists -mindepth 1 -maxdepth 1 -type d); do local CODENAME="$(echo "$dir" | cut -d'/' -f 4)" @@ -395,6 +396,11 @@ NotAutomatic: yes' $dir/Release else aptftparchive -qq release ./aptarchive | sed -e '/0 Release$/ d' > aptarchive/Release # remove the self reference fi + if [ "$DATE" != "now" ]; then + for release in $(find ./aptarchive -name 'Release'); do + touch -d "$1" $release + done + fi msgdone "info" } @@ -455,6 +461,7 @@ signreleasefiles() { done for RELEASE in $(find aptarchive/ -name Release); do gpg --yes --no-default-keyring $SECKEYS $PUBKEYS --default-key "$SIGNER" -abs -o ${RELEASE}.gpg ${RELEASE} + gpg --yes --no-default-keyring $SECKEYS $PUBKEYS --default-key "$SIGNER" --clearsign -o "$(echo "${RELEASE}" | sed 's#/Release$#/InRelease#')" $RELEASE done msgdone "info" } -- cgit v1.2.3 From b720d0bd5308b65dc08b930005c2d9b6dfc31bb9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 20 Jan 2011 16:02:15 +0100 Subject: ensure that tempfiles used for comparision are removed --- test/integration/framework | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index cb3fca35d..f55cfddfa 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -92,6 +92,11 @@ aptitude() { fi } +addtrap() { + CURRENTTRAP="$CURRENTTRAP $1" + trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM +} + setupenvironment() { TMPWORKINGDIRECTORY=$(mktemp -d) local TESTDIR=$(readlink -f $(dirname $0)) @@ -99,8 +104,7 @@ setupenvironment() { BUILDDIRECTORY="${TESTDIR}/../../build/bin" test -x "${BUILDDIRECTORY}/apt-get" || msgdie "You need to build tree first" local OLDWORKINGDIRECTORY=$(pwd) - CURRENTTRAP="cd /; rm -rf $TMPWORKINGDIRECTORY; cd $OLDWORKINGDIRECTORY" - trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM + addtrap "cd /; rm -rf $TMPWORKINGDIRECTORY; cd $OLDWORKINGDIRECTORY;" cd $TMPWORKINGDIRECTORY mkdir rootdir aptarchive keys cd rootdir @@ -469,8 +473,7 @@ signreleasefiles() { changetowebserver() { if which weborf > /dev/null; then weborf -xb aptarchive/ 2>&1 > /dev/null & - CURRENTTRAP="kill $!; $CURRENTTRAP" - trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM + addtrap "kill $!;" local APTARCHIVE="file://$(readlink -f ./aptarchive)" for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do sed -i $LIST -e "s#$APTARCHIVE#http://localhost:8080/#" @@ -504,17 +507,18 @@ testfileequal() { testequal() { local COMPAREFILE=$(mktemp) + addtrap "rm $COMPAREFILE;" echo "$1" > $COMPAREFILE shift msgtest "Test for equality of" "$*" $* 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail - rm $COMPAREFILE } testequalor2() { local COMPAREFILE1=$(mktemp) local COMPAREFILE2=$(mktemp) local COMPAREAGAINST=$(mktemp) + addtrap "rm $COMPAREFILE1 $COMPAREFILE2 $COMPAREAGAINST;" echo "$1" > $COMPAREFILE1 echo "$2" > $COMPAREFILE2 shift 2 @@ -525,7 +529,6 @@ testequalor2() { ( echo "\n${CINFO}Diff against OR 1${CNORMAL}" "$(checkdiff $COMPAREFILE1 $COMPAREAGAINST)" \ "\n${CINFO}Diff against OR 2${CNORMAL}" "$(checkdiff $COMPAREFILE2 $COMPAREAGAINST)" && msgfail ) - rm $COMPAREFILE1 $COMPAREFILE2 $COMPAREAGAINST } testshowvirtual() { @@ -542,11 +545,11 @@ N: Can't select versions from package '$1' as it purely virtual" VIRTUAL="${VIRTUAL} N: No packages found" local COMPAREFILE=$(mktemp) + addtrap "rm $COMPAREFILE;" local ARCH=$(dpkg-architecture -qDEB_HOST_ARCH_CPU) eval `apt-config shell ARCH APT::Architecture` echo "$VIRTUAL" | sed -e "s/:$ARCH//" -e 's/:all//' > $COMPAREFILE aptcache show -q=0 $PACKAGE 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail - rm $COMPAREFILE } testnopackage() { -- cgit v1.2.3 From b761356f9a73e34325a0d85427300b58737c4d98 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 21 Jan 2011 22:03:42 +0100 Subject: avoid building simple packages with debhelper to speed it up a bit --- test/integration/framework | 48 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index f55cfddfa..5b83e7519 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -219,9 +219,53 @@ buildsimplenativepackage() { else DISTSECTION="$(echo "$SECTION" | cut -d'/' -f 1)" fi - setupsimplenativepackage "$NAME" "$ARCH" "$VERSION" "$RELEASE" "$DEPENDENCIES" "$DESCRIPTION" "$SECTION" - buildpackage "incoming/${NAME}-${VERSION}" "$RELEASE" "$DISTSECTION" + local BUILDDIR=incoming/${NAME}-${VERSION} + + msgninfo "Build package ${NAME} in ${VERSIOM} for ${RELEASE} in ${DISTSECTION}… " + mkdir -p $BUILDDIR/debian/source + echo "* most suckless software product ever" > ${BUILDDIR}/FEATURES + echo "#!/bin/sh +echo '$NAME says \"Hello!\"'" > ${BUILDDIR}/${NAME} + + echo "Copyleft by Joe Sixpack $(date +%Y)" > ${BUILDDIR}/debian/copyright + echo "$NAME ($VERSION) $RELEASE; urgency=low + + * Initial release + + -- Joe Sixpack $(date -R)" > ${BUILDDIR}/debian/changelog + echo "Source: $NAME +Section: $SECTION +Priority: optional +Maintainer: Joe Sixpack +Standards-Version: 3.9.1 + +Package: $NAME +Architecture: $ARCH" > ${BUILDDIR}/debian/control + test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> ${BUILDDIR}/debian/control + if [ -z "$DESCRIPTION" ]; then + echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + If you find such a package installed on your system, + YOU did something horribly wrong! They are autogenerated + und used only by testcases for APT and surf no other propose…" >> ${BUILDDIR}/debian/control + else + echo "Description: $DESCRIPTION" >> ${BUILDIR}/debian/control + fi + echo '3.0 (native)' > ${BUILDDIR}/debian/source/format + local SRCS="$( (cd ${BUILDDIR}/..; dpkg-source -b ${NAME}-${VERSION} 2>&1) | grep '^dpkg-source: info: building' | grep -o '[a-z0-9._+~-]*$')" + + mkdir -p ${BUILDDIR}/debian/tmp/DEBIAN ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} ${BUILDDIR}/debian/tmp/usr/bin + cp ${BUILDDIR}/debian/copyright ${BUILDDIR}/debian/changelog ${BUILDDIR}/FEATURES ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} + cp ${BUILDDIR}/${NAME} ${BUILDDIR}/debian/tmp/usr/bin + (cd ${BUILDDIR}; dpkg-gencontrol) + (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums) + + dpkg-deb --build ${BUILDDIR}/debian/tmp incoming > /dev/null + echo "pool/${NAME}_${VERSION}_${ARCH}.deb" >> incoming/${RELEASE}.${DISTSECTION}.pkglist + for SRC in $SRCS; do + echo "pool/${SRC}" >> incoming/${RELEASE}.${DISTSECTION}.srclist + done rm -rf "incoming/${NAME}-${VERSION}" + msgdone "info" } buildpackage() { -- cgit v1.2.3 From 18331adf730dca4a587f99605edff71436379ea6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 25 Jan 2011 12:39:42 +0100 Subject: enable the split out of LongDescriptions per default in the testcases --- test/integration/framework | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index 5b83e7519..b95667670 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -221,7 +221,7 @@ buildsimplenativepackage() { fi local BUILDDIR=incoming/${NAME}-${VERSION} - msgninfo "Build package ${NAME} in ${VERSIOM} for ${RELEASE} in ${DISTSECTION}… " + msgninfo "Build package ${NAME} in ${VERSION} for ${RELEASE} in ${DISTSECTION}… " mkdir -p $BUILDDIR/debian/source echo "* most suckless software product ever" > ${BUILDDIR}/FEATURES echo "#!/bin/sh @@ -319,6 +319,8 @@ Default { Packages::Compress ". gzip bzip2 lzma"; Sources::Compress ". gzip bzip2 lzma"; Contents::Compress ". gzip bzip2 lzma"; + Translation::Compress ". gzip bzip2 lzma"; + LongDescription "false"; }; TreeDefault { Directory "pool/"; @@ -433,6 +435,9 @@ generatereleasefiles() { msgninfo "\tGenerate Release files… " local DATE="${1:-now}" if [ -e aptarchive/dists ]; then + for dir in $(find ./aptarchive/dists -mindepth 3 -maxdepth 3 -type d -name 'i18n'); do + aptftparchive -qq release $dir -o APT::FTPArchive::Release::Patterns::='Translation-*' > $dir/Index + done for dir in $(find ./aptarchive/dists -mindepth 1 -maxdepth 1 -type d); do local CODENAME="$(echo "$dir" | cut -d'/' -f 4)" aptftparchive -qq release $dir -o APT::FTPArchive::Release::Suite="${CODENAME}" -o APT::FTPArchive::Release::Codename="${CODENAME}" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference -- cgit v1.2.3 From 5a635ee4bafd8ba4cde6e50ea256e36d2c55dc64 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 28 Jan 2011 13:26:11 +0100 Subject: ensure that we are building really inside of our tmp directory --- test/integration/framework | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index b95667670..c85914289 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -219,7 +219,7 @@ buildsimplenativepackage() { else DISTSECTION="$(echo "$SECTION" | cut -d'/' -f 1)" fi - local BUILDDIR=incoming/${NAME}-${VERSION} + local BUILDDIR=${TMPWORKINGDIRECTORY}/incoming/${NAME}-${VERSION} msgninfo "Build package ${NAME} in ${VERSION} for ${RELEASE} in ${DISTSECTION}… " mkdir -p $BUILDDIR/debian/source @@ -259,12 +259,12 @@ Architecture: $ARCH" > ${BUILDDIR}/debian/control (cd ${BUILDDIR}; dpkg-gencontrol) (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums) - dpkg-deb --build ${BUILDDIR}/debian/tmp incoming > /dev/null - echo "pool/${NAME}_${VERSION}_${ARCH}.deb" >> incoming/${RELEASE}.${DISTSECTION}.pkglist + dpkg-deb --build ${BUILDDIR}/debian/tmp ${BUILDDIR}/.. > /dev/null + echo "pool/${NAME}_${VERSION}_${ARCH}.deb" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.pkglist for SRC in $SRCS; do - echo "pool/${SRC}" >> incoming/${RELEASE}.${DISTSECTION}.srclist + echo "pool/${SRC}" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.srclist done - rm -rf "incoming/${NAME}-${VERSION}" + rm -rf "${BUILDDIR}" msgdone "info" } -- cgit v1.2.3 From 875bcb3670c43bd4450e27934ba105611e534df0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 1 Feb 2011 10:58:48 +0100 Subject: ensure that we are building the packages in the right architecture --- test/integration/framework | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index c85914289..ee4048a53 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -188,8 +188,12 @@ Maintainer: Joe Sixpack Build-Depends: debhelper (>= 7) Standards-Version: 3.9.1 -Package: $NAME -Architecture: $ARCH" > debian/control +Package: $NAME" > debian/control + if [ "$ARCH" = 'all' ]; then + echo "Architecture: all" >> debian/control + else + echo "Architecture: any" >> debian/control + fi test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> debian/control if [ -z "$DESCRIPTION" ]; then echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} @@ -239,8 +243,12 @@ Priority: optional Maintainer: Joe Sixpack Standards-Version: 3.9.1 -Package: $NAME -Architecture: $ARCH" > ${BUILDDIR}/debian/control +Package: $NAME" > ${BUILDDIR}/debian/control + if [ "$ARCH" = 'all' ]; then + echo "Architecture: all" >> ${BUILDDIR}/debian/control + else + echo "Architecture: any" >> ${BUILDDIR}/debian/control + fi test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> ${BUILDDIR}/debian/control if [ -z "$DESCRIPTION" ]; then echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} @@ -256,7 +264,7 @@ Architecture: $ARCH" > ${BUILDDIR}/debian/control mkdir -p ${BUILDDIR}/debian/tmp/DEBIAN ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} ${BUILDDIR}/debian/tmp/usr/bin cp ${BUILDDIR}/debian/copyright ${BUILDDIR}/debian/changelog ${BUILDDIR}/FEATURES ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} cp ${BUILDDIR}/${NAME} ${BUILDDIR}/debian/tmp/usr/bin - (cd ${BUILDDIR}; dpkg-gencontrol) + (cd ${BUILDDIR}; dpkg-gencontrol -DArchitecture=$ARCH) (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums) dpkg-deb --build ${BUILDDIR}/debian/tmp ${BUILDDIR}/.. > /dev/null -- cgit v1.2.3