linux-mips
[Top] [All Lists]

mipseb and mipsel patches to RPM...

To: ewt@redhat.com
Subject: mipseb and mipsel patches to RPM...
From: Alex deVries <adevries@engsoc.carleton.ca>
Date: Wed, 14 Jan 1998 22:56:58 -0500 (EST)
Cc: ralf@uni-koblenz.de, SGI Linux <linux@cthulhu.engr.sgi.com>
In-reply-to: <19980115010335.21821@uni-koblenz.de>
Sender: owner-linux@cthulhu.engr.sgi.com
On Thu, 15 Jan 1998 ralf@uni-koblenz.de wrote:
> Ah, you were the volunteer :-)  Recently I fixed RPM already, so we should
> somewhen deciede who's patch is the nicer.

Erik,

        Feel free to apply either Ralf's or my patch (below my .sig).  It
supports auto-byte order detection in defaultMachine(), and patches to the
rpmrc and rpm.magic files to change the name to mipseb and mipsel.

        I've made little-endian mips 11, and renamed the existing mips to
mipseb.

- Alex

-- 
      Alex deVries          Run Linux on everything,
  System Administrator      run everything on Linux.
   The EngSoc Project       Send spam to spam@engsoc.carleton.ca.
z

diff -rc rpm-2.4.99.orig/lib/rpmrc.c rpm-2.4.99/lib/rpmrc.c
*** rpm-2.4.99.orig/lib/rpmrc.c Tue Jan 13 16:08:24 1998
--- rpm-2.4.99/lib/rpmrc.c      Wed Jan 14 19:07:28 1998
***************
*** 669,674 ****
--- 669,681 ----
      char * chptr;
      struct canonEntry * canon;
  
+ #if defined (__mips)
+     union {
+       long l;
+       char c[sizeof (long)];
+     } u;
+ #endif
+ 
      if (!gotDefaults) {
        uname(&un);
        if (!strcmp(un.sysname, "AIX")) {
***************
*** 681,686 ****
--- 688,702 ----
        chptr = un.machine;
        while (*chptr++)
            if (*chptr == '/') *chptr = '-';
+ 
+ #if defined(__mips)
+             u.l = 1;
+             if (u.c[sizeof (long) - 1] == 1) {
+                   strcpy(un.machine, "mipseb");
+             } else {
+                   strcpy(un.machine, "mipsel");
+            }
+ #endif
  
        #if defined(__hpux) && defined(_SC_CPU_VERSION)
        {
diff -rc rpm-2.4.99.orig/lib-rpmrc.in rpm-2.4.99/lib-rpmrc.in
*** rpm-2.4.99.orig/lib-rpmrc.in        Tue Jan 13 16:08:23 1998
--- rpm-2.4.99/lib-rpmrc.in     Wed Jan 14 18:41:13 1998
***************
*** 41,47 ****
  arch_canon:   sun4c:  sparc   3
  arch_canon:     sun4d:  sparc   3
  # This is really a place holder for MIPS.
! arch_canon:   mips:   mips    4
  arch_canon:   ppc:    ppc     5
  arch_canon:   m68k:   m68k    6
  arch_canon:   IP:     sgi     7
--- 41,47 ----
  arch_canon:   sun4c:  sparc   3
  arch_canon:     sun4d:  sparc   3
  # This is really a place holder for MIPS.
! arch_canon:   mipseb: mipseb  4
  arch_canon:   ppc:    ppc     5
  arch_canon:   m68k:   m68k    6
  arch_canon:   IP:     sgi     7
***************
*** 50,55 ****
--- 50,56 ----
  arch_canon:    9000/712:       hppa1.1 9
  
  arch_canon:    sun4u:   usparc  10
+ arch_canon:   mipsel: mipsel  11
  
  #############################################################
  # Canonical OS names and numbers
***************
*** 118,124 ****
  arch_compat: sparc: noarch
  
  arch_compat: ppc: noarch
! arch_compat: mips: noarch
  
  arch_compat: hppa1.1: hppa1.0
  arch_compat: hppa1.0: noarch
--- 119,126 ----
  arch_compat: sparc: noarch
  
  arch_compat: ppc: noarch
! arch_compat: mipseb: noarch
! arch_compat: mipsel: noarch
  
  arch_compat: hppa1.1: hppa1.0
  arch_compat: hppa1.0: noarch
***************
*** 137,140 ****
  buildarch_compat: alpha: noarch
  buildarch_compat: m68k: noarch
  buildarch_compat: ppc: noarch
! buildarch_compat: mips: noarch
--- 139,144 ----
  buildarch_compat: alpha: noarch
  buildarch_compat: m68k: noarch
  buildarch_compat: ppc: noarch
! buildarch_compat: mipsel: noarch
! buildarch_compat: mipseb: noarch
! 
diff -rc rpm-2.4.99.orig/rpm.magic rpm-2.4.99/rpm.magic
*** rpm-2.4.99.orig/rpm.magic   Tue Jan 13 16:08:23 1998
--- rpm-2.4.99/rpm.magic        Wed Jan 14 16:43:43 1998
***************
*** 10,17 ****
  >>8   beshort         1               i386
  >>8   beshort         2               Alpha
  >>8   beshort         3               Sparc
! >>8   beshort         4               MIPS
  >>8   beshort         5               PowerPC
  >>8   beshort         6               68000
  >>8   beshort         7               SGI
  >>10  string          x               %s
--- 10,18 ----
  >>8   beshort         1               i386
  >>8   beshort         2               Alpha
  >>8   beshort         3               Sparc
! >>8   beshort         4               MIPS big endian
  >>8   beshort         5               PowerPC
  >>8   beshort         6               68000
  >>8   beshort         7               SGI
+ >>8   beshort         11              MIPS little endian
  >>10  string          x               %s



<Prev in Thread] Current Thread [Next in Thread>