diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-10-23 11:37:49 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-10-23 16:54:27 +0200 |
commit | 10e100e59a96ea7b6834a139beab5d9d70180633 (patch) | |
tree | 5647642e1631494ab779d71529b6baf63696c8aa /test/integration/framework | |
parent | 0e0d9919cc1749e5343b2076084d77122db1820d (diff) |
tests: support 'installed' release in insertpackage
It is sometimes handy to have an installed package also in the archive,
but this was until now harder than it should as you had to duplicate the
lines, which is especially dangerous while writing the tests as it
easily happens that these two lines divert and so the same-but-different
version detection kicks in.
Git-Dch: Ignore
Diffstat (limited to 'test/integration/framework')
-rw-r--r-- | test/integration/framework | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/test/integration/framework b/test/integration/framework index ea3903056..190d4d665 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -664,47 +664,53 @@ buildaptftparchivedirectorystructure() { } insertpackage() { - local RELEASE="$1" + local RELEASES="$1" local NAME="$2" local ARCH="$3" local VERSION="$4" local DEPENDENCIES="$5" local PRIORITY="${6:-optional}" - local DESCRIPTION="${7:-"an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + local DESCRIPTION="${7:-"an autogenerated dummy ${NAME}=${VERSION}/${RELEASES} If you find such a package installed on your system, something went horribly wrong! They are autogenerated und used only by testcases and surf no other proposeā¦"}" local ARCHS="" - for arch in $(getarchitecturesfromcommalist "$ARCH"); do - if [ "$arch" = 'all' -o "$arch" = 'none' ]; then - ARCHS="$(getarchitectures)" - else - ARCHS="$arch" + for RELEASE in $(printf '%s' "$RELEASES" | tr ',' '\n'); do + if [ "$RELEASE" = 'installed' ]; then + insertinstalledpackage "$2" "$3" "$4" "$5" "$6" "$7" + continue fi - for BUILDARCH in $ARCHS; do - local PPATH="aptarchive/dists/${RELEASE}/main/binary-${BUILDARCH}" - mkdir -p $PPATH - local FILE="${PPATH}/Packages" - echo "Package: $NAME + for arch in $(getarchitecturesfromcommalist "$ARCH"); do + if [ "$arch" = 'all' -o "$arch" = 'none' ]; then + ARCHS="$(getarchitectures)" + else + ARCHS="$arch" + fi + for BUILDARCH in $ARCHS; do + local PPATH="aptarchive/dists/${RELEASE}/main/binary-${BUILDARCH}" + mkdir -p $PPATH + local FILE="${PPATH}/Packages" + echo "Package: $NAME Priority: $PRIORITY Section: other Installed-Size: 42 Maintainer: Joe Sixpack <joe@example.org>" >> $FILE - test "$arch" = 'none' || echo "Architecture: $arch" >> $FILE - echo "Version: $VERSION + test "$arch" = 'none' || echo "Architecture: $arch" >> $FILE + echo "Version: $VERSION Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb" >> $FILE - test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE - echo "Description: $(printf '%s' "$DESCRIPTION" | head -n 1)" >> $FILE - echo "Description-md5: $(printf '%s' "$DESCRIPTION" | md5sum | cut -d' ' -f 1)" >> $FILE - echo >> $FILE + test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE + echo "Description: $(printf '%s' "$DESCRIPTION" | head -n 1)" >> $FILE + echo "Description-md5: $(printf '%s' "$DESCRIPTION" | md5sum | cut -d' ' -f 1)" >> $FILE + echo >> $FILE + done done - done - mkdir -p aptarchive/dists/${RELEASE}/main/source aptarchive/dists/${RELEASE}/main/i18n - touch aptarchive/dists/${RELEASE}/main/source/Sources - echo "Package: $NAME + mkdir -p aptarchive/dists/${RELEASE}/main/source aptarchive/dists/${RELEASE}/main/i18n + touch aptarchive/dists/${RELEASE}/main/source/Sources + echo "Package: $NAME Description-md5: $(printf '%s' "$DESCRIPTION" | md5sum | cut -d' ' -f 1) Description-en: $DESCRIPTION " >> aptarchive/dists/${RELEASE}/main/i18n/Translation-en + done } insertsource() { |