From 949e033cb7c741b9eed459c0e93a89a92acb168d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 16 Apr 2011 00:06:34 +0200 Subject: [PATCH 1/1] =?utf8?q?*=20apt-pkg/depcache.cc:=20=20=20-=20really?= =?utf8?q?=20include=20'rc'=20packages=20in=20the=20delete=20count=20by=20?= =?utf8?q?fixing=20a=20=20=20=20=20typo=20which=20exists=20since=201999=20?= =?utf8?q?in=20the=20source=E2=80=A6=20(LP:=20#761175)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- apt-pkg/depcache.cc | 4 +- debian/changelog | 9 +++++ .../test-ubuntu-bug-761175-remove-purge | 38 +++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100755 test/integration/test-ubuntu-bug-761175-remove-purge diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 07803d7bf..dc4a65bc1 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -549,8 +549,8 @@ void pkgDepCache::AddStates(const PkgIterator &Pkg,int Add) // Not installed if (Pkg->CurrentVer == 0) { - if (State.Mode == ModeDelete && - (State.iFlags | Purge) == Purge && Pkg.Purge() == false) + if (State.Mode == ModeDelete && + (State.iFlags & Purge) == Purge && Pkg.Purge() == false) iDelCount += Add; if (State.Mode == ModeInstall) diff --git a/debian/changelog b/debian/changelog index c2e2dc70d..216b44d30 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +apt (0.8.14.1) unstable; urgency=low + + [ David Kalnischkies ] + * apt-pkg/depcache.cc: + - really include 'rc' packages in the delete count by fixing a + typo which exists since 1999 in the source… (LP: #761175) + + -- David Kalnischkies Fri, 15 Apr 2011 23:59:36 +0200 + apt (0.8.14) unstable; urgency=low [ Julian Andres Klode ] diff --git a/test/integration/test-ubuntu-bug-761175-remove-purge b/test/integration/test-ubuntu-bug-761175-remove-purge new file mode 100755 index 000000000..93b67fc02 --- /dev/null +++ b/test/integration/test-ubuntu-bug-761175-remove-purge @@ -0,0 +1,38 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +setupsimplenativepackage 'compiz-core' 'i386' '1.0' 'unstable' +BUILDDIR='incoming/compiz-core-1.0' +mkdir -p ${BUILDDIR}/debian/compiz-core/etc +echo 'foo=bar;' > ${BUILDDIR}/compiz.conf +echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install +buildpackage "$BUILDDIR" 'unstable' 'main' +rm -rf "$BUILDDIR" + +setupaptarchive + + +testdpkgnotinstalled compiz-core +msgtest 'Install package' 'compiz-core' +aptget install compiz-core -qq 2>&1 >/dev/null && msgpass || msgfail +testdpkginstalled compiz-core + +msgtest 'Remove package' 'compiz-core' +aptget remove compiz-core -y -qq 2>&1 >/dev/null && msgpass || msgfail +testdpkgnotinstalled compiz-core + +msgtest 'Check that conffiles are still around for' 'compiz-core' +dpkg -l compiz-core | grep '^rc' 2>&1 >/dev/null && msgpass || msgfail + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be REMOVED: + compiz-core* +0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +Purg compiz-core' aptget purge compiz-core -s -- 2.45.2