]> git.saurik.com Git - apt.git/commitdiff
allow default build-essentials to be overridden
authorDavid Kalnischkies <david@kalnischkies.de>
Thu, 29 Dec 2016 11:41:23 +0000 (12:41 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Sat, 31 Dec 2016 01:29:20 +0000 (02:29 +0100)
The config list APT::Build-Essential gets a similar treatment to other
lists now by having the value of the option itself be an override for
the list allowing to disable build-essentials entirely as well as
adding/overriding as usual by now in other lists.

Reported-By: Johannes 'josch' Schauer on IRC
apt-private/private-source.cc
test/integration/test-apt-get-build-dep

index 5cd0a6628ec07965b61d59012c0ddcf7f057c1cd..96344d7ab00a5d70972b3942a5aba98836b01072 100644 (file)
@@ -668,16 +668,12 @@ bool DoBuildDep(CommandLine &CmdL)
    // 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)
+      for (auto && opt: _config->FindVector("APT::Build-Essential"))
       {
-        if (Opts->Value.empty() == true)
+        if (opt.empty())
            continue;
-
         pkgSrcRecords::Parser::BuildDepRec rec;
-        rec.Package = Opts->Value;
+        rec.Package = std::move(opt);
         rec.Type = pkgSrcRecords::Parser::BuildDependIndep;
         rec.Op = 0;
         BuildDeps.push_back(rec);
index 4fa77961bb9afd5f86f81bdcd44b22e5294b95fd..403de8f351369e36fcb6179fec9c134ff9db0375 100755 (executable)
@@ -8,6 +8,7 @@ setupenvironment
 configarchitecture 'i386'
 
 insertpackage 'stable' 'build-essential' 'i386' '1'
+insertpackage 'stable' 'build-essential2' 'i386' '1'
 insertpackage 'stable' 'build-depends' 'i386' '1'
 insertpackage 'stable' 'build-depends-arch' 'i386' '1'
 insertpackage 'stable' 'build-depends-indep' 'i386' '1'
@@ -52,6 +53,67 @@ Conf build-depends-arch (1 stable [i386])
 Conf build-depends-indep (1 stable [i386])
 Conf build-essential (1 stable [i386])" aptget build-dep --simulate ./foobar.dsc
 
+testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies
+Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+  build-conflicts build-conflicts-arch build-conflicts-indep
+The following NEW packages will be installed:
+  build-depends build-depends-arch build-depends-indep build-essential2
+0 upgraded, 4 newly installed, 3 to remove and 0 not upgraded.
+Remv build-conflicts [1]
+Remv build-conflicts-arch [1]
+Remv build-conflicts-indep [1]
+Inst build-depends (1 stable [i386])
+Inst build-depends-arch (1 stable [i386])
+Inst build-depends-indep (1 stable [i386])
+Inst build-essential2 (1 stable [i386])
+Conf build-depends (1 stable [i386])
+Conf build-depends-arch (1 stable [i386])
+Conf build-depends-indep (1 stable [i386])
+Conf build-essential2 (1 stable [i386])" aptget build-dep --simulate ./foobar.dsc -o APT::Build-Essential="build-essential2"
+
+testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies
+Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+  build-conflicts build-conflicts-arch build-conflicts-indep
+The following NEW packages will be installed:
+  build-depends build-depends-arch build-depends-indep
+0 upgraded, 3 newly installed, 3 to remove and 0 not upgraded.
+Remv build-conflicts [1]
+Remv build-conflicts-arch [1]
+Remv build-conflicts-indep [1]
+Inst build-depends (1 stable [i386])
+Inst build-depends-arch (1 stable [i386])
+Inst build-depends-indep (1 stable [i386])
+Conf build-depends (1 stable [i386])
+Conf build-depends-arch (1 stable [i386])
+Conf build-depends-indep (1 stable [i386])" aptget build-dep --simulate ./foobar.dsc -o APT::Build-Essential=","
+
+testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies
+Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+  build-conflicts build-conflicts-arch build-conflicts-indep
+The following NEW packages will be installed:
+  build-depends build-depends-arch build-depends-indep build-essential
+  build-essential2
+0 upgraded, 5 newly installed, 3 to remove and 0 not upgraded.
+Remv build-conflicts [1]
+Remv build-conflicts-arch [1]
+Remv build-conflicts-indep [1]
+Inst build-depends (1 stable [i386])
+Inst build-depends-arch (1 stable [i386])
+Inst build-depends-indep (1 stable [i386])
+Inst build-essential (1 stable [i386])
+Inst build-essential2 (1 stable [i386])
+Conf build-depends (1 stable [i386])
+Conf build-depends-arch (1 stable [i386])
+Conf build-depends-indep (1 stable [i386])
+Conf build-essential (1 stable [i386])
+Conf build-essential2 (1 stable [i386])" aptget build-dep --simulate ./foobar.dsc -o APT::Build-Essential::="build-essential2"
+
 testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies
 Reading package lists...
 Building dependency tree...