summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/packagemanager.cc10
-rw-r--r--apt-pkg/packagemanager.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index 442143516..dbcd461ac 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -125,7 +125,7 @@ bool pkgPackageManager::FixMissing()
/* This adds the immediate flag to the pkg and recursively to the
dependendies
*/
-void pkgPackageManager::ImmediateAdd(PkgIterator I, bool UseInstallVer)
+void pkgPackageManager::ImmediateAdd(PkgIterator I, bool UseInstallVer, unsigned const int &Depth)
{
DepIterator D;
@@ -143,12 +143,16 @@ void pkgPackageManager::ImmediateAdd(PkgIterator I, bool UseInstallVer)
for ( /* nothing */ ; D.end() == false; D++)
if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
{
+ // ignore dependencies if no instal/upgrade/remove is going to happen
+ if (D.TargetPkg() == 0 || Cache[D.TargetPkg()].Keep())
+ continue;
+
if(!List->IsFlag(D.TargetPkg(), pkgOrderList::Immediate))
{
if(Debug)
- clog << "ImmediateAdd(): Adding Immediate flag to " << I.Name() << endl;
+ clog << OutputInDepth(Depth) << "ImmediateAdd(): Adding Immediate flag to " << D.TargetPkg() << " cause of " << D.DepType() << " " << I.Name() << endl;
List->Flag(D.TargetPkg(),pkgOrderList::Immediate);
- ImmediateAdd(D.TargetPkg(), UseInstallVer);
+ ImmediateAdd(D.TargetPkg(), UseInstallVer, Depth + 1);
}
}
return;
diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h
index a1bfdc52d..af1476b7a 100644
--- a/apt-pkg/packagemanager.h
+++ b/apt-pkg/packagemanager.h
@@ -49,7 +49,7 @@ class pkgPackageManager : protected pkgCache::Namespace
bool Debug;
bool DepAdd(pkgOrderList &Order,PkgIterator P,int Depth = 0);
- void ImmediateAdd(PkgIterator P, bool UseInstallVer);
+ void ImmediateAdd(PkgIterator P, bool UseInstallVer, unsigned const int &Depth = 0);
virtual OrderResult OrderInstall();
bool CheckRConflicts(PkgIterator Pkg,DepIterator Dep,const char *Ver);
bool CreateOrderList();