summaryrefslogtreecommitdiff
path: root/apt-pkg/packagemanager.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-09-12 16:09:53 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-09-12 16:09:53 +0200
commit7adf8bb88faba98793998bed1e6c60f4b5483531 (patch)
tree4002c43084de6db6eb4f6128baa241cb6c757ba7 /apt-pkg/packagemanager.cc
parent178dd062eeaa1d7e56770455e005dc27aa71f026 (diff)
parent02679bb36369dce76f3a2159dbb829ba221c1e67 (diff)
merged from lp:~donkult/apt/sid
Diffstat (limited to 'apt-pkg/packagemanager.cc')
-rw-r--r--apt-pkg/packagemanager.cc31
1 files changed, 26 insertions, 5 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index 6601d9f6b..8b73b9980 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -603,18 +603,39 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
- if (instVer->MultiArch == pkgCache::Version::Same)
+ if (Immediate == true && instVer->MultiArch == pkgCache::Version::Same)
+ {
+ /* Do lockstep M-A:same unpacking in two phases:
+ First unpack all installed architectures, then the not installed.
+ 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)
+ return false;
for (PkgIterator P = Pkg.Group().PackageList();
P.end() == false; P = Pkg.Group().NextPkg(P))
{
- if (Pkg == P || List->IsFlag(P,pkgOrderList::UnPacked) == true ||
+ if (P->CurrentVer == 0 || P == Pkg || List->IsFlag(P,pkgOrderList::UnPacked) == true ||
Cache[P].InstallVer == 0 || (P.CurrentVer() == Cache[P].InstallVer &&
(Cache[Pkg].iFlags & pkgDepCache::ReInstall) != pkgDepCache::ReInstall))
continue;
- SmartUnPack(P, false);
+ if (SmartUnPack(P, false) == false)
+ return false;
}
-
- if(Install(Pkg,FileNames[Pkg->ID]) == false)
+ if (installed == false && Install(Pkg,FileNames[Pkg->ID]) == false)
+ return false;
+ for (PkgIterator P = Pkg.Group().PackageList();
+ P.end() == false; P = Pkg.Group().NextPkg(P))
+ {
+ if (P->CurrentVer != 0 || P == Pkg || List->IsFlag(P,pkgOrderList::UnPacked) == true ||
+ Cache[P].InstallVer == 0 || (P.CurrentVer() == Cache[P].InstallVer &&
+ (Cache[Pkg].iFlags & pkgDepCache::ReInstall) != pkgDepCache::ReInstall))
+ continue;
+ if (SmartUnPack(P, false) == false)
+ return false;
+ }
+ }
+ else if (Install(Pkg,FileNames[Pkg->ID]) == false)
return false;
// Perform immedate configuration of the package.