summaryrefslogtreecommitdiff
path: root/pbuilder
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-10-28 20:21:14 +0200
committerJonas Smedegaard <dr@jones.dk>2017-10-28 20:21:14 +0200
commitad459c58e048044a6d6983ed72d0c2581e1ce880 (patch)
treea3159393d35f2b1ece533b665a07e5d6f4232f7f /pbuilder
parentb2c2ad1e800d442e98d2078741d709a7864d0b51 (diff)
Sync with pbuilder 0.229.
Diffstat (limited to 'pbuilder')
-rwxr-xr-xpbuilder/hooks/B20autopkgtest44
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"