]> git.saurik.com Git - apt.git/blobdiff - apt-private/private-source.cc
edsp: ask policy engine for the pin of the version directly
[apt.git] / apt-private / private-source.cc
index 5aaf6f48b4b8eaa3c4cbd20e9e852bc13dbbd6f9..5053c60fc41ba144585978e97cf66d52b46db3f5 100644 (file)
@@ -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);
    }