summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-10-01 15:47:34 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-10-01 15:47:34 +0200
commitebd21427926418a01739baca2ee3426c103ff83a (patch)
treea44b2d70ca085e8500f92555a0e5ba79f797febc
parent7e1d0a91891ae79facf30ca058557b6e45650f31 (diff)
cherry pick fix -r 2028 from lp:~donkult/apt/sid
-rw-r--r--apt-pkg/depcache.h2
-rw-r--r--debian/changelog6
-rw-r--r--test/integration/framework24
-rwxr-xr-xtest/integration/test-autoremove40
4 files changed, 63 insertions, 9 deletions
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index 08e683558..2d3dbdf77 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -189,7 +189,7 @@ class pkgDepCache : protected pkgCache::Namespace
DefaultRootSetFunc() : Configuration::MatchAgainstConfig("APT::NeverAutoRemove") {};
virtual ~DefaultRootSetFunc() {};
- bool InRootSet(const pkgCache::PkgIterator &pkg) { return pkg.end() == true && Match(pkg.Name()); };
+ bool InRootSet(const pkgCache::PkgIterator &pkg) { return pkg.end() == false && Match(pkg.Name()); };
};
struct StateCache
diff --git a/debian/changelog b/debian/changelog
index 76edb20ec..88ccb292f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,16 @@
apt (0.8.3ubuntu6) maverick; urgency=low
+ [ Michael Vogt ]
* debian/apt.cron.daily:
- source /etc/default/locale (if available) so that the
apt-get update cron job fetches the right translated package
descriptions
+ [ David Kalnischkies ]
+ * apt-pkg/depcache.cc:
+ - do not check endpointer packages instead of only those which prevented
+ NeverAutoRemove settings from having an effect (Closes: #598452)
+
-- Michael Vogt <michael.vogt@ubuntu.com> Fri, 01 Oct 2010 15:25:00 +0200
apt (0.8.3ubuntu5) maverick; urgency=low
diff --git a/test/integration/framework b/test/integration/framework
index 8a5973d4b..a515ce070 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -499,3 +499,27 @@ testnopackage() {
fi
msgpass
}
+
+testdpkginstalled() {
+ msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
+ local PKGS="$(dpkg -l $* | grep '^[a-z]' | grep '^[^i]' | wc -l)"
+ if [ "$PKGS" != 0 ]; then
+ echo $PKGS
+ dpkg -l $* | grep '^[a-z]'
+ msgfail
+ return 1
+ fi
+ msgpass
+}
+
+testdpkgnoninstalled() {
+ msgtest "Test for correctly non-installed package(s) with" "dpkg -l $*"
+ local PKGS="$(dpkg -l $* | grep '^[a-z]' | grep '^[^u]' | wc -l)"
+ if [ "$PKGS" != 0 ]; then
+ echo
+ dpkg -l $* | grep '^[a-z]'
+ msgfail
+ return 1
+ fi
+ msgpass
+}
diff --git a/test/integration/test-autoremove b/test/integration/test-autoremove
index fb39e979a..7127b3d82 100755
--- a/test/integration/test-autoremove
+++ b/test/integration/test-autoremove
@@ -4,26 +4,50 @@ set -e
local TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
-configarchitecture "i386"
+configarchitecture 'i386'
-buildsimplenativepackage "unrelated" "all" "1" "unstable"
-buildsimplenativepackage "po-debconf" "all" "1.0.16" "unstable"
-buildsimplenativepackage "debhelper" "all" "8.0.0" "unstable" "Depends: po-debconf"
+buildsimplenativepackage 'unrelated' 'all' '1' 'unstable'
+buildsimplenativepackage 'po-debconf' 'all' '1.0.16' 'unstable'
+buildsimplenativepackage 'debhelper' 'all' '8.0.0' 'unstable' 'Depends: po-debconf'
setupaptarchive
aptget install unrelated debhelper -qq 2>&1 > /dev/null
+testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
-testfileequal "rootdir/var/lib/apt/extended_states" "Package: po-debconf
+testfileequal 'rootdir/var/lib/apt/extended_states' 'Package: po-debconf
Architecture: i386
Auto-Installed: 1
-"
+'
aptget remove debhelper -y -qq 2>&1 > /dev/null
+testdpkgnoninstalled 'debhelper'
+testdpkginstalled 'po-debconf unrelated'
+
+echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
+testequal 'Reading package lists...
+Building dependency tree...
+Reading state information...
+The following packages will be REMOVED:
+ po-debconf
+0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
+Remv po-debconf [1.0.16]' aptget autoremove -s
+testdpkginstalled 'po-debconf'
+
+echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
aptget autoremove -y -qq 2>&1 > /dev/null
+testdpkginstalled 'po-debconf'
-testfileequal "rootdir/var/lib/apt/extended_states" ""
+echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
+aptget autoremove -y -qq 2>&1 > /dev/null
+testdpkginstalled "po-debconf"
+
+rm rootdir/etc/apt/apt.conf.d/00autoremove
+aptget autoremove -y -qq 2>&1 > /dev/null
+testdpkgnoninstalled 'po-debconf'
+
+testfileequal 'rootdir/var/lib/apt/extended_states' ''
sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d'
-testfileequal "rootdir/var/log/apt/history.log" '
+testfileequal 'rootdir/var/log/apt/history.log' '
Install: unrelated:i386 (1), debhelper:i386 (8.0.0), po-debconf:i386 (1.0.16, automatic)
Remove: debhelper:i386 (8.0.0)