diff options
Diffstat (limited to 'pbuilder/hooks/B20autopkgtest')
-rwxr-xr-x | pbuilder/hooks/B20autopkgtest | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/pbuilder/hooks/B20autopkgtest b/pbuilder/hooks/B20autopkgtest index 27c4ac2..da49ff3 100755 --- a/pbuilder/hooks/B20autopkgtest +++ b/pbuilder/hooks/B20autopkgtest @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright © 2012 Christoph Berg <myon@debian.org> # © 2013 Michael Prokop <mika@debian.org> # © 2015 Mattia Rizzolo <mattia@mapreri.org> @@ -46,11 +46,12 @@ if [ ! -f debian/files ]; then exit 1 fi -if [ -n "${ADT_OPTIONS:-}" ] ; then - echo "*** Using provided ADT_OPTIONS $ADT_OPTIONS ***" +OPTS="${AUTOPKGTEST_OPTIONS:-$ADT_OPTIONS}" +if [ -n "${OPTS}" ]; then + echo "*** Using provided AUTOPKGTEST_OPTIONS ${OPTS} ***" fi -# try to launch adt-run in a new PID namespace so several testsuites can run +# try to launch autopkgtest in a new PID namespace so several testsuites can run # in parallel, newpid exists in jessie and newer only though unset newpid_name if ! apt-cache policy newpid | grep -q 'newpid:' ; then @@ -62,24 +63,33 @@ fi # runner/adt-run uses apt-utils's apt-ftparchive and # pbuilder's pbuilder-satisfydepends-classic -apt-get install -y autopkgtest apt-utils pbuilder $newpid_name - -# since autopkgtest 3.16 the --tmp-dir option is gone, make sure -# we've --output-dir available though before using it -if adt-run --help | grep -q -- --output-dir 2>/dev/null ; then - OUTPUT_OPTION='--output-dir' -else - OUTPUT_OPTION='--tmp-dir' -fi +apt-get install -y "${APTGETOPT[@]}" autopkgtest apt-utils pbuilder $newpid_name mkdir -p "$BUILDDIR/autopkgtest.out" -$newpid_name adt-run \ - ${OUTPUT_OPTION} "$BUILDDIR/autopkgtest.out" \ +if which autopkgtest >/dev/null; then + $newpid_name autopkgtest \ + --output-dir "$BUILDDIR/autopkgtest.out" \ --summary "$BUILDDIR/autopkgtest.summary" \ "$BUILDDIR"/*.deb \ - --built-tree "${PWD}" \ - ${ADT_OPTIONS:-} --- adt-virt-null || EXIT=$? + "${PWD}" \ + ${OPTS} -- autopkgtest-virt-null || EXIT=$? +else + # since autopkgtest 3.16 the --tmp-dir option is gone, make sure + # we've --output-dir available though before using it + if adt-run --help | grep -q -- --output-dir 2>/dev/null ; then + OUTPUT_OPTION='--output-dir' + else + OUTPUT_OPTION='--tmp-dir' + fi + + $newpid_name adt-run \ + ${OUTPUT_OPTION} "$BUILDDIR/autopkgtest.out" \ + --summary "$BUILDDIR/autopkgtest.summary" \ + "$BUILDDIR"/*.deb \ + --built-tree "${PWD}" \ + ${OPTS} --- adt-virt-null || EXIT=$? +fi # collect autopkgtest output in a single file so pbuilder automatically copies it tar -caf "$BUILDDIR/autopkgtest.tar.gz" "$BUILDDIR/autopkgtest.out" |