[pbuilder] 01/02: B20aupkgtest: Prefer autopkgtest over adt-run

Mattia Rizzolo mattia at debian.org
Sat Oct 7 13:20:24 UTC 2017


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository pbuilder.

commit 45b67236a2a66bf3e1fb5c2ee8e5ec8f6d6f9b94
Author: Guido Günther <agx at sigxcpu.org>
Date:   Wed Oct 4 19:29:52 2017 +0200

    B20aupkgtest: Prefer autopkgtest over adt-run
    
    autopkgtest 5.0 dropped support for adt-run. Cater for that but still
    allow to use adt-run in older chroot.
    
    Closes: #876399
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 examples/B20autopkgtest | 40 +++++++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 15 deletions(-)

diff --git a/examples/B20autopkgtest b/examples/B20autopkgtest
index 9a151f1..cba7614 100644
--- a/examples/B20autopkgtest
+++ b/examples/B20autopkgtest
@@ -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
@@ -64,22 +65,31 @@ fi
 # pbuilder's pbuilder-satisfydepends-classic
 apt-get install -y "${APTGETOPT[@]}" 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
-
 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}" \
+      ${ADT_OPTIONS} --- 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"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pbuilder/pbuilder.git



More information about the Pbuilder-maint mailing list