]> git.saurik.com Git - apt.git/blobdiff - apt-private/private-source.cc
eipp: add Allow-Temporary-Remove-of-Essentials
[apt.git] / apt-private / private-source.cc
index 5aaf6f48b4b8eaa3c4cbd20e9e852bc13dbbd6f9..220f1bd5a2f04471a9b3aec2f915bc18c2e0822a 100644 (file)
@@ -438,6 +438,7 @@ bool DoSource(CommandLine &CmdL)
         {
            ioprintf(c1out, "Skipping download of file '%s' as requested hashsum is not available for authentication\n",
                  localFile.c_str());
         {
            ioprintf(c1out, "Skipping download of file '%s' as requested hashsum is not available for authentication\n",
                  localFile.c_str());
+           Dsc[J].Dsc.clear();
            continue;
         }
 
            continue;
         }
 
@@ -478,8 +479,8 @@ bool DoSource(CommandLine &CmdL)
    {
       pkgAcquire::UriIterator I = Fetcher.UriBegin();
       for (; I != Fetcher.UriEnd(); ++I)
    {
       pkgAcquire::UriIterator I = Fetcher.UriBegin();
       for (; I != Fetcher.UriEnd(); ++I)
-        std::cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << 
-           I->Owner->FileSize << ' ' << I->Owner->HashSum() << std::endl;
+        std::cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
+           std::to_string(I->Owner->FileSize) << ' ' << I->Owner->HashSum() << std::endl;
       return true;
    }
 
       return true;
    }
 
@@ -775,8 +776,31 @@ bool DoBuildDep(CommandLine &CmdL)
    }
    if (DoAutomaticRemove(Cache) == false)
       return false;
    }
    if (DoAutomaticRemove(Cache) == false)
       return false;
+
    {
       pkgDepCache::ActionGroup group(Cache);
    {
       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);
    }
       for (auto const &pkg: removeAgain)
         Cache->MarkDelete(pkg, false, 0, true);
    }