diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-02-16 20:32:28 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-03-06 09:39:30 +0100 |
commit | c97ae2a00f41febb9558b5e6ef08019b93dcefac (patch) | |
tree | cfb76e281c29315cc056cb2fd42a11b6a7d2f825 /apt-private | |
parent | a66e1837812cefc1f08788f8696724d4931e8022 (diff) |
support APT::Get::Build-Dep-Automatic again in build-dep
In a249b3e6fd798935a02b769149c9791a6fa6ef16 I dropped with the manual
first resolver step also the support for installing build-deps as
automatic in such a way that it behaved like this option was enabled by
default.
Restoring support for it means that we go back to mark build-
dependencies as manually installed again by default and provide this
option to keep them as automatically installed.
Diffstat (limited to 'apt-private')
-rw-r--r-- | apt-private/private-source.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/apt-private/private-source.cc b/apt-private/private-source.cc index 5aaf6f48b..5053c60fc 100644 --- a/apt-private/private-source.cc +++ b/apt-private/private-source.cc @@ -775,8 +775,31 @@ bool DoBuildDep(CommandLine &CmdL) } if (DoAutomaticRemove(Cache) == false) return false; + { pkgDepCache::ActionGroup group(Cache); + if (_config->FindB("APT::Get::Build-Dep-Automatic", false) == false) + { + for (auto const &pkg: removeAgain) + { + auto const instVer = Cache[pkg].InstVerIter(Cache); + if (unlikely(instVer.end() == true)) + continue; + for (auto D = instVer.DependsList(); D.end() != true; ++D) + { + if (D->Type != pkgCache::Dep::Depends || D.IsMultiArchImplicit()) + continue; + APT::VersionList verlist = APT::VersionList::FromDependency(Cache, D, APT::CacheSetHelper::CANDIDATE); + for (auto const &V : verlist) + { + auto const P = V.ParentPkg(); + if (Cache[P].InstallVer != V) + continue; + Cache->MarkAuto(P, false); + } + } + } + } for (auto const &pkg: removeAgain) Cache->MarkDelete(pkg, false, 0, true); } |