]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/clean.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 5 Jul 2012 06:59:52 +0000 (08:59 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 5 Jul 2012 06:59:52 +0000 (08:59 +0200)
  - run autoclean against pkg:arch and not always against pkg:native as
    this removes valid cache entries (Closes: #679371)

apt-pkg/clean.cc
debian/changelog
test/integration/test-bug-679371-apt-get-autoclean-multiarch [new file with mode: 0755]

index 9c167eaa505b82b3ae593f5c226f9c20506d49a8..eae419e34679cb1947dda443642bbac3e3cedcc9 100644 (file)
@@ -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();
index 9d3c2b2fc78b03dc03ff9d3218c63f2437275a3a..1c98bf3564381ea5c516f64739b69746a1544b21 100644 (file)
@@ -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 (executable)
index 0000000..ba6857b
--- /dev/null
@@ -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