Author: guillem
Date: 2006-08-08 03:38:54 +0000 (Tue, 08 Aug 2006)
New Revision: 499

Modified:
   trunk/ChangeLog
   trunk/debian/changelog
   trunk/m4/arch.m4
   trunk/scripts/dpkg-architecture.pl
Log:
Use dpkg-architecture from the source tree to get the target Debian
architecture, instead of duplicating the logic in the m4 files.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2006-08-08 01:43:22 UTC (rev 498)
+++ trunk/ChangeLog     2006-08-08 03:38:54 UTC (rev 499)
@@ -1,3 +1,14 @@
+2006-08-08  Guillem Jover  <[EMAIL PROTECTED]>
+
+       * scripts/dpkg-architecture.pl (dpkglibdir): Set to '.' where
+       controllib.pl is located.
+       (pkgdatadir): Set to '..' where cputable and ostable are located.
+       * m4/arch.m4 (_DPKG_ARCHITECTURE): New macro.
+       (DPKG_CPU_TYPE): Use _DPKG_ARCHITECTURE instead of parsing cputable.
+       (DPKG_OS_TYPE): Use _DPKG_ARCHITECTURE instead of parsing ostable.
+       (DPKG_ARCHITECTURE): Use _DPKG_ARCHITECTURE instead of constructing
+       the value from cpu_type and os_type.
+
 2006-08-08  Ian Jackson  <[EMAIL PROTECTED]>
 
        * lib/dpkg-db.h (deptype): Add dep_breaks.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2006-08-08 01:43:22 UTC (rev 498)
+++ trunk/debian/changelog      2006-08-08 03:38:54 UTC (rev 499)
@@ -3,6 +3,8 @@
   [ Guillem Jover ]
   * Add initial support for the Breaks field, by parsing but rejecting it.
     Thanks to Ian Jackson <[EMAIL PROTECTED]>. Closes: #375703
+  * Use dpkg-architecture from the source tree to get the target Debian
+    architecture, instead of duplicating the logic in the m4 files.
 
   [ Added dpkg Translations ]
   * Dzongkha (Kinley Tshering)

Modified: trunk/m4/arch.m4
===================================================================
--- trunk/m4/arch.m4    2006-08-08 01:43:22 UTC (rev 498)
+++ trunk/m4/arch.m4    2006-08-08 03:38:54 UTC (rev 499)
@@ -1,3 +1,12 @@
+# _DPKG_ARCHITECTURE([DEB_VAR], [sh_var])
+# ---------------------------------------
+# Use dpkg-architecture from the source tree to set sh_var using DEB_VAR for
+# the target architecture, to avoid duplicating its logic.
+AC_DEFUN([_DPKG_ARCHITECTURE], [
+AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
+$2="`cd $srcdir/scripts; ./dpkg-architecture.pl -t$target -q$1 2>/dev/null`"
+])# _DPKG_ARCHITECURE
+
 # DPKG_CPU_TYPE
 # -------------
 # Parse the target cpu name and check it against the cputable to determine
@@ -4,7 +13,7 @@
 # the Debian name for it.  Sets ARCHITECTURE_CPU.
 AC_DEFUN([DPKG_CPU_TYPE],
 [AC_MSG_CHECKING([dpkg cpu type])
-[cpu_type="`awk \"! /^(#.*)?\\$/ { if (match(\\\"$target_cpu\\\", 
\\\"^\\\"\\$][3\\\"\\$\\\")) { print \\$][1; exit; } }\" $srcdir/cputable`"]
+_DPKG_ARCHITECTURE([DEB_HOST_ARCH_CPU], [cpu_type])
 if test "x$cpu_type" = "x"; then
        cpu_type=$target_cpu
        AC_MSG_RESULT([$cpu_type])
@@ -22,7 +31,7 @@
 # special cases to determine what type it is.  Sets ARCHITECTURE_OS.
 AC_DEFUN([DPKG_OS_TYPE],
 [AC_MSG_CHECKING([dpkg operating system type])
-[os_type="`awk \"! /^(#.*)?\\$/ { if (match(\\\"$target_os\\\", 
\\\"^(.*-)?\\\"\\$][3\\\"\\$\\\")) { print \\$][1; exit; } }\" 
$srcdir/ostable`"]
+_DPKG_ARCHITECTURE([DEB_HOST_ARCH_OS], [os_type])
 if test "x$os_type" = "x"; then
        os_type=$target_os
        AC_MSG_RESULT([$os_type])
@@ -42,11 +51,7 @@
 [DPKG_CPU_TYPE
 DPKG_OS_TYPE
 AC_MSG_CHECKING([dpkg architecture name])
-if test "x$os_type" = "xlinux"; then
-       dpkg_arch=$cpu_type
-else
-       dpkg_arch="$os_type-$cpu_type"
-fi
+_DPKG_ARCHITECTURE([DEB_HOST_ARCH], [dpkg_arch])
 AC_MSG_RESULT([$dpkg_arch])
 AC_DEFINE_UNQUOTED(ARCHITECTURE, "${dpkg_arch}",
        [Set this to the canonical dpkg architecture name.])

Modified: trunk/scripts/dpkg-architecture.pl
===================================================================
--- trunk/scripts/dpkg-architecture.pl  2006-08-08 01:43:22 UTC (rev 498)
+++ trunk/scripts/dpkg-architecture.pl  2006-08-08 03:38:54 UTC (rev 499)
@@ -21,14 +21,14 @@
 
 $version="1.0.0"; # This line modified by Makefile
 
-$dpkglibdir="/usr/lib/dpkg";
+$dpkglibdir = ".";
 push(@INC,$dpkglibdir);
 require 'controllib.pl';
 
 require 'dpkg-gettext.pl';
 textdomain("dpkg-dev");
 
-$pkgdatadir=".";
+$pkgdatadir = "..";
 
 sub version {
     printf _g("Debian %s version %s.\n"), $progname, $version;


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to