diff options
author | Julian Andres Klode <jak@debian.org> | 2021-10-18 13:36:00 +0000 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2021-10-18 13:36:00 +0000 |
commit | edf4b2169405e7ca6e21f408229e5fc4bbd4f4ed (patch) | |
tree | 864a13dbda22e3b4de7b69600521fb7e7d8b39a2 /apt-private | |
parent | 883a12310a4130370965eab0a710a2c8fae6cc09 (diff) | |
parent | 70c669e2566d119559d2986635bb6c1d0d368073 (diff) |
Merge branch 'feature/barbarianarchs' into 'main'
Streamline access to barbarian architecture functionality
See merge request apt-team/apt!184
Diffstat (limited to 'apt-private')
-rw-r--r-- | apt-private/private-source.cc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/apt-private/private-source.cc b/apt-private/private-source.cc index def24bd27..db96cb17f 100644 --- a/apt-private/private-source.cc +++ b/apt-private/private-source.cc @@ -568,7 +568,7 @@ bool DoSource(CommandLine &CmdL) /* This function will look at the build depends list of the given source package and install the necessary packages to make it true, or fail. */ static std::vector<pkgSrcRecords::Parser::BuildDepRec> GetBuildDeps(pkgSrcRecords::Parser * const Last, - char const * const Src, bool const StripMultiArch, std::string const &hostArch) + char const * const Src, std::string const &hostArch) { std::vector<pkgSrcRecords::Parser::BuildDepRec> BuildDeps; // FIXME: Can't specify architecture to use for [wildcard] matching, so switch default arch temporary @@ -576,7 +576,7 @@ static std::vector<pkgSrcRecords::Parser::BuildDepRec> GetBuildDeps(pkgSrcRecord { std::string nativeArch = _config->Find("APT::Architecture"); _config->Set("APT::Architecture", hostArch); - bool Success = Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only", false), StripMultiArch); + bool Success = Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only", false), false); _config->Set("APT::Architecture", nativeArch); if (Success == false) { @@ -584,7 +584,7 @@ static std::vector<pkgSrcRecords::Parser::BuildDepRec> GetBuildDeps(pkgSrcRecord return {}; } } - else if (Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only", false), StripMultiArch) == false) + else if (Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only", false), false) == false) { _error->Error(_("Unable to get build-dependency information for %s"), Src); return {}; @@ -637,17 +637,16 @@ static void WriteBuildDependencyPackage(std::ostringstream &buildDepsPkgFile, } bool DoBuildDep(CommandLine &CmdL) { - bool StripMultiArch; std::string hostArch = _config->Find("APT::Get::Host-Architecture"); - if (hostArch.empty() == false) + if (not hostArch.empty()) { - std::vector<std::string> archs = APT::Configuration::getArchitectures(); - if (std::find(archs.begin(), archs.end(), hostArch) == archs.end()) - return _error->Error(_("No architecture information available for %s. See apt.conf(5) APT::Architectures for setup"), hostArch.c_str()); - StripMultiArch = false; + if (not APT::Configuration::checkArchitecture(hostArch)) + { + auto const veryforeign = _config->FindVector("APT::BarbarianArchitectures"); + if (std::find(veryforeign.begin(), veryforeign.end(), hostArch) == veryforeign.end()) + _error->Warning(_("No architecture information available for %s. See apt.conf(5) APT::Architectures for setup"), hostArch.c_str()); + } } - else - StripMultiArch = true; auto const nativeArch = _config->Find("APT::Architecture"); std::string const pseudoArch = hostArch.empty() ? nativeArch : hostArch; @@ -777,7 +776,7 @@ bool DoBuildDep(CommandLine &CmdL) auto pseudo = std::string("builddeps:") + pkg.name; WriteBuildDependencyPackage(buildDepsPkgFile, pseudo, pseudoArch, - GetBuildDeps(Last.get(), pkg.name.c_str(), StripMultiArch, hostArch)); + GetBuildDeps(Last.get(), pkg.name.c_str(), hostArch)); pkg.name = std::move(pseudo); pseudoPkgs.push_back(std::move(pkg)); } @@ -802,7 +801,7 @@ bool DoBuildDep(CommandLine &CmdL) std::string const pseudo = std::string("builddeps:") + Src; WriteBuildDependencyPackage(buildDepsPkgFile, pseudo, pseudoArch, - GetBuildDeps(Last, Src.c_str(), StripMultiArch, hostArch)); + GetBuildDeps(Last, Src.c_str(), hostArch)); std::string reltag = *I; size_t found = reltag.find_last_of("/"); if (found == std::string::npos) |