control: tags -1 +patch Hi, On Thu, Sep 21, 2017 at 12:24:09PM -0700, Diane Trout wrote: > On Thu, 2017-09-21 at 20:57 +0200, Mattia Rizzolo wrote: > > On Thu, Sep 21, 2017 at 11:14:05AM -0700, Diane Trout wrote: > > > I was trying to build some packages in sid and discovered that the > > > chroot B20autopkgtest hook script was using /usr/bin/adt-run which > > > has > > > been removed in autopkgtest 5.0 > > > > oh, thanks for the bug! > > > > I quickly ported B20autopkgtest to use the autopkgtest commands. > > Although I didn't add checks to fail back to adt commands, so, it'll > only work with sufficiently new versions of autopkgtest. > > autopkgtest 4.4 in testing has both adt- and autopkgtest- commands, 5.0 > only has the autopkgtest- commands.
Attached patch supports both adt-rn and autopkgtest so we can continue to build in wheezy and jessie. I doubled the while invocations instead of special casing even more options so it stays easier to extend. Cheers, -- Guido
>From af42f6c8ccabecb880abe9de480f181856a73a63 Mon Sep 17 00:00:00 2001 Message-Id: <af42f6c8ccabecb880abe9de480f181856a73a63.1507143517.git....@sigxcpu.org> From: =?UTF-8?q?Guido=20G=C3=BCnther?= <a...@sigxcpu.org> Date: Wed, 4 Oct 2017 19:29:52 +0200 Subject: [PATCH] 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. --- examples/B20autopkgtest | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/examples/B20autopkgtest b/examples/B20autopkgtest index e2c3758..279a26e 100644 --- a/examples/B20autopkgtest +++ b/examples/B20autopkgtest @@ -50,7 +50,7 @@ if [ -n "${ADT_OPTIONS:-}" ] ; then echo "*** Using provided ADT_OPTIONS $ADT_OPTIONS ***" 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 +64,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}" \ + ${AUTOPKGTEST_OPTIONS:-} -- 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" -- 2.14.1