From e6065cfcf0b5c6a57aa582cb3c2bd2b3fafe64b7 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 14 Mar 2007 11:38:41 +0100 Subject: * apt-pkg/depcache.cc: - added "APT::Never-MarkAuto-Section" and consider dependencies of packages in this section manual * debian/apt.conf.ubuntu: - added APT::Never-MarkAuto-Section "metapackages"; --- apt-pkg/depcache.cc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 81e1eeb33..fe8a617ac 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -955,11 +955,23 @@ 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, ForceImportantDeps); + } + 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; } -- cgit v1.2.3