Parcourir la source

* 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 il y a 14 ans
Parent
commit
469b02781d

+ 3 - 2
apt-pkg/clean.cc

@@ -81,12 +81,13 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache)
       if (*I != '.')
       if (*I != '.')
 	 continue;
 	 continue;
       std::string const Arch = DeQuoteString(std::string(Start,I-Start));
       std::string const Arch = DeQuoteString(std::string(Start,I-Start));
-      
+
+      // ignore packages of unconfigured architectures
       if (APT::Configuration::checkArchitecture(Arch) == false)
       if (APT::Configuration::checkArchitecture(Arch) == false)
 	 continue;
 	 continue;
       
       
       // Lookup the package
       // Lookup the package
-      pkgCache::PkgIterator P = Cache.FindPkg(Pkg);
+      pkgCache::PkgIterator P = Cache.FindPkg(Pkg, Arch);
       if (P.end() != true)
       if (P.end() != true)
       {
       {
 	 pkgCache::VerIterator V = P.VersionList();
 	 pkgCache::VerIterator V = P.VersionList();

+ 3 - 0
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
       expects pkg:all for selections, so use the arch of the installed
       version instead of the package structure if possible.
       version instead of the package structure if possible.
       Thanks to Stepan Golosunov for the report! (Closes: #680041)
       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
  -- David Kalnischkies <kalnischkies@gmail.com>  Sun, 01 Jul 2012 08:20:57 +0200
 
 

+ 24 - 0
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