Bug#309603: dpkg-architecture thinks Linux is the Hurd
Package: dpkg-dev
Version: 1.13.4
Severity: important
Tags: experimental, patch
We had some fun with dpkg-architecture in Ubuntu this morning ...
09:12 * \sh checks why breezy morphes into hurd
09:12 < \sh> -rw-r--r-- 1 shermann shermann 2688 May 18 08:08 libqssl-dev_2.0-1ubuntu1_hurd-i386.deb
09:12 < \sh> -rw-r--r-- 1 shermann shermann 2154 May 18 08:08 libqssl2_2.0-1ubuntu1_hurd-i386.deb
09:31 < Kamion> \sh: try 'dpkg-architecture -qDEB_HOST_ARCH'?
09:31 < \sh> hmm
09:31 < \sh> hurd-i386 *g*
Turns out that dpkg-architecture iterates through cputable and ostable
in whatever order the regexes happen to come out of the %cputable_re and
%ostable_re hashes. In practice the first one is always /gnu[^-]*/, and
since the first gcc-4.0 upload to Ubuntu after we synced dpkg_1.13.4
picked up the change to DEB_HOST_GNU_TYPE and started to spit out
*-linux-gnu in 'gcc -dumpmachine', /gnu[^-]*/ always matches on Linux.
I fixed this using the following patch (I can't seem to get to your arch
archive right now):
diff -Nru /tmp/v5aZgEH5oq/dpkg-1.13.4/debian/changelog /tmp/N2URRIKZ1E/dpkg-1.13.4ubuntu1/debian/changelog
--- /tmp/v5aZgEH5oq/dpkg-1.13.4/debian/changelog 2005-03-29 13:36:52.000000000 +0100
+++ /tmp/N2URRIKZ1E/dpkg-1.13.4ubuntu1/debian/changelog 2005-05-18 10:08:38.000000000 +0100
@@ -1,3 +1,11 @@
+dpkg (1.13.4ubuntu1) breezy; urgency=high
+
+ * dpkg-architecture iterates through cputable and ostable config.guess
+ regexes in the order in which they appear in the file, to avoid matching
+ the Hurd on Linux.
+
+ -- Colin Watson <cjwatson@ubuntu.com> Wed, 18 May 2005 10:08:36 +0100
+
dpkg (1.13.4) experimental; urgency=low
The "Or the Wabbit gets it" Release
diff -Nru /tmp/v5aZgEH5oq/dpkg-1.13.4/scripts/dpkg-architecture.pl /tmp/N2URRIKZ1E/dpkg-1.13.4ubuntu1/scripts/dpkg-architecture.pl
--- /tmp/v5aZgEH5oq/dpkg-1.13.4/scripts/dpkg-architecture.pl 2005-03-29 13:29:32.000000000 +0100
+++ /tmp/N2URRIKZ1E/dpkg-1.13.4ubuntu1/scripts/dpkg-architecture.pl 2005-05-18 10:06:33.000000000 +0100
@@ -109,14 +109,14 @@
local ($a);
local ($gnu_cpu, $gnu_os) = &split_gnu($gnu);
- foreach $a (keys %cputable_re) {
+ foreach $a (@cpu) {
if ($gnu_cpu =~ /^$cputable_re{$a}$/) {
$cpu = $a;
last;
}
}
- foreach $a (keys %ostable_re) {
+ foreach $a (@os) {
if ($gnu_os =~ /^(.*-)?$ostable_re{$a}$/) {
$os = $a;
last;
cputable probably didn't need to be changed since it's fully anchored,
unlike ostable which is only partially anchored, but I did it anyway for
symmetry.
However, you should probably also reorder ostable so that the least
specific regexes are last, otherwise this will cause dpkg-architecture
to think that both KFreeBSD and KNetBSD are the Hurd. Moving hurd after
kfreebsd and knetbsd would be sufficient.
Cheers,
--
Colin Watson [cjwatson@debian.org]
Reply to: