diff -Nru sbuild-0.84.1ubuntu1/debian/changelog sbuild-0.84.1ubuntu3/debian/changelog --- sbuild-0.84.1ubuntu1/debian/changelog 2022-12-02 13:09:52.000000000 -0300 +++ sbuild-0.84.1ubuntu3/debian/changelog 2022-12-16 14:20:13.000000000 -0300 @@ -1,3 +1,19 @@ +sbuild (0.84.1ubuntu3) lunar; urgency=medium + + * Fix autopkgtest `unshare-qemuwrapper` on lunar-proposed (LP: #2000015) + - d/t/unshare-qemuwrapper: copy apt preferences into the vm's chroot. + - d/t/unshare: use mmdebstrap --verbose to aid debugging. + + -- Mauricio Faria de Oliveira Fri, 16 Dec 2022 14:20:13 -0300 + +sbuild (0.84.1ubuntu2) lunar; urgency=medium + + * d/t/build-procenv: Make skippable when mknod fails, as in unprivileged + container case (as Ubuntu's autopkgtest uses in the armhf case) + (LP: #1998479) + + -- Dave Jones Thu, 08 Dec 2022 16:47:16 +0000 + sbuild (0.84.1ubuntu1) lunar; urgency=medium * Merge from Debian unstable (LP: #1998479). Remaining changes: diff -Nru sbuild-0.84.1ubuntu1/debian/tests/build-procenv sbuild-0.84.1ubuntu3/debian/tests/build-procenv --- sbuild-0.84.1ubuntu1/debian/tests/build-procenv 2022-12-02 09:30:09.000000000 -0300 +++ sbuild-0.84.1ubuntu3/debian/tests/build-procenv 2022-12-08 13:47:16.000000000 -0300 @@ -61,6 +61,13 @@ [ -z "$AUTOPKGTEST_TMP" ] && die "AUTOPKGTEST_TMP not set" dir="$AUTOPKGTEST_TMP/schroot-$release" +if ! mknod "$AUTOPKGTEST_TMP"/test-dev-null c 1 3; then + echo "Cannot make special nodes; running in unprivileged container?" >&2 + exit 77 +else + rm "$AUTOPKGTEST_TMP"/test-dev-null +fi + # The expected name of the schroot that sbuild-createchroot will create chroot="${release}-${arch}-sbuild" diff -Nru sbuild-0.84.1ubuntu1/debian/tests/control sbuild-0.84.1ubuntu3/debian/tests/control --- sbuild-0.84.1ubuntu1/debian/tests/control 2022-12-02 13:09:52.000000000 -0300 +++ sbuild-0.84.1ubuntu3/debian/tests/control 2022-12-08 13:47:16.000000000 -0300 @@ -1,6 +1,6 @@ Tests: build-procenv Depends: apt (>= 1.1~exp2), apt-utils, debootstrap, distro-info, lsb-release, @ -Restrictions: needs-root +Restrictions: needs-root skippable Tests: unshare-qemuwrapper Architecture: amd64 diff -Nru sbuild-0.84.1ubuntu1/debian/tests/unshare sbuild-0.84.1ubuntu3/debian/tests/unshare --- sbuild-0.84.1ubuntu1/debian/tests/unshare 2022-12-02 13:09:52.000000000 -0300 +++ sbuild-0.84.1ubuntu3/debian/tests/unshare 2022-12-16 14:20:13.000000000 -0300 @@ -248,7 +248,8 @@ 3.0 (native) END -mmdebstrap --mode=unshare --variant=apt "$release" "${AUTOPKGTEST_TMP}/chroot.tar" +mmdebstrap --mode=unshare --variant=apt --verbose \ + "$release" "${AUTOPKGTEST_TMP}/chroot.tar" env --chdir="${AUTOPKGTEST_TMP}/test-pkg-1.0/" dpkg-buildpackage --build=full env --chdir="${AUTOPKGTEST_TMP}/test-pkg-1.0/" dpkg-buildpackage --target=clean diff -Nru sbuild-0.84.1ubuntu1/debian/tests/unshare-qemuwrapper sbuild-0.84.1ubuntu3/debian/tests/unshare-qemuwrapper --- sbuild-0.84.1ubuntu1/debian/tests/unshare-qemuwrapper 2022-12-02 09:30:09.000000000 -0300 +++ sbuild-0.84.1ubuntu3/debian/tests/unshare-qemuwrapper 2022-12-16 14:18:32.000000000 -0300 @@ -49,6 +49,8 @@ # executed under autopkgtest TMPDIR=$(mktemp --directory --tmpdir sbuild.XXXXXXXXXX) aptsources= + unset aptpreferences + unset aptpreferencesd MODE=auto else # since AUTOPKGTEST_TMP is set, we assume that this script is executed @@ -70,6 +72,21 @@ cat "$f" aptsources="$aptsources $f" done + # we need to install the chroot using the same apt preferences as used by + # the autopkgtest chroot so that the versions to be tested are + # installed + unset aptpreferences + if [ -e /etc/apt/preferences ]; then + aptpreferences="/etc/apt/preferences" + fi + unset aptpreferencesd + if [ -d /etc/apt/preferences.d/ ]; then + aptpreferencesd="/etc/apt/preferences.d/" + fi + for f in /etc/apt/preferences /etc/apt/preferences.d/*; do + [ -e "$f" ] || continue + cat "$f" + done MODE=root fi @@ -155,6 +172,8 @@ # shellcheck disable=SC2086 mmdebstrap --variant=apt --mode=$MODE --verbose \ --setup-hook="$TMPDIR/setup.sh" \ + ${aptpreferences+--setup-hook="sync-in $aptpreferences $aptpreferences"} \ + ${aptpreferencesd+--setup-hook="sync-in $aptpreferencesd $aptpreferencesd"} \ --include=openssh-server,systemd-sysv,e2fsprogs,ifupdown,initramfs-tools,netbase,isc-dhcp-client,udev,policykit-1,$KERNEL_PACKAGE,$EXTRA_DEPS \ --customize-hook="$TMPDIR/customize.sh" --components="$COMPONENTS" \ "${release}" "$TMPDIR/${ID}-${release}-host.tar" $aptsources