From 7ec343309b7bc6001b465c870609b3c570026149 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 21 Jul 2016 18:46:34 +0200 Subject: don't purge directly, but remove and do purge at the end If we want a package to be purged from the system tell dpkg in the ordering (if it has to touch it explicitly) to remove it and cover the purging of the config files at the end with a --purge --pending call. That should help packages move conffiles around between packages correctly even if the user is purging packages directly in big actions like dist-upgrades involving many packages. --- test/integration/test-no-fds-leaked-to-maintainer-scripts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/integration/test-no-fds-leaked-to-maintainer-scripts') diff --git a/test/integration/test-no-fds-leaked-to-maintainer-scripts b/test/integration/test-no-fds-leaked-to-maintainer-scripts index 56cbff095..a9c198580 100755 --- a/test/integration/test-no-fds-leaked-to-maintainer-scripts +++ b/test/integration/test-no-fds-leaked-to-maintainer-scripts @@ -34,7 +34,7 @@ rm -f rootdir/var/log/dpkg.log rootdir/var/log/apt/term.log testsuccess aptget install -y fdleaks -qq < /dev/null checkfdleak() { - msgtest 'Check if fds were not' 'leaked' + msgtest 'Check if fds were not' "leaked: expect $1" if [ "$(grep 'root root' rootdir/tmp/testsuccess.output | wc -l)" = "$1" ]; then msgpass else @@ -73,7 +73,6 @@ checkpurge() { testfileequal 'terminal.log' "$(cat terminal.output)" testequal "startup packages purge -status installed $PKGNAME 1.0 remove $PKGNAME 1.0 status half-configured $PKGNAME 1.0 status half-installed $PKGNAME 1.0 @@ -86,6 +85,7 @@ status config-files $PKGNAME 1.0 status config-files $PKGNAME 1.0 status not-installed $PKGNAME startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log + testequalor2 "dpkg-query: no packages found matching ${PKGNAME}" "No packages found matching ${PKGNAME}." dpkg -l "$PKGNAME" } checkpurge -- cgit v1.2.3 From 28557f94578602f9ce0011501a2259bd98ab0688 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 28 Jul 2016 09:13:24 +0200 Subject: disable explicit configuration of all packages at the end With b4450f1dd6bca537e60406b2383ab154a3e1485f we dropped what we calculated here later on and now that we don't need it in the meantime either we can just skip the busy work by default and expect dpkg to do the right thing dropping also our little "last explicit configures" removal trick introduced in b4450f1dd6bca537e60406b2383ab154a3e1485f. This enables the last of a bunch of previously experimental options, some of them existing still, but are very special and hence not really worth documenting anymore (especially as it would need to be rewritten now entirely) which is why the documentation is nearly completely dropped. The order of configuration stanzas in the simulation code changes slightly as it isn't concerning itself with finding the 'right' order, but any order is valid anyhow as long as the entire set happens in the same call. --- test/integration/test-no-fds-leaked-to-maintainer-scripts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/integration/test-no-fds-leaked-to-maintainer-scripts') diff --git a/test/integration/test-no-fds-leaked-to-maintainer-scripts b/test/integration/test-no-fds-leaked-to-maintainer-scripts index a9c198580..21b394055 100755 --- a/test/integration/test-no-fds-leaked-to-maintainer-scripts +++ b/test/integration/test-no-fds-leaked-to-maintainer-scripts @@ -72,11 +72,15 @@ checkpurge() { tail -n +3 rootdir/var/log/apt/term.log | head -n -1 > terminal.log testfileequal 'terminal.log' "$(cat terminal.output)" - testequal "startup packages purge + testequal "startup packages remove +status installed $PKGNAME 1.0 remove $PKGNAME 1.0 status half-configured $PKGNAME 1.0 status half-installed $PKGNAME 1.0 status config-files $PKGNAME 1.0 +status config-files $PKGNAME 1.0 +startup packages purge +remove $PKGNAME 1.0 purge $PKGNAME 1.0 status config-files $PKGNAME 1.0 status config-files $PKGNAME 1.0 -- cgit v1.2.3