diff options
-rw-r--r-- | apt-pkg/clean.cc | 5 | ||||
-rw-r--r-- | debian/changelog | 3 | ||||
-rwxr-xr-x | test/integration/test-bug-679371-apt-get-autoclean-multiarch | 24 |
3 files changed, 30 insertions, 2 deletions
diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc index 9c167eaa5..eae419e34 100644 --- a/apt-pkg/clean.cc +++ b/apt-pkg/clean.cc @@ -81,12 +81,13 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache) if (*I != '.') continue; std::string const Arch = DeQuoteString(std::string(Start,I-Start)); - + + // ignore packages of unconfigured architectures if (APT::Configuration::checkArchitecture(Arch) == false) continue; // Lookup the package - pkgCache::PkgIterator P = Cache.FindPkg(Pkg); + pkgCache::PkgIterator P = Cache.FindPkg(Pkg, Arch); if (P.end() != true) { pkgCache::VerIterator V = P.VersionList(); diff --git a/debian/changelog b/debian/changelog index 9d3c2b2fc..1c98bf356 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,9 @@ apt (0.9.7.2) UNRELEASED; urgency=low expects pkg:all for selections, so use the arch of the installed version instead of the package structure if possible. Thanks to Stepan Golosunov for the report! (Closes: #680041) + * apt-pkg/clean.cc: + - run autoclean against pkg:arch and not always against pkg:native as + this removes valid cache entries (Closes: #679371) -- David Kalnischkies <kalnischkies@gmail.com> Sun, 01 Jul 2012 08:20:57 +0200 diff --git a/test/integration/test-bug-679371-apt-get-autoclean-multiarch b/test/integration/test-bug-679371-apt-get-autoclean-multiarch new file mode 100755 index 000000000..ba6857b73 --- /dev/null +++ b/test/integration/test-bug-679371-apt-get-autoclean-multiarch @@ -0,0 +1,24 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +buildsimplenativepackage 'pkgall' 'all' '1' 'stable' +buildsimplenativepackage 'pkgnative' 'amd64' '1' 'stable' +buildsimplenativepackage 'pkgforeign' 'i386' '1' 'stable' + +setupaptarchive + +changetowebserver + +aptget update -qq +aptget install pkgall pkgnative pkgforeign -y -qq > /dev/null + +testdpkginstalled pkgall pkgnative pkgforeign + +testequal 'Reading package lists... +Building dependency tree... +Reading state information...' aptget autoclean -s |