Browse Source

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

David Kalnischkies 14 years ago
parent
commit
3663572002
2 changed files with 6 additions and 2 deletions
  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
 	 This way we avoid that M-A: enabled packages are installed before
 	 their older non-M-A enabled packages are replaced by newer versions */
 	 their older non-M-A enabled packages are replaced by newer versions */
       bool const installed = Pkg->CurrentVer != 0;
       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;
 	 return false;
       for (PkgIterator P = Pkg.Group().PackageList();
       for (PkgIterator P = Pkg.Group().PackageList();
 	   P.end() == false; P = Pkg.Group().NextPkg(P))
 	   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
     - handle Components in the reduction for the source.list as multi-arch CDs
       otherwise create duplicated source entries (e.g. "wheezy main main")
       otherwise create duplicated source entries (e.g. "wheezy main main")
   * apt-pkg/packagemanager.cc:
   * 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
       is currently in unpack state to recover from broken system states
       (like different file in M-A:same package and other dpkg errors)
       (like different file in M-A:same package and other dpkg errors)
+      and avoid re-unpack otherwise (Closes: #670900)
   * debian/control:
   * debian/control:
     - let libapt-pkg break apt < 0.9.4 to ensure that the installed http-
     - let libapt-pkg break apt < 0.9.4 to ensure that the installed http-
       method supports the new redirection-style, thanks to Raphael Geissert
       method supports the new redirection-style, thanks to Raphael Geissert