Bug#407187: apt: use dpkg-architecture to get host architecture
Hi,
Here comes the updated patch against latest apt. If you have something
fundamental against this patch, please state so, and I'll provide a
traditional archtable update for armel.
--
"rm -rf" only sounds scary if you don't have backups
diff -urN apt-0.7.2.old/buildlib/archtable apt-0.7.2/buildlib/archtable
--- apt-0.7.2.old/buildlib/archtable 2007-06-06 20:48:01.000000000 +0000
+++ apt-0.7.2/buildlib/archtable 1970-01-01 00:00:00.000000000 +0000
@@ -1,33 +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
-sh3 sh3
-sh4 sh4
-m32r m32r
-hppa.* hppa
-ia64 ia64
-s390 s390
-s390x s390x
-x86_64 amd64
-# lipa has gnulp-linux-i.86 (see dpkg archtable and ostable)
diff -urN apt-0.7.2.old/buildlib/environment.mak.in apt-0.7.2/buildlib/environment.mak.in
--- apt-0.7.2.old/buildlib/environment.mak.in 2007-06-06 21:11:51.000000000 +0000
+++ apt-0.7.2/buildlib/environment.mak.in 2007-06-30 11:37:07.000000000 +0000
@@ -64,7 +64,7 @@
# 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
diff -urN apt-0.7.2.old/buildlib/ostable apt-0.7.2/buildlib/ostable
--- apt-0.7.2.old/buildlib/ostable 2006-03-02 13:46:44.000000000 +0000
+++ apt-0.7.2/buildlib/ostable 1970-01-01 00:00:00.000000000 +0000
@@ -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
diff -urN apt-0.7.2.old/buildlib/systemtable apt-0.7.2/buildlib/systemtable
--- apt-0.7.2.old/buildlib/systemtable 2007-06-06 20:48:01.000000000 +0000
+++ apt-0.7.2/buildlib/systemtable 1970-01-01 00:00:00.000000000 +0000
@@ -1,11 +0,0 @@
-# This file contains a table of known canonical system strings, with
-# things to map them to. `configure' will take the output of the
-# autoconf cannon macros and look in here. It will check for
-# the full canonical system name (required for e.g. lpia) and if that
-# fails it will configure.in will fallback to just checking for the CPU
-# in buildlib/archtable
-
-# The left side is a regex for awk against the canonical system name
-
-# config.guess reports lpia as i386-unknown-linux-gnulp
-i.86-.*-linux-gnulp lpia
diff -urN apt-0.7.2.old/configure.in apt-0.7.2/configure.in
--- apt-0.7.2.old/configure.in 2007-06-29 01:52:17.000000000 +0000
+++ apt-0.7.2/configure.in 2007-06-30 12:22:35.000000000 +0000
@@ -81,12 +81,9 @@
dnl First check against the full canonical canoncial-system-type in $target
dnl and if that fails, just look for the cpu
AC_MSG_CHECKING(system architecture)
-archset="`awk \" ! /^#|^\\\$/ { if(match(\\\"$target\\\",\\\"^\\\"\\\$1\\\"\\\$\\\")) {print \\\$2; exit}}\" $srcdir/buildlib/systemtable`"
+archset="`dpkg-architecture -qDEB_HOST_ARCH`"
if test "x$archset" = "x"; then
- archset="`awk \" ! /^#|^\\\$/ { if(match(\\\"$target_cpu\\\",\\\"^\\\"\\\$1\\\"\\\$\\\")) {print \\\$2; exit}}\" $srcdir/buildlib/archtable`"
- if test "x$archset" = "x"; then
- AC_MSG_ERROR(failed: use --host= or check buildlib/archtable)
- fi
+ AC_MSG_ERROR([failed: use --host= or output from dpkg-architecture])
fi
AC_MSG_RESULT($archset)
AC_DEFINE_UNQUOTED(COMMON_CPU,"$archset")
@@ -94,7 +91,7 @@
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")
diff -urN apt-0.7.2.old/debian/changelog apt-0.7.2/debian/changelog
--- apt-0.7.2.old/debian/changelog 2007-06-29 01:47:39.000000000 +0000
+++ apt-0.7.2/debian/changelog 2007-06-30 12:05:36.000000000 +0000
@@ -1,3 +1,10 @@
+apt (0.7.2-0.1+armel) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Apply armel patch
+
+ -- Riku Voipio <riku.voipio@iki.fi> Sat, 30 Jun 2007 12:04:43 +0000
+
apt (0.7.2-0.1) unstable; urgency=low
* Non-maintainer upload.
Reply to: