summaryrefslogtreecommitdiff
path: root/apt-pkg/packagemanager.cc
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2011-07-05 16:20:09 +0100
committerChristopher Baines <cbaines8@gmail.com>2011-07-05 16:20:09 +0100
commit8b1f5756624cf30c59c708c102cc71d53188e737 (patch)
treefd3337bfec445631dab9c8ab248f98e9a014cd7f /apt-pkg/packagemanager.cc
parentd8a982700668dd0d5ecf98c47b0ee5f224f4f8f4 (diff)
Flag the package in the SmartUnPack method as UnPacked while solving breakages to prevent loops.
Diffstat (limited to 'apt-pkg/packagemanager.cc')
-rw-r--r--apt-pkg/packagemanager.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index 4cba19dc0..a39e412bd 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -685,11 +685,15 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
for (Version **I = VList; *I != 0; I++)
{
VerIterator Ver(Cache,*I);
- PkgIterator Pkg = Ver.ParentPkg();
+ PkgIterator BrokenPkg = Ver.ParentPkg();
// Check if it needs to be unpacked
- if (List->IsFlag(Pkg,pkgOrderList::InList) && Cache[Pkg].Delete() == false) {
+ if (List->IsFlag(BrokenPkg,pkgOrderList::InList) && Cache[BrokenPkg].Delete() == false &&
+ !List->IsFlag(BrokenPkg,pkgOrderList::UnPacked)) {
+ /* FIXME Setting the flag here prevents breakage loops, that can occur if BrokenPkg (or one of the
+ packages it breaks) breaks Pkg */
+ List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
// Found a break, so unpack the package
- SmartUnPack(Pkg, false);
+ SmartUnPack(BrokenPkg, false);
}
}
}