]> git.saurik.com Git - apt.git/commitdiff
add a way to add packages to generate a dists style environment without
authorDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 30 Nov 2010 17:55:46 +0000 (18:55 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 30 Nov 2010 17:55:46 +0000 (18:55 +0100)
actually building all these packages

test/integration/framework

index 2422f0886d0770e218a16155609ac0cdf26cc3f4..5d849bda2a2457d64070a40a6a790fc8fb50c9a1 100644 (file)
@@ -307,6 +307,37 @@ buildaptftparchivedirectorystructure() {
        done
 }
 
        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 <joe@example.org>
+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
 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
        [ -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"
        cd - > /dev/null
        msgdone "info"
+       generatereleasefiles
 }
 
 buildaptarchivefromfiles() {
        msginfo "Build APT archive for ${CCMD}$(basename $0)${CINFO} based on prebuild files…"
 }
 
 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"
                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
        fi
-       msgninfo "\tRelease file… "
-       aptftparchive -qq release . | sed -e '/0 Release$/ d' > Release # remove the self reference
        msgdone "info"
        msgdone "info"
-       cd ..
 }
 
 setupdistsaptarchive() {
 }
 
 setupdistsaptarchive() {