From 8b1f5756624cf30c59c708c102cc71d53188e737 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 5 Jul 2011 16:20:09 +0100 Subject: Flag the package in the SmartUnPack method as UnPacked while solving breakages to prevent loops. --- apt-pkg/packagemanager.cc | 10 +++++++--- 1 file 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); } } } -- cgit v1.2.3