From ad459c58e048044a6d6983ed72d0c2581e1ce880 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 28 Oct 2017 20:21:14 +0200 Subject: Sync with pbuilder 0.229. --- pbuilder/hooks/B20autopkgtest | 44 ++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'pbuilder') 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 # © 2013 Michael Prokop # © 2015 Mattia Rizzolo @@ -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" -- cgit v1.2.3