Просмотр исходного кода

* 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 лет назад: 14
Родитель
Сommit
469b02781d
3 измененных файлов с 30 добавлено и 2 удалено
  1. 3 2
      apt-pkg/clean.cc
  2. 3 0
      debian/changelog
  3. 24 0
      test/integration/test-bug-679371-apt-get-autoclean-multiarch

+ 3 - 2
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();

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

+ 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