From 5f20ac7f11ae5718595d6e570474d120d30e36db Mon Sep 17 00:00:00 2001
From: David Kalnischkies <kalnischkies@gmail.com>
Date: Thu, 12 Jul 2012 20:39:59 +0200
Subject: * apt-pkg/cachefilter.cc:   - remove architecture-specific arch to
 tuple expansion-rules as they lead     to the same tuples for different
 architectures (e.g. linux-arm for arm,     armel and armhf) while the
 dpkg-architecture code uses triples which     are different (in the first
 part, which we omit in our tuples), so e.g.     build-dep restrictions for
 armel ended up effecting armhf as well

---
 apt-pkg/cachefilter.cc                                    |  6 ------
 debian/changelog                                          |  6 ++++++
 test/integration/test-architecture-specification-parsing  | 15 ++++++++++++++-
 .../test-bug-632221-cross-dependency-satisfaction         |  2 +-
 .../test-cachecontainer-architecture-specification        |  3 +++
 5 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/apt-pkg/cachefilter.cc b/apt-pkg/cachefilter.cc
index 35f95fe22..58cc812bf 100644
--- a/apt-pkg/cachefilter.cc
+++ b/apt-pkg/cachefilter.cc
@@ -66,12 +66,6 @@ static std::string CompleteArch(std::string const &arch) {
 		complete = complete.substr(1, complete.size()-2);
 		return complete;
 	}
-	else if (arch == "armel")		return "linux-arm";
-	else if (arch == "armhf")		return "linux-arm";
-	else if (arch == "lpia")		return "linux-i386";
-	else if (arch == "powerpcspe")		return "linux-powerpc";
-	else if (arch == "uclibc-linux-armel")	return "linux-arm";
-	else if (arch == "uclinux-armel")	return "uclinux-arm";
 	else if (arch == "any")			return "*-*";
 	else					return "linux-" + arch;
 }
diff --git a/debian/changelog b/debian/changelog
index 634b37253..54f96909c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -28,6 +28,12 @@ apt (0.9.7.2) UNRELEASED; urgency=low
   * apt-pkg/deb/deblistparser.cc:
     - negative dependencies need to apply to all architectures,
       but those with a specific architecture only apply to this one
+  * apt-pkg/cachefilter.cc:
+    - remove architecture-specific arch to tuple expansion-rules as they lead
+      to the same tuples for different architectures (e.g. linux-arm for arm,
+      armel and armhf) while the dpkg-architecture code uses triples which
+      are different (in the first part, which we omit in our tuples), so e.g.
+      build-dep restrictions for armel ended up effecting armhf as well
 
  -- David Kalnischkies <kalnischkies@gmail.com>  Sun, 01 Jul 2012 08:20:57 +0200
 
diff --git a/test/integration/test-architecture-specification-parsing b/test/integration/test-architecture-specification-parsing
index 8f365dd55..2741509a7 100755
--- a/test/integration/test-architecture-specification-parsing
+++ b/test/integration/test-architecture-specification-parsing
@@ -4,7 +4,7 @@ set -e
 TESTDIR=$(readlink -f $(dirname $0))
 . $TESTDIR/framework
 setupenvironment
-configarchitecture 'amd64'
+configarchitecture 'amd64' 'armel'
 
 buildsimplenativepackage 'pkg-arch-foo' 'amd64' '1.0' 'stable' 'Build-Depends: foo [amd64 !amd64]
 Depends: foo [amd64 !amd64]'
@@ -14,6 +14,8 @@ buildsimplenativepackage 'pkg-arch-foo-unrelated-no' 'amd64' '1.0' 'stable' 'Bui
 Depends: foo [!kfreebsd-any amd64]'
 buildsimplenativepackage 'pkg-arch-foo-unrelated-no2' 'amd64' '1.0' 'stable' 'Build-Depends: foo [amd64 !kfreebsd-any]
 Depends: foo [amd64 !kfreebsd-any]'
+buildsimplenativepackage 'no-depends' 'armel' '1.0' 'stable' 'Build-Depends: foo [armhf], bar [arm]
+Depends: foo [armhf], bar [arm]'
 
 buildsimplenativepackage 'foo' 'amd64' '1.0' 'stable'
 
@@ -93,4 +95,15 @@ The following NEW packages will be installed:
 Inst foo (1.0 stable [amd64])
 Conf foo (1.0 stable [amd64])' aptget build-dep pkg-arch-foo-unrelated-no2 -s
 
+testequal 'Reading package lists...
+Building dependency tree...
+0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget build-dep no-depends -s
 
+# this is not really testing APT - more that dpkg is in line with us
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+  no-depends:armel
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst no-depends:armel (1.0 stable [armel])
+Conf no-depends:armel (1.0 stable [armel])' aptget install no-depends -s
diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction
index 208c613a2..7e8a43a86 100755
--- a/test/integration/test-bug-632221-cross-dependency-satisfaction
+++ b/test/integration/test-bug-632221-cross-dependency-satisfaction
@@ -21,7 +21,7 @@ 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, arm-stuff [any-arm] | linux-stuff [ linux-any]'
+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-armel] | linux-stuff [ linux-any]'
 
 insertsource 'unstable' 'forbidden-none' 'any' '1' 'Build-Depends: amdboot:any'
 insertsource 'unstable' 'forbidden-same' 'any' '1' 'Build-Depends: libc6:any'
diff --git a/test/integration/test-cachecontainer-architecture-specification b/test/integration/test-cachecontainer-architecture-specification
index 174efb087..55e464a07 100755
--- a/test/integration/test-cachecontainer-architecture-specification
+++ b/test/integration/test-cachecontainer-architecture-specification
@@ -27,6 +27,9 @@ Inst libsame:armel (1 unstable [armel])
 Conf libsame:armel (1 unstable [armel])' aptget -s install libsame:armel
 testequal 'Reading package lists...
 Building dependency tree...
+E: Unable to locate package libsame' aptget -s install libsame:armhf
+testequal 'Reading package lists...
+Building dependency tree...
 The following NEW packages will be installed:
   libsame
 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
-- 
cgit v1.2.3