Control: tag -1 - moreinfo On Sun, Nov 26, 2017 at 10:11:12PM +0100, Andreas Beckmann wrote: > Control: tag -1 moreinfo > > On Sun, 26 Nov 2017 14:36:06 -0200 Antonio Terceiro > <terce...@debian.org> wrote: > > This fixes a RC bug that has been reported recently, and was just fixed > > in unstable. > > I'm missing the corresponding undo operation in the preinst. > > AFAICS, a > install-remove-install or > install-remove-distupgrade-install > sequence will have that conffile missing afterwards (i.e. it's still in > .disabled state).
Yes, you are right. Thanks for catching this. I have made a new upload to unstable fixing this, and cherry-picked the fix into my stretch branch. Attached you will find an updated diff against the version in stretch.
diff --git a/debian/changelog b/debian/changelog index 805de64..9ba8e54 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +auto-apt-proxy (2+deb9u1) stretch; urgency=medium + + * Move apt configuration away on removal, and put it back on reinstalls + (Closes: #881751) + + -- Antonio Terceiro <terce...@debian.org> Mon, 27 Nov 2017 13:55:16 -0200 + auto-apt-proxy (2) unstable; urgency=medium * specify `--shell dash` to shellcheck (Closes: #834976) diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..e39b370 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,25 @@ +#! /bin/sh + +set -e +aptconf=/etc/apt/apt.conf.d/auto-apt-proxy.conf + +case "$1" in + purge) + rm -f "$aptconf".disabled + ;; + + remove|abort-install) + if [ -f "$aptconf" ]; then + mv "$aptconf" "$aptconf".disabled + fi + ;; + + upgrade|failed-upgrade|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 +esac + +##DEBHELPER## diff --git a/debian/preinst b/debian/preinst new file mode 100644 index 0000000..6ede705 --- /dev/null +++ b/debian/preinst @@ -0,0 +1,10 @@ +#! /bin/sh + +set -e +aptconf=/etc/apt/apt.conf.d/auto-apt-proxy.conf + +if [ -e "$aptconf".disabled ]; then + mv "$aptconf".disabled "$aptconf" +fi + +##DEBHELPER## diff --git a/debian/tests/control b/debian/tests/control index 79b3cde..dd1fe07 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,2 +1,6 @@ Test-Command: clitest debian/tests/apt-cacher-ng.txt Depends: @, clitest, apt-cacher-ng + +Tests: remove, reinstall +Restrictions: needs-root +Depends: @, clitest diff --git a/debian/tests/reinstall b/debian/tests/reinstall new file mode 100755 index 0000000..da77c2f --- /dev/null +++ b/debian/tests/reinstall @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e +exec 2>&1 + +action="$(basename "$0")" + +set -x +apt-get remove -qy auto-apt-proxy +apt-get install -qy auto-apt-proxy + +eval "$(apt-config shell proxy Acquire::http::Proxy-Auto-Detect)" +test "$proxy" = '/usr/bin/auto-apt-proxy' diff --git a/debian/tests/remove b/debian/tests/remove new file mode 100755 index 0000000..b40d4e9 --- /dev/null +++ b/debian/tests/remove @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e +exec 2>&1 + +action="$(basename "$0")" + +set -x +apt-get "$action" -qy auto-apt-proxy +apt-get update
signature.asc
Description: PGP signature