summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-03-03 10:02:06 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-03-03 10:02:06 +0100
commit6b92f60c38c2d50040bc3f07d52e8da80ef23bff (patch)
tree7b5dfbba441b826a666713005edeb00d633057e7
parentc2ef3ce3748cc31e3431d3beb00153546a5e50c0 (diff)
eanup the ordering-code avoiding a break (no function change)
-rw-r--r--apt-pkg/packagemanager.cc51
1 files changed, 23 insertions, 28 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index a370f15a3..42473341c 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -689,35 +689,30 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
}
// Check if it needs to be unpacked
- if (List->IsFlag(BrokenPkg,pkgOrderList::InList) && Cache[BrokenPkg].Delete() == false &&
+ if (List->IsFlag(BrokenPkg,pkgOrderList::InList) && Cache[BrokenPkg].Delete() == false &&
List->IsNow(BrokenPkg)) {
- if (List->IsFlag(BrokenPkg,pkgOrderList::Loop) && PkgLoop) {
- // This dependancy has already been dealt with by another SmartUnPack on Pkg
- break;
- } else if (List->IsFlag(Pkg,pkgOrderList::Loop)) {
- /* Found a break, so unpack the package, but dont remove loop as already set.
- This means that there is another SmartUnPack call for this
- package and it will remove the loop flag. */
- if (Debug)
- cout << OutputInDepth(Depth) << " Unpacking " << BrokenPkg.Name() << " to avoid break" << endl;
-
- SmartUnPack(BrokenPkg, false, Depth + 1);
- } else {
- List->Flag(Pkg,pkgOrderList::Loop);
- // Found a break, so unpack the package
- if (Debug)
- cout << OutputInDepth(Depth) << " Unpacking " << BrokenPkg.Name() << " to avoid break" << endl;
-
- SmartUnPack(BrokenPkg, false, Depth + 1);
- List->RmFlag(Pkg,pkgOrderList::Loop);
- }
- }
-
- // Check if a package needs to be removed
- if (Cache[BrokenPkg].Delete() == true && !List->IsFlag(BrokenPkg,pkgOrderList::Configured)) {
- if (Debug)
- cout << OutputInDepth(Depth) << " Removing " << BrokenPkg.Name() << " to avoid break" << endl;
- SmartRemove(BrokenPkg);
+ if (List->IsFlag(BrokenPkg,pkgOrderList::Loop) && PkgLoop) {
+ // This dependancy has already been dealt with by another SmartUnPack on Pkg
+ break;
+ } else {
+ // Found a break, so unpack the package,
+ // but do not set loop if another SmartUnPack already deals with it
+ if (Debug)
+ cout << OutputInDepth(Depth) << " Unpacking " << BrokenPkg.Name() << " to avoid " << End << endl;
+ if (PkgLoop == false)
+ List->Flag(Pkg,pkgOrderList::Loop);
+ SmartUnPack(BrokenPkg, false, Depth + 1);
+ if (PkgLoop == false)
+ List->RmFlag(Pkg,pkgOrderList::Loop);
+ }
+ } else {
+ // Check if a package needs to be removed
+ if (Cache[BrokenPkg].Delete() == true && !List->IsFlag(BrokenPkg,pkgOrderList::Configured))
+ {
+ if (Debug)
+ cout << OutputInDepth(Depth) << " Removing " << BrokenPkg.Name() << " to avoid " << End << endl;
+ SmartRemove(BrokenPkg);
+ }
}
}
}