diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-08-09 20:01:46 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-08-09 20:01:46 +0200 |
commit | 1b1c2224f5777956f345471b600ed56203c2d400 (patch) | |
tree | 79454468e6f0a097ef1cfbea17a26aee67e0a931 /apt-pkg | |
parent | 73c460c358cfa6615ee6760a3fb8d88988a12856 (diff) |
* apt-pkg/depcache.cc:
- find new important dependencies on upgrade and deal with them
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/depcache.cc | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 8560ce4fd..6296892ba 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -667,7 +667,33 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, it will be installed. Otherwise we only worry about critical deps */ if (IsImportantDep(Start) == false) continue; - if (Pkg->CurrentVer != 0 && Start.IsCritical() == false) + + /* check if any ImportantDep() (but not Critial) where added + * since we installed the thing + */ + bool isNewImportantDep = false; + if(IsImportantDep(Start) && !Start.IsCritical()) + { + bool found=false; + VerIterator instVer = Pkg.CurrentVer(); + for (DepIterator D = instVer.DependsList(); !D.end(); D++) + { + //FIXME: deal better with or-groups(?) + DepIterator LocalStart = D; + + if(IsImportantDep(Dep) && Start.TargetPkg() == D.TargetPkg()) + found=true; + } + // this is a new dep if it was not found to be already + // a important dep of the installed pacakge + isNewImportantDep = !found; + } + if(isNewImportantDep) + if(_config->FindB("Debug::pkgDepCache::AutoInstall",false) == true) + std::clog << "new important dependency: " + << Start.TargetPkg().Name() << std::endl; + + if (Pkg->CurrentVer != 0 && Start.IsCritical() == false && !isNewImportantDep) continue; /* If we are in an or group locate the first or that can |