On Mon, Aug 30, 2004 at 01:55:34PM +0100, Scott James Remnant wrote:
> > 
> > That sounds like bug #118910.  Ok I'll start working on this.
> > 
> Yup, it's one of yours.  I'd be certainly interested in discussing the
> ideas for this and how it'll operate; will we encode the kernel name in
> the filenames or not?  Probably worth involving ftpmasters at some point
> to see how they would like to split things up.

Ok, back to #118910.  Let's get started.  The ideal solution would be to have
Cpu and System tags from which dpkg can generate the Architecture.  It's
important to note that this can be done _cleanly_ without disrupting anything
in the current scheme.  If, at a later stage, we want to change filenames etc,
we're free to do so, but it's not a prerequisite.

Fortunately, dpkg doesn't need to rely on dpkg-architecture (that would be a
crap dessign) to resolve the tags, because it already has the information
internaly.  In configure.in, os_type and target_cpu are used to match in
archtable for obtaining the architecture name.

There is, however, the problem that target_cpu and os_type are not
canonicalised.  In archtable we have a lot of redundant entries like i386,
i486, i586, etc or gnu0.2, gnu0.3.  There's some incomplete code for
canonicalisation of target_os to os_type in configure.in, so we only need to
fix this code and add a blurb for cpu.  My patch, summarised below:

  - configure.in:  Complete canonicalisation of systems and add one for cpus.
  - archtable:  Remove redundant entries, no longer needed.
  (I also added powerpc64 in both while at it.)

These changes will make it easier to maintain support for future systems or
cpus, too.

-- 
 .''`.   Proudly running Debian GNU/kFreeBSD unstable/unreleased (on UFS2+S)
: :' :
`. `'    http://www.debian.org/ports/kfreebsd-gnu
  `-
diff -ur dpkg-1.10.23.old/archtable dpkg-1.10.23/archtable
--- dpkg-1.10.23.old/archtable  2004-07-19 20:56:49.000000000 +0200
+++ dpkg-1.10.23/archtable      2004-09-02 19:50:03.000000000 +0200
@@ -7,60 +7,29 @@
 # returned by `dpkg --print-installation-architecture'.
 # Column 3 is returned by `dpkg --print-architecture'.
 
-i386-linux-gnu                 i386            i486
-i486-linux-gnu                 i386            i486
-i586-linux-gnu                 i386            i486
-i686-linux-gnu                 i386            i486
-pentium-linux-gnu              i386            i486
-sparc-linux-gnu                        sparc           sparc
-sparc64-linux-gnu              sparc           sparc
-alpha-linux-gnu                        alpha           alpha
-alphaev4-linux-gnu             alpha           alpha
-alphaev5-linux-gnu             alpha           alpha
-alphaev56-linux-gnu            alpha           alpha
-alphapca56-linux-gnu           alpha           alpha
-alphaev6-linux-gnu             alpha           alpha
-alphaev67-linux-gnu            alpha           alpha
-alphaev68-linux-gnu            alpha           alpha
-m68k-linux-gnu                 m68k            m68k
-arm-linux-gnu                  arm             arm
-armv3l-linux-gnu               arm             arm
-armv4l-linux-gnu               arm             arm
-ppc-linux-gnu                  powerpc         powerpc
-powerpc-linux-gnu              powerpc         powerpc
-powerpc                                powerpc         powerpc
-mips-linux-gnu                 mips            mips
-mipsel-linux-gnu               mipsel          mipsel
-mipseb-linux-gnu               mips            mips
+i386-linux                     i386            i486
+sparc-linux                    sparc           sparc
+alpha-linux                    alpha           alpha
+m68k-linux                     m68k            m68k
+arm-linux                      arm             arm
+powerpc-linux                  powerpc         powerpc
+powerpc64-linux                        powerpc64       powerpc64
+mipseb-linux                   mips            mips
+mipsel-linux                   mipsel          mipsel
 i386-gnu                       hurd-i386       undefined
-i386-gnu0.2                    hurd-i386       undefined
-i386-gnu0.3                    hurd-i386       undefined
-i486-gnu0.3                    hurd-i386       undefined
-i586-gnu0.3                    hurd-i386       undefined
-i686-gnu0.3                    hurd-i386       undefined
-ia64-linux-gnu                 ia64            ia64
-ia64-unknown-linux             ia64            ia64
-ia64-unknown-linux-gnu         ia64            ia64
-x86_64-linux-gnu               amd64           x86_64
-sh3-linux-gnu                  sh3             sh3
-sh4-linux-gnu                  sh4             sh4
-sh3eb-linux-gnu                        sh3eb           sh3eb
-sh4eb-linux-gnu                        sh4eb           sh4eb
-hppa-linux-gnu                 hppa            hppa
-hppa1.1-linux-gnu              hppa            hppa
-hppa2.0-linux-gnu              hppa            hppa
-hppa64-linux-gnu               hppa            hppa
+ia64-linux                     ia64            ia64
+x86_64-linux                   amd64           x86_64
+sh3-linux                      sh3             sh3
+sh4-linux                      sh4             sh4
+sh3eb-linux                    sh3eb           sh3eb
+sh4eb-linux                    sh4eb           sh4eb
+hppa-linux                     hppa            hppa
 i386-freebsd                   freebsd-i386    freebsd-i386
 i386-kfreebsd-gnu              kfreebsd-i386   kfreebsd-i386
 i386-netbsdelf-gnu             netbsd-i386     netbsd-i386
 i386-knetbsd-gnu               knetbsd-i386    knetbsd-i386
-s390-linux-gnu                 s390            s390
-s390-ibm-linux-gnu             s390            s390
-s390-unknown-linux-gnu         s390            s390
+s390-linux                     s390            s390
 i386-openbsd                   openbsd-i386    openbsd-i386
-i386-unknown-openbsd           openbsd-i386    openbsd-i386
 powerpc-darwin                 darwin-powerpc  darwin-powerpc
 i386-darwin                    darwin-i386     darwin-i386
-s390x-linux-gnu                        s390x           s390x
-s390x-ibm-linux-gnu            s390x           s390x
-s390x-unknown-linux-gnu                s390x           s390x
+s390x-linux                    s390x           s390x
diff -ur dpkg-1.10.23.old/configure.in dpkg-1.10.23/configure.in
--- dpkg-1.10.23.old/configure.in       2004-07-19 20:58:18.000000000 +0200
+++ dpkg-1.10.23/configure.in   2004-09-02 19:53:33.000000000 +0200
@@ -93,42 +93,79 @@
 
 AC_PREFIX_DEFAULT(/usr)
 
-# OpenBSD has decided to be odd and includ a version number
-# in the final field of the GNU system type.
-# This code strips it out in a generic way.
+# This code strips cpu_type and os_type out in a generic way.
 os_type=''
+cpu_type=''
 AC_MSG_CHECKING(Operating system type)
+case $target_cpu in 
+        alpha*)
+          cpu_type="alpha";;
+        arm*)
+          cpu_type="arm";;
+        hppa*)
+          cpu_type="hppa";;
+        ia64)
+          cpu_type="ia64";;
+        i386|i486|i586|i686|pentium)
+          cpu_type="i386";;
+        sparc|sparc64)
+          cpu_type="sparc";;
+        m68k)
+          cpu_type="m68k";;
+        mips|mipseb)
+          cpu_type="mipseb";;
+        mipsel)
+          cpu_type="mipsel";;
+        powerpc|ppc)
+          cpu_type="powerpc";;
+        powerpc64)
+          cpu_type="powerpc64";;
+        s390)
+          cpu_type="s390";;
+        s390x)
+          cpu_type="s390x";;
+        sh3)
+          cpu_type="sh3";;
+        sh3eb)
+          cpu_type="sh3eb";;
+        sh4)
+          cpu_type="sh4";;
+        sh4eb)
+          cpu_type="sh4eb";;
+        x86_64)
+          cpu_type="x86_64";;
+esac
 case $target_os in 
-        *linux-gnu* )
-          os_type="linux-gnu";;
-        *linux* )
-          os_type="linux-gnu";;
-        *openbsd* )
+        linux*-gnu* )
+          os_type="linux";;
+        openbsd* )
           os_type="openbsd";;
-        *knetbsd*-gnu* )
+        knetbsd*-gnu )
           os_type="knetbsd-gnu";;
-        *netbsd* )
+        netbsd* )
           os_type="netbsd";;
-        *kfreebsd*-gnu* )
+        kfreebsd*-gnu )
           os_type="kfreebsd-gnu";;
-        *freebsd* )
+        freebsd* )
           os_type="freebsd";;
-        gnu )
-          os_type="hurd";;
+        gnu* )
+          os_type="gnu";;
 esac
+if test "x$cpu_type" = "x"; then
+ cpu_type=$target_cpu
+fi
 if test "x$os_type" = "x"; then
- os_type=$target_os 
+ os_type=$target_os
 fi
-AC_MSG_RESULT([$os_type])
-AC_SUBST(os_type)
+AC_MSG_RESULT([$cpu_type-$os_type])
 
 dpkg_archset=''
 AC_MSG_CHECKING(Debian architecture)
-dpkg_archset="`awk '$1 == "'$target_cpu-$os_type'" { print $2 }' 
$srcdir/archtable`"
+dpkg_archset="`awk '$1 == "'$cpu_type-$os_type'" { print $2 }' 
$srcdir/archtable`"
 # Finish off
 if test "x$dpkg_archset" = "x"; then
- AC_MSG_RESULT([$target_cpu-$os_type, but not found in archtable])
- dpkg_archset=$target_cpu-$os_type
+ AC_MSG_RESULT([$cpu_type-$os_type, but not found in archtable])
+ dpkg_archset=$cpu_type-$os_type
  else
  AC_MSG_RESULT($dpkg_archset)
 fi

Reply via email to