summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-get-autoremove
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-07-03 14:39:16 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-08-10 23:18:04 +0200
commitb820fd59c4fe6e3581901eee648e88209be56137 (patch)
tree0f0dbfefc9ed35e553a70a7f8c3e95857a3bea02 /test/integration/test-apt-get-autoremove
parentf495992428a396e0f98886c9a761a804aa161c68 (diff)
save and restore selection states before/after calling dpkg
dpkg decides certain things on its own based on selections and especially if we want to call --pending on purge/remove actions, we need to ensure a clean slate or otherwise we surprise the user by removing packages we weren't allowed to remove by the user in this run (the selection might be an overarching plan for the not-yet "future"). Ideally dpkg would have some kind of temporal selection interface for this case, but it hasn't, so we make it temporal with the risk of loosing state if we don't manage to restore them.
Diffstat (limited to 'test/integration/test-apt-get-autoremove')
-rwxr-xr-xtest/integration/test-apt-get-autoremove10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove
index 17dba9aec..cfee748af 100755
--- a/test/integration/test-apt-get-autoremove
+++ b/test/integration/test-apt-get-autoremove
@@ -18,6 +18,8 @@ testmarkedauto 'po-debconf'
testsuccess aptget remove debhelper -y
testdpkgnotinstalled 'debhelper'
testdpkginstalled 'po-debconf' 'unrelated'
+echo 'unrelated purge' | dpkg --set-selections
+testdpkgstatus 'pi' '1' 'unrelated'
AUTOREMOVE='apt autoremove'
if [ -n "$SUDO_USER" ]; then
@@ -49,14 +51,17 @@ testdpkginstalled 'po-debconf'
echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
testsuccess aptget autoremove -y
testdpkginstalled 'po-debconf'
+testdpkgstatus 'pi' '1' 'unrelated'
echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
testsuccess aptget autoremove -y
testdpkginstalled "po-debconf"
+testdpkgstatus 'pi' '1' 'unrelated'
rm rootdir/etc/apt/apt.conf.d/00autoremove
testsuccess aptget autoremove -y
testdpkgnotinstalled 'po-debconf'
+testdpkgstatus 'pi' '1' 'unrelated'
testmarkedauto
sed rootdir/var/log/apt/history.log -e '/^Commandline: / d' \
@@ -71,7 +76,8 @@ Remove: debhelper:i386 (8.0.0)
Remove: po-debconf:i386 (1.0.16)'
testsuccess aptget install debhelper -y
-testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
+testdpkgstatus 'pi' '1' 'unrelated'
+testdpkginstalled 'debhelper' 'po-debconf'
testsuccess aptmark auto debhelper
testmarkedauto 'debhelper' 'po-debconf'
@@ -105,9 +111,11 @@ Reading state information...
testsuccess aptget autoremove debhelper -y --allow-change-held-packages
testdpkgnotinstalled 'po-debconf' 'debhelper'
+testdpkgstatus 'pi' '1' 'unrelated'
testmarkedauto
testsuccess aptget install debhelper --solver apt -y -o Debug::pkgDepCache::Marker=1
testmarkedauto 'po-debconf'
+testdpkgstatus 'pi' '1' 'unrelated'
insertinstalledpackage 'bar' 'all' '1' 'Depends: foo-provider'
insertinstalledpackage 'foo-multi1-1' 'all' '1' 'Provides: foo-provider