summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-12-01 11:29:17 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2015-12-01 14:25:28 +0100
commit7d19ee92f2368a40e739cb27d22d6d28f37ebf45 (patch)
treeffee9018fbe609f1785624f315e0838be38d0b72 /apt-private
parentaa368243bb03a45b5a3831ac30a16882f93fc6fe (diff)
deal with configured build-essential first
There is no need to check configured build-essentials for each package, doing it once at the start ought to be enough. Git-Dch: Ignore
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/private-source.cc39
1 files changed, 23 insertions, 16 deletions
diff --git a/apt-private/private-source.cc b/apt-private/private-source.cc
index c2aabdcc6..546aa523f 100644
--- a/apt-private/private-source.cc
+++ b/apt-private/private-source.cc
@@ -951,6 +951,29 @@ bool DoBuildDep(CommandLine &CmdL)
else
StripMultiArch = true;
+ // deal with the build essentials first
+ {
+ std::vector<pkgSrcRecords::Parser::BuildDepRec> BuildDeps;
+
+ Configuration::Item const *Opts = _config->Tree("APT::Build-Essential");
+ if (Opts)
+ Opts = Opts->Child;
+ for (; Opts; Opts = Opts->Next)
+ {
+ if (Opts->Value.empty() == true)
+ continue;
+
+ pkgSrcRecords::Parser::BuildDepRec rec;
+ rec.Package = Opts->Value;
+ rec.Type = pkgSrcRecords::Parser::BuildDependIndep;
+ rec.Op = 0;
+ BuildDeps.push_back(rec);
+ }
+
+ if (InstallBuildDepsLoop(Cache, "APT::Build-Essential", BuildDeps, StripMultiArch, hostArch) == false)
+ return false;
+ }
+
unsigned J = 0;
for (const char **I = CmdL.FileList + 1; *I != 0; I++, J++)
{
@@ -1003,22 +1026,6 @@ bool DoBuildDep(CommandLine &CmdL)
else if (Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only", false), StripMultiArch) == false)
return _error->Error(_("Unable to get build-dependency information for %s"),Src.c_str());
- // Also ensure that build-essential packages are present
- Configuration::Item const *Opts = _config->Tree("APT::Build-Essential");
- if (Opts)
- Opts = Opts->Child;
- for (; Opts; Opts = Opts->Next)
- {
- if (Opts->Value.empty() == true)
- continue;
-
- pkgSrcRecords::Parser::BuildDepRec rec;
- rec.Package = Opts->Value;
- rec.Type = pkgSrcRecords::Parser::BuildDependIndep;
- rec.Op = 0;
- BuildDeps.push_back(rec);
- }
-
if (BuildDeps.empty() == true)
{
ioprintf(c1out,_("%s has no build depends.\n"),Src.c_str());