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

unpack versions only in case a different version from the package
and avoid re-unpack otherwise (Closes: #670900)

David Kalnischkies лет назад: 14
Родитель
Сommit
3663572002
2 измененных файлов с 6 добавлено и 2 удалено
  1. 4 1
      apt-pkg/packagemanager.cc
  2. 2 1
      debian/changelog

+ 4 - 1
apt-pkg/packagemanager.cc

@@ -856,7 +856,10 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
 	 This way we avoid that M-A: enabled packages are installed before
 	 their older non-M-A enabled packages are replaced by newer versions */
       bool const installed = Pkg->CurrentVer != 0;
-      if (installed == true && Install(Pkg,FileNames[Pkg->ID]) == false)
+      if (installed == true &&
+	  (instVer != Pkg.CurrentVer() ||
+	   ((Cache[Pkg].iFlags & pkgDepCache::ReInstall) == pkgDepCache::ReInstall)) &&
+	  Install(Pkg,FileNames[Pkg->ID]) == false)
 	 return false;
       for (PkgIterator P = Pkg.Group().PackageList();
 	   P.end() == false; P = Pkg.Group().NextPkg(P))

+ 2 - 1
debian/changelog

@@ -11,9 +11,10 @@ apt (0.9.7.5) UNRELEASED; urgency=low
     - handle Components in the reduction for the source.list as multi-arch CDs
       otherwise create duplicated source entries (e.g. "wheezy main main")
   * apt-pkg/packagemanager.cc:
-    - unpack versions in case a different version from the package
+    - unpack versions only in case a different version from the package
       is currently in unpack state to recover from broken system states
       (like different file in M-A:same package and other dpkg errors)
+      and avoid re-unpack otherwise (Closes: #670900)
   * debian/control:
     - let libapt-pkg break apt < 0.9.4 to ensure that the installed http-
       method supports the new redirection-style, thanks to Raphael Geissert