Bug#407187: apt: use dpkg-architecture to get host architecture
Package: apt
Version: 0.6.46.4
Tags: patch
Hi,
As part of the move to armel, dpkg was patched (which should get the
patch merged upstream RSN), and apt needed patching as well to make it
aware of the new arch. This patch solves the problem by moving that
knowledge to dpkg where it belongs. This also avoids out of sync arch
support in the future between apt and dpkg.
Just for reference, the GNU triplet for armel is arm-linux-gnueabi, so
the patterns need to match on gnu%.
regards,
guillem
--- buildlib/archtable 2006-03-02 16:26:52.000000000 +0200
+++ buildlib/archtable 1970-01-01 02:00:00.000000000 +0200
@@ -1,29 +0,0 @@
-# This file contains a table of known architecture strings, with
-# things to map them to. `configure' will take the output of the
-# autoconf cannon macros and look in here. This only deals with architecture
-# (CPU) names.
-
-# The left side is a regex for awk
-
-i.86 i386
-pentium i386
-sparc sparc
-sparc64 sparc
-alpha.* alpha
-m68k m68k
-arm.*b armeb
-arm.* arm
-powerpc powerpc
-ppc powerpc
-powerpc64 ppc64
-mipsel mipsel
-mipseb mips
-mips mips
-sheb sheb
-shel sh
-sh sh
-hppa.* hppa
-ia64 ia64
-s390 s390
-s390x s390x
-x86_64 amd64
--- buildlib/environment.mak.in 2006-03-02 15:56:30.000000000 +0200
+++ buildlib/environment.mak.in 2006-12-14 23:31:21.000000000 +0200
@@ -62,7 +62,7 @@ NEED_SOCKLEN_T_DEFINE = @NEED_SOCKLEN_T_
# Shared library things
HOST_OS = @host_os@
-ifneq ($(words $(filter linux-gnu gnu% %gnu,$(HOST_OS))),0)
+ifneq ($(words $(filter gnu% linux-gnu% kfreebsd-gnu% %-gnu,$(HOST_OS))),0)
SONAME_MAGIC=-Wl,-soname -Wl,
LFLAGS_SO=
else
--- buildlib/ostable 2006-03-02 15:46:44.000000000 +0200
+++ buildlib/ostable 1970-01-01 02:00:00.000000000 +0200
@@ -1,21 +0,0 @@
-# This file contains a table of known vendor-os strings, with
-# things to map them to. `configure' will take the output of the
-# autoconf cannon macros and look in here. This only deals with
-# OS names. The right should be a common name like the arch table
-# generates
-# The final bit to build the Debian Architecture is done in init.cc
-# The left side is a regex for awk, and the first match is used.
-
-# These are used by Debian
-[^-]*-linux-.* linux
-[^-]*-kfreebsd.*-gnu kfreebsd
-[^-]*-knetbsd.*-gnu knetbsd
-[^-]*-gnu[^-]* hurd
-
-# These are samples.
-hp-hpux[^-]* hp-ux
-sun-solaris[^-]* solaris
-[^-]*-openbsd[^-]* openbsd
-
-# Catch all
-.* unknown
--- configure.in 2006-10-30 09:51:28.000000000 +0200
+++ configure.in 2006-12-05 12:47:48.000000000 +0200
@@ -79,9 +79,9 @@ AC_SUBST(BDBLIB)
dnl Converts the ARCH to be something singular for this general CPU family
dnl This is often the dpkg architecture string.
AC_MSG_CHECKING(system architecture)
-archset="`awk \" ! /^#|^\\\$/ { if(match(\\\"$target_cpu\\\",\\\"^\\\"\\\$1\\\"\\\$\\\")) {print \\\$2; exit}}\" $srcdir/buildlib/archtable`"
+archset="`dpkg-architecture -qDEB_HOST_ARCH`"
if test "x$archset" = "x"; then
- AC_MSG_ERROR(failed: use --host= or check buildlib/archtable)
+ AC_MSG_ERROR([failed: use --host= or output from dpkg-architecture])
fi
AC_MSG_RESULT($archset)
AC_DEFINE_UNQUOTED(COMMON_CPU,"$archset")
@@ -89,7 +89,7 @@ AC_DEFINE_UNQUOTED(COMMON_CPU,"$archset"
dnl Get a common name for the host OS - this is primarily only for HURD and is
dnl non fatal if it fails
AC_MSG_CHECKING(system OS)
-osset="`awk \" ! /^#|^\\\$/ {if (match(\\\"$target_vendor-$target_os\\\",\\\$1)) {print \\\$2; exit}}\" $srcdir/buildlib/ostable`"
+osset="`dpkg-architecture -qDEB_HOST_ARCH_OS`"
AC_MSG_RESULT($osset)
AC_DEFINE_UNQUOTED(COMMON_OS,"$osset")
Reply to: