From 65f9983436be310c768c4c42531ceea1e3a6d4ac Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 16 May 2012 16:44:15 +0200 Subject: * cmdline/apt-get.cc: - use the host architecture, not the build architecture for matching of [architecture restrictions] in Build-Depends (Closes: #672927) * --- cmdline/apt-get.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index dd9313bff..c996017b8 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2789,8 +2789,18 @@ bool DoBuildDep(CommandLine &CmdL) // Process the build-dependencies vector BuildDeps; - 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()); + // FIXME: Can't specify architecture to use for [wildcard] matching, so switch default arch temporary + if (hostArch.empty() == false) + { + 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); + _config->Set("APT::Architecture", nativeArch); + if (Success == false) + return _error->Error(_("Unable to get build-dependency information for %s"),Src.c_str()); + } + 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"); -- cgit v1.2.3