diff options
author | Michael Vogt <egon@bottom> | 2007-05-02 13:58:21 +0200 |
---|---|---|
committer | Michael Vogt <egon@bottom> | 2007-05-02 13:58:21 +0200 |
commit | b51ff02a550881118ce4c677a6f2ce1d0aff9cd8 (patch) | |
tree | eb13239922de5805476416e86096e5b0b4f4cbdd /apt-pkg | |
parent | 8171c75b9939a13aa22a3f45d436a6305af561ff (diff) | |
parent | 54eda6ae969cd66d06fe82f7175f753a74d2b7dc (diff) |
* updated from http://people.ubuntu.com/~mvo/bzr/apt/auto-mark/
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/depcache.cc | 21 | ||||
-rw-r--r-- | apt-pkg/packagemanager.cc | 3 |
2 files changed, 18 insertions, 6 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 390d93dc8..ac667d51d 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -948,11 +948,22 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, std::clog << "Installing " << InstPkg.Name() << " as dep of " << Pkg.Name() << std::endl; - MarkInstall(InstPkg,true,Depth + 1, false, ForceImportantDeps); - - // Set the autoflag, after MarkInstall because MarkInstall unsets it - if (P->CurrentVer == 0) - PkgState[InstPkg->ID].Flags |= Flag::Auto; + // now check if we should consider it a automatic dependency or not + string sec = _config->Find("APT::Never-MarkAuto-Section",""); + if(Pkg.Section() && (string(Pkg.Section()) == sec)) + { + if(_config->FindB("Debug::pkgDepCache::AutoInstall",false) == true) + std::clog << "Setting NOT as auto-installed because its a direct dep of a package in section " << sec << std::endl; + MarkInstall(InstPkg,true,Depth + 1, true); + } + else + { + // mark automatic dependency + MarkInstall(InstPkg,true,Depth + 1, false, ForceImportantDeps); + // Set the autoflag, after MarkInstall because MarkInstall unsets it + if (P->CurrentVer == 0) + PkgState[InstPkg->ID].Flags |= Flag::Auto; + } } continue; } diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index b0dd43629..1e57d6455 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -95,9 +95,10 @@ bool pkgPackageManager::GetArchives(pkgAcquire *Owner,pkgSourceList *Sources, be downloaded. */ bool pkgPackageManager::FixMissing() { + pkgDepCache::ActionGroup group(Cache); pkgProblemResolver Resolve(&Cache); List->SetFileList(FileNames); - + bool Bad = false; for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++) { |