Procházet zdrojové kódy

* cmdline/apt-get.cc:
- use the host architecture, not the build architecture for matching
of [architecture restrictions] in Build-Depends (Closes: #672927)
*

David Kalnischkies před 14 roky
rodič
revize
65f9983436

+ 1 - 0
apt-pkg/srcrecords.h

@@ -71,6 +71,7 @@ class pkgSrcRecords
       virtual std::string Section() const = 0;
       virtual std::string Section() const = 0;
       virtual const char **Binaries() = 0;   // Ownership does not transfer
       virtual const char **Binaries() = 0;   // Ownership does not transfer
 
 
+      //FIXME: Add a parameter to specify which architecture to use for [wildcard] matching
       virtual bool BuildDepends(std::vector<BuildDepRec> &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true) = 0;
       virtual bool BuildDepends(std::vector<BuildDepRec> &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true) = 0;
       static const char *BuildDepType(unsigned char const &Type);
       static const char *BuildDepType(unsigned char const &Type);
 
 

+ 12 - 2
cmdline/apt-get.cc

@@ -2789,8 +2789,18 @@ bool DoBuildDep(CommandLine &CmdL)
             
             
       // Process the build-dependencies
       // Process the build-dependencies
       vector<pkgSrcRecords::Parser::BuildDepRec> BuildDeps;
       vector<pkgSrcRecords::Parser::BuildDepRec> 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
       // Also ensure that build-essential packages are present
       Configuration::Item const *Opts = _config->Tree("APT::Build-Essential");
       Configuration::Item const *Opts = _config->Tree("APT::Build-Essential");

+ 6 - 0
debian/changelog

@@ -24,6 +24,9 @@ apt (0.9.4) UNRELEASED; urgency=low
   * apt-pkg/contrib/fileutl.cc:
   * apt-pkg/contrib/fileutl.cc:
     - ensure that we close compressed fds, wait for forks and such even if
     - ensure that we close compressed fds, wait for forks and such even if
       the FileFd itself is set to not autoclose the given Fd
       the FileFd itself is set to not autoclose the given Fd
+  * cmdline/apt-get.cc:
+    - use the host architecture, not the build architecture for matching
+      of [architecture restrictions] in Build-Depends (Closes: #672927)
 
 
   [ Raphael Geissert ]
   [ Raphael Geissert ]
   * apt-pkg/acquire*.cc:
   * apt-pkg/acquire*.cc:
@@ -39,6 +42,9 @@ apt (0.9.4) UNRELEASED; urgency=low
   * apt-pkg/algorithms.cc:
   * apt-pkg/algorithms.cc:
     - fix memory leak of Flags in pkgSimulate by a proper destructor
     - fix memory leak of Flags in pkgSimulate by a proper destructor
 
 
+  [ David Kalnischkies ]
+  * 
+
  -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 11 May 2012 23:26:59 +0200
  -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 11 May 2012 23:26:59 +0200
 
 
 apt (0.9.3) unstable; urgency=low
 apt (0.9.3) unstable; urgency=low

+ 42 - 24
test/integration/test-bug-632221-cross-dependency-satisfaction

@@ -18,8 +18,10 @@ insertpackage 'unstable' 'libfwibble-dev' 'amd64,armel' '1.0' 'Depends: libfwibb
 insertpackage 'unstable' 'cool' 'amd64,armel' '1.0' 'Multi-Arch: allowed'
 insertpackage 'unstable' 'cool' 'amd64,armel' '1.0' 'Multi-Arch: allowed'
 insertpackage 'unstable' 'amdboot' 'amd64' '1.0'
 insertpackage 'unstable' 'amdboot' 'amd64' '1.0'
 insertpackage 'unstable' 'foreigner' 'amd64,armel' '1.0' 'Multi-Arch: foreign'
 insertpackage 'unstable' 'foreigner' 'amd64,armel' '1.0' 'Multi-Arch: foreign'
+insertpackage 'unstable' 'arm-stuff' 'armel' '1.0'
+insertpackage 'unstable' 'linux-stuff' 'amd64,armel' '1.0'
 
 
-insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner, libfwibble-dev'
+insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner, libfwibble-dev, arm-stuff [any-arm] | linux-stuff [ linux-any]'
 
 
 setupaptarchive
 setupaptarchive
 
 
@@ -27,7 +29,8 @@ testequal 'Reading package lists...
 Building dependency tree...
 Building dependency tree...
 The following NEW packages will be installed:
 The following NEW packages will be installed:
   amdboot cool doxygen foreigner libc6 libc6-dev libfwibble-dev libfwibble1
   amdboot cool doxygen foreigner libc6 libc6-dev libfwibble-dev libfwibble1
-0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
+  linux-stuff
+0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
 Inst amdboot (1.0 unstable [amd64])
 Inst amdboot (1.0 unstable [amd64])
 Inst cool (1.0 unstable [amd64])
 Inst cool (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [amd64])
@@ -36,6 +39,7 @@ Inst libc6 (1.0 unstable [amd64])
 Inst libc6-dev (1.0 unstable [amd64])
 Inst libc6-dev (1.0 unstable [amd64])
 Inst libfwibble1 (1.0 unstable [amd64])
 Inst libfwibble1 (1.0 unstable [amd64])
 Inst libfwibble-dev (1.0 unstable [amd64])
 Inst libfwibble-dev (1.0 unstable [amd64])
+Inst linux-stuff (1.0 unstable [amd64])
 Conf amdboot (1.0 unstable [amd64])
 Conf amdboot (1.0 unstable [amd64])
 Conf cool (1.0 unstable [amd64])
 Conf cool (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [amd64])
@@ -43,15 +47,17 @@ Conf foreigner (1.0 unstable [amd64])
 Conf libc6 (1.0 unstable [amd64])
 Conf libc6 (1.0 unstable [amd64])
 Conf libc6-dev (1.0 unstable [amd64])
 Conf libc6-dev (1.0 unstable [amd64])
 Conf libfwibble1 (1.0 unstable [amd64])
 Conf libfwibble1 (1.0 unstable [amd64])
-Conf libfwibble-dev (1.0 unstable [amd64])' aptget build-dep apt -s
+Conf libfwibble-dev (1.0 unstable [amd64])
+Conf linux-stuff (1.0 unstable [amd64])' aptget build-dep apt -s
 
 
 testequal 'Reading package lists...
 testequal 'Reading package lists...
 Building dependency tree...
 Building dependency tree...
 The following NEW packages will be installed:
 The following NEW packages will be installed:
-  amdboot cool doxygen foreigner libc6 libc6:armel libc6-dev libc6-dev:armel
-  libfwibble-dev:armel libfwibble1:armel
-0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
+  amdboot arm-stuff:armel cool doxygen foreigner libc6 libc6:armel libc6-dev
+  libc6-dev:armel libfwibble-dev:armel libfwibble1:armel
+0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
 Inst amdboot (1.0 unstable [amd64])
 Inst amdboot (1.0 unstable [amd64])
+Inst arm-stuff:armel (1.0 unstable [armel])
 Inst cool (1.0 unstable [amd64])
 Inst cool (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [amd64])
 Inst foreigner (1.0 unstable [amd64])
 Inst foreigner (1.0 unstable [amd64])
@@ -62,6 +68,7 @@ Inst libc6-dev:armel (1.0 unstable [armel])
 Inst libfwibble1:armel (1.0 unstable [armel])
 Inst libfwibble1:armel (1.0 unstable [armel])
 Inst libfwibble-dev:armel (1.0 unstable [armel])
 Inst libfwibble-dev:armel (1.0 unstable [armel])
 Conf amdboot (1.0 unstable [amd64])
 Conf amdboot (1.0 unstable [amd64])
+Conf arm-stuff:armel (1.0 unstable [armel])
 Conf cool (1.0 unstable [amd64])
 Conf cool (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [amd64])
 Conf foreigner (1.0 unstable [amd64])
 Conf foreigner (1.0 unstable [amd64])
@@ -77,10 +84,11 @@ configarchitecture 'armel' 'amd64'
 testequal 'Reading package lists...
 testequal 'Reading package lists...
 Building dependency tree...
 Building dependency tree...
 The following NEW packages will be installed:
 The following NEW packages will be installed:
-  amdboot:amd64 cool doxygen foreigner libc6 libc6-dev libfwibble-dev
-  libfwibble1
-0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
+  amdboot:amd64 arm-stuff cool doxygen foreigner libc6 libc6-dev
+  libfwibble-dev libfwibble1
+0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
 Inst amdboot:amd64 (1.0 unstable [amd64])
 Inst amdboot:amd64 (1.0 unstable [amd64])
+Inst arm-stuff (1.0 unstable [armel])
 Inst cool (1.0 unstable [armel])
 Inst cool (1.0 unstable [armel])
 Inst doxygen (1.0 unstable [armel])
 Inst doxygen (1.0 unstable [armel])
 Inst foreigner (1.0 unstable [armel])
 Inst foreigner (1.0 unstable [armel])
@@ -89,6 +97,7 @@ Inst libc6-dev (1.0 unstable [armel])
 Inst libfwibble1 (1.0 unstable [armel])
 Inst libfwibble1 (1.0 unstable [armel])
 Inst libfwibble-dev (1.0 unstable [armel])
 Inst libfwibble-dev (1.0 unstable [armel])
 Conf amdboot:amd64 (1.0 unstable [amd64])
 Conf amdboot:amd64 (1.0 unstable [amd64])
+Conf arm-stuff (1.0 unstable [armel])
 Conf cool (1.0 unstable [armel])
 Conf cool (1.0 unstable [armel])
 Conf doxygen (1.0 unstable [armel])
 Conf doxygen (1.0 unstable [armel])
 Conf foreigner (1.0 unstable [armel])
 Conf foreigner (1.0 unstable [armel])
@@ -101,8 +110,8 @@ testequal 'Reading package lists...
 Building dependency tree...
 Building dependency tree...
 The following NEW packages will be installed:
 The following NEW packages will be installed:
   amdboot:amd64 cool doxygen foreigner libc6:amd64 libc6 libc6-dev:amd64
   amdboot:amd64 cool doxygen foreigner libc6:amd64 libc6 libc6-dev:amd64
-  libc6-dev libfwibble-dev:amd64 libfwibble1:amd64
-0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
+  libc6-dev libfwibble-dev:amd64 libfwibble1:amd64 linux-stuff:amd64
+0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
 Inst amdboot:amd64 (1.0 unstable [amd64])
 Inst amdboot:amd64 (1.0 unstable [amd64])
 Inst cool (1.0 unstable [armel])
 Inst cool (1.0 unstable [armel])
 Inst doxygen (1.0 unstable [armel])
 Inst doxygen (1.0 unstable [armel])
@@ -113,6 +122,7 @@ Inst libc6-dev:amd64 (1.0 unstable [amd64])
 Inst libc6-dev (1.0 unstable [armel])
 Inst libc6-dev (1.0 unstable [armel])
 Inst libfwibble1:amd64 (1.0 unstable [amd64])
 Inst libfwibble1:amd64 (1.0 unstable [amd64])
 Inst libfwibble-dev:amd64 (1.0 unstable [amd64])
 Inst libfwibble-dev:amd64 (1.0 unstable [amd64])
+Inst linux-stuff:amd64 (1.0 unstable [amd64])
 Conf amdboot:amd64 (1.0 unstable [amd64])
 Conf amdboot:amd64 (1.0 unstable [amd64])
 Conf cool (1.0 unstable [armel])
 Conf cool (1.0 unstable [armel])
 Conf doxygen (1.0 unstable [armel])
 Conf doxygen (1.0 unstable [armel])
@@ -122,7 +132,8 @@ Conf libc6 (1.0 unstable [armel])
 Conf libc6-dev:amd64 (1.0 unstable [amd64])
 Conf libc6-dev:amd64 (1.0 unstable [amd64])
 Conf libc6-dev (1.0 unstable [armel])
 Conf libc6-dev (1.0 unstable [armel])
 Conf libfwibble1:amd64 (1.0 unstable [amd64])
 Conf libfwibble1:amd64 (1.0 unstable [amd64])
-Conf libfwibble-dev:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64
+Conf libfwibble-dev:amd64 (1.0 unstable [amd64])
+Conf linux-stuff:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64
 
 
 configarchitecture 'amd64' 'armel'
 configarchitecture 'amd64' 'armel'
 
 
@@ -132,28 +143,31 @@ insertinstalledpackage 'foreigner' 'armel' '0.5'
 testequal 'Reading package lists...
 testequal 'Reading package lists...
 Building dependency tree...
 Building dependency tree...
 The following NEW packages will be installed:
 The following NEW packages will be installed:
-  amdboot doxygen libc6 libc6-dev libfwibble-dev libfwibble1
-0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded.
+  amdboot doxygen libc6 libc6-dev libfwibble-dev libfwibble1 linux-stuff
+0 upgraded, 7 newly installed, 0 to remove and 2 not upgraded.
 Inst amdboot (1.0 unstable [amd64])
 Inst amdboot (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [amd64])
 Inst libc6 (1.0 unstable [amd64])
 Inst libc6 (1.0 unstable [amd64])
 Inst libc6-dev (1.0 unstable [amd64])
 Inst libc6-dev (1.0 unstable [amd64])
 Inst libfwibble1 (1.0 unstable [amd64])
 Inst libfwibble1 (1.0 unstable [amd64])
 Inst libfwibble-dev (1.0 unstable [amd64])
 Inst libfwibble-dev (1.0 unstable [amd64])
+Inst linux-stuff (1.0 unstable [amd64])
 Conf amdboot (1.0 unstable [amd64])
 Conf amdboot (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [amd64])
 Conf libc6 (1.0 unstable [amd64])
 Conf libc6 (1.0 unstable [amd64])
 Conf libc6-dev (1.0 unstable [amd64])
 Conf libc6-dev (1.0 unstable [amd64])
 Conf libfwibble1 (1.0 unstable [amd64])
 Conf libfwibble1 (1.0 unstable [amd64])
-Conf libfwibble-dev (1.0 unstable [amd64])' aptget build-dep apt -s
+Conf libfwibble-dev (1.0 unstable [amd64])
+Conf linux-stuff (1.0 unstable [amd64])' aptget build-dep apt -s
 
 
 testequal 'Reading package lists...
 testequal 'Reading package lists...
 Building dependency tree...
 Building dependency tree...
 The following NEW packages will be installed:
 The following NEW packages will be installed:
-  amdboot doxygen libc6 libc6:armel libc6-dev libc6-dev:armel
+  amdboot arm-stuff:armel doxygen libc6 libc6:armel libc6-dev libc6-dev:armel
   libfwibble-dev:armel libfwibble1:armel
   libfwibble-dev:armel libfwibble1:armel
-0 upgraded, 8 newly installed, 0 to remove and 2 not upgraded.
+0 upgraded, 9 newly installed, 0 to remove and 2 not upgraded.
 Inst amdboot (1.0 unstable [amd64])
 Inst amdboot (1.0 unstable [amd64])
+Inst arm-stuff:armel (1.0 unstable [armel])
 Inst doxygen (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [amd64])
 Inst libc6 (1.0 unstable [amd64])
 Inst libc6 (1.0 unstable [amd64])
 Inst libc6:armel (1.0 unstable [armel])
 Inst libc6:armel (1.0 unstable [armel])
@@ -162,6 +176,7 @@ Inst libc6-dev:armel (1.0 unstable [armel])
 Inst libfwibble1:armel (1.0 unstable [armel])
 Inst libfwibble1:armel (1.0 unstable [armel])
 Inst libfwibble-dev:armel (1.0 unstable [armel])
 Inst libfwibble-dev:armel (1.0 unstable [armel])
 Conf amdboot (1.0 unstable [amd64])
 Conf amdboot (1.0 unstable [amd64])
+Conf arm-stuff:armel (1.0 unstable [armel])
 Conf doxygen (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [amd64])
 Conf libc6 (1.0 unstable [amd64])
 Conf libc6 (1.0 unstable [amd64])
 Conf libc6:armel (1.0 unstable [armel])
 Conf libc6:armel (1.0 unstable [armel])
@@ -178,10 +193,12 @@ Building dependency tree...
 The following packages will be REMOVED:
 The following packages will be REMOVED:
   cool:amd64
   cool:amd64
 The following NEW packages will be installed:
 The following NEW packages will be installed:
-  amdboot:amd64 cool doxygen libc6 libc6-dev libfwibble-dev libfwibble1
-0 upgraded, 7 newly installed, 1 to remove and 1 not upgraded.
+  amdboot:amd64 arm-stuff cool doxygen libc6 libc6-dev libfwibble-dev
+  libfwibble1
+0 upgraded, 8 newly installed, 1 to remove and 1 not upgraded.
 Remv cool:amd64 [0.5]
 Remv cool:amd64 [0.5]
 Inst amdboot:amd64 (1.0 unstable [amd64])
 Inst amdboot:amd64 (1.0 unstable [amd64])
+Inst arm-stuff (1.0 unstable [armel])
 Inst cool (1.0 unstable [armel])
 Inst cool (1.0 unstable [armel])
 Inst doxygen (1.0 unstable [armel])
 Inst doxygen (1.0 unstable [armel])
 Inst libc6 (1.0 unstable [armel])
 Inst libc6 (1.0 unstable [armel])
@@ -189,6 +206,7 @@ Inst libc6-dev (1.0 unstable [armel])
 Inst libfwibble1 (1.0 unstable [armel])
 Inst libfwibble1 (1.0 unstable [armel])
 Inst libfwibble-dev (1.0 unstable [armel])
 Inst libfwibble-dev (1.0 unstable [armel])
 Conf amdboot:amd64 (1.0 unstable [amd64])
 Conf amdboot:amd64 (1.0 unstable [amd64])
+Conf arm-stuff (1.0 unstable [armel])
 Conf cool (1.0 unstable [armel])
 Conf cool (1.0 unstable [armel])
 Conf doxygen (1.0 unstable [armel])
 Conf doxygen (1.0 unstable [armel])
 Conf libc6 (1.0 unstable [armel])
 Conf libc6 (1.0 unstable [armel])
@@ -200,8 +218,8 @@ testequal 'Reading package lists...
 Building dependency tree...
 Building dependency tree...
 The following NEW packages will be installed:
 The following NEW packages will be installed:
   amdboot:amd64 doxygen libc6:amd64 libc6 libc6-dev:amd64 libc6-dev
   amdboot:amd64 doxygen libc6:amd64 libc6 libc6-dev:amd64 libc6-dev
-  libfwibble-dev:amd64 libfwibble1:amd64
-0 upgraded, 8 newly installed, 0 to remove and 2 not upgraded.
+  libfwibble-dev:amd64 libfwibble1:amd64 linux-stuff:amd64
+0 upgraded, 9 newly installed, 0 to remove and 2 not upgraded.
 Inst amdboot:amd64 (1.0 unstable [amd64])
 Inst amdboot:amd64 (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [armel])
 Inst doxygen (1.0 unstable [armel])
 Inst libc6:amd64 (1.0 unstable [amd64])
 Inst libc6:amd64 (1.0 unstable [amd64])
@@ -210,6 +228,7 @@ Inst libc6-dev:amd64 (1.0 unstable [amd64])
 Inst libc6-dev (1.0 unstable [armel])
 Inst libc6-dev (1.0 unstable [armel])
 Inst libfwibble1:amd64 (1.0 unstable [amd64])
 Inst libfwibble1:amd64 (1.0 unstable [amd64])
 Inst libfwibble-dev:amd64 (1.0 unstable [amd64])
 Inst libfwibble-dev:amd64 (1.0 unstable [amd64])
+Inst linux-stuff:amd64 (1.0 unstable [amd64])
 Conf amdboot:amd64 (1.0 unstable [amd64])
 Conf amdboot:amd64 (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [armel])
 Conf doxygen (1.0 unstable [armel])
 Conf libc6:amd64 (1.0 unstable [amd64])
 Conf libc6:amd64 (1.0 unstable [amd64])
@@ -217,6 +236,5 @@ Conf libc6 (1.0 unstable [armel])
 Conf libc6-dev:amd64 (1.0 unstable [amd64])
 Conf libc6-dev:amd64 (1.0 unstable [amd64])
 Conf libc6-dev (1.0 unstable [armel])
 Conf libc6-dev (1.0 unstable [armel])
 Conf libfwibble1:amd64 (1.0 unstable [amd64])
 Conf libfwibble1:amd64 (1.0 unstable [amd64])
-Conf libfwibble-dev:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64
-
-
+Conf libfwibble-dev:amd64 (1.0 unstable [amd64])
+Conf linux-stuff:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64