summaryrefslogtreecommitdiff
path: root/apt-pkg/packagemanager.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2008-01-07 21:26:11 +0100
committerMichael Vogt <egon@bottom>2008-01-07 21:26:11 +0100
commit187b88d8d90ee10b2e2e14ba762be2fdd9fce744 (patch)
treefbb090aa431bcd89a7207b20d3b585ff43456d8e /apt-pkg/packagemanager.cc
parent0a626f9e3738d5ff70b81820b3c497a4a50f589c (diff)
parentf0983ff2091df782027a2e344cbd9e3df43c1450 (diff)
* apt-pkg/packagemanager.{cc,h}:
- propergate the Immediate flag to make hitting the "E: Internal Error, Could not perform immediate configuration (2)" harder * debian/control: - build against libdb-dev (instead of libdb4.4-dev) * merged the apt--DoListUpdate branch, this provides a common interface for "apt-get update" like operations for the frontends and also provides hooks to run stuff in APT::Update::{Pre,Post}-Invoke
Diffstat (limited to 'apt-pkg/packagemanager.cc')
-rw-r--r--apt-pkg/packagemanager.cc53
1 files changed, 41 insertions, 12 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index d6172c6c4..c391a6036 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -118,6 +118,41 @@ bool pkgPackageManager::FixMissing()
}
/*}}}*/
+// PM::ImmediateAdd - Add the immediate flag recursivly /*{{{*/
+// ---------------------------------------------------------------------
+/* This adds the immediate flag to the pkg and recursively to the
+ dependendies
+ */
+void pkgPackageManager::ImmediateAdd(PkgIterator I, bool UseInstallVer)
+{
+ DepIterator D;
+
+ if(UseInstallVer)
+ {
+ if(Cache[I].InstallVer == 0)
+ return;
+ D = Cache[I].InstVerIter(Cache).DependsList();
+ } else {
+ if (I->CurrentVer == 0)
+ return;
+ D = I.CurrentVer().DependsList();
+ }
+
+ for ( /* nothing */ ; D.end() == false; D++)
+ if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
+ {
+ if(!List->IsFlag(D.TargetPkg(), pkgOrderList::Immediate))
+ {
+ if(Debug)
+ clog << "ImmediateAdd(): Adding Immediate flag to " << I.Name() << endl;
+ List->Flag(D.TargetPkg(),pkgOrderList::Immediate);
+ ImmediateAdd(D.TargetPkg(), UseInstallVer);
+ }
+ }
+ return;
+}
+ /*}}}*/
+
// PM::CreateOrderList - Create the ordering class /*{{{*/
// ---------------------------------------------------------------------
/* This populates the ordering list with all the packages that are
@@ -144,21 +179,15 @@ bool pkgPackageManager::CreateOrderList()
(I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) &&
NoImmConfigure == false)
{
+ if(Debug)
+ clog << "CreateOrderList(): Adding Immediate flag for " << I.Name() << endl;
List->Flag(I,pkgOrderList::Immediate);
-
- // Look for other packages to make immediate configurea
- if (Cache[I].InstallVer != 0)
- for (DepIterator D = Cache[I].InstVerIter(Cache).DependsList();
- D.end() == false; D++)
- if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
- List->Flag(D.TargetPkg(),pkgOrderList::Immediate);
+
+ // Look for other install packages to make immediate configurea
+ ImmediateAdd(I, true);
// And again with the current version.
- if (I->CurrentVer != 0)
- for (DepIterator D = I.CurrentVer().DependsList();
- D.end() == false; D++)
- if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
- List->Flag(D.TargetPkg(),pkgOrderList::Immediate);
+ ImmediateAdd(I, false);
}
// Not interesting