summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2011-08-14 18:41:38 +0100
committerChristopher Baines <cbaines8@gmail.com>2011-08-14 18:41:38 +0100
commit940f21606bc8d82366d554a9cfa025511a2b2bc4 (patch)
treef1fddd316c312581acf039d80bdb2a6899dba337
parent165ff1df10fd5960b5f31ce4e3eaa8d41a8e7b67 (diff)
Applied DonKult (David)'s excellent fix for inproving the loop management. Now both SmartConfigure and SmartUnPack can be
called mutiple times on the same package, this is to make sure that when loops are broken all packages that are required are kept in the same dpkg run.
-rw-r--r--apt-pkg/packagemanager.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index ee4798911..4c827af6d 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -536,14 +536,11 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure &&
Cache[Pkg].Keep() == true)
{
- List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
- if (Immediate == true &&
- List->IsFlag(Pkg,pkgOrderList::Immediate) == true)
- if (SmartConfigure(Pkg) == false)
- _error->Warning(_("Could not perform immediate configuration on already unpacked '%s'. "
- "Please see man 5 apt.conf under APT::Immediate-Configure for details."),Pkg.Name());
- return true;
+ cout << "SmartUnPack called on Package " << Pkg.Name() << " but its unpacked" << endl;
+ return false;
}
+
+ bool PkgLoop = List->IsFlag(Pkg,pkgOrderList::Loop);
VerIterator const instVer = Cache[Pkg].InstVerIter(Cache);
@@ -674,7 +671,11 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
// Check if it needs to be unpacked
if (List->IsFlag(BrokenPkg,pkgOrderList::InList) && Cache[BrokenPkg].Delete() == false &&
- !List->IsFlag(BrokenPkg,pkgOrderList::Loop) && List->IsNow(BrokenPkg)) {
+ List->IsNow(BrokenPkg)) {
+ if (PkgLoop && List->IsFlag(BrokenPkg,pkgOrderList::Loop)) {
+ // This dependancy has already been dealt with by another SmartUnPack on Pkg
+ break;
+ }
List->Flag(Pkg,pkgOrderList::Loop);
// Found a break, so unpack the package
if (Debug)
@@ -702,6 +703,8 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
P.end() == false; P++)
CheckRConflicts(Pkg,P.ParentPkg().RevDependsList(),P.ProvideVersion());
+ if (PkgLoop) return true;
+
List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
if (instVer->MultiArch == pkgCache::Version::Same)