From: ewt Date: Thu, 28 Aug 1997 18:49:01 +0000 (+0000) Subject: hpux hacks X-Git-Tag: rpm-4.4-release~3928 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=78618acbb3b55a079ceeeabc4dbd339b61d3cd4b;p=platform%2Fupstream%2Frpm.git hpux hacks CVS patchset: 1807 CVS date: 1997/08/28 18:49:01 --- diff --git a/CHANGES b/CHANGES index 08fbd29..9509f92 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,8 @@ - replaced include of with includes of - fixed md5sum of source packages w/ a buildroot is used - fixed bugs installing version 1 packages + - remove hyphens from uname() result (specifically for HP-UX) + - hacks to recognize architecture under parisc 2.4.4 -> 2.4.5: - call getpwnam()/endpwent() once before a chroot(), forcing name diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 3f414d2..7bc1926 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -660,6 +660,7 @@ static int doReadRC(int fd, char * filename) { static void defaultMachine(char ** arch, char ** os) { static struct utsname un; static int gotDefaults = 0; + char * chptr; if (!gotDefaults) { uname(&un); @@ -668,6 +669,43 @@ static void defaultMachine(char ** arch, char ** os) { } else if (!strncmp(un.sysname, "IP", 2)) { un.sysname[2] = '\0'; } + + /* get rid of the hyphens in the sysname */ + chptr = un.machine; + while (*chptr++) + if (*chptr == '/') *chptr = '-'; + + #if defined(__hpux__) && defined(_SC_CPU_VERSION) + { + int cpu_version = sysconf(_SC_CPU_VERSION); + + #if defined(CPU_HP_MC68020) + if (cpu_version == CPU_HP_MC68020) + strcpy(us.machine, "m68k"); + #endif + #if defined(CPU_HP_MC68030) + if (cpu_version == CPU_HP_MC68030) + strcpy(us.machine, "m68k"); + #endif + #if defined(CPU_HP_MC68040) + if (cpu_version == CPU_HP_MC68040) + strcpy(us.machine, "m68k"); + #endif + + #if defined(CPU_PA_RISC1_0) + if (cpu_version == CPU_PA_RISC1_0) + strcpy(us.machine, "parisc"); + #endif + #if defined(CPU_PA_RISC1_1) + if (cpu_version == CPU_PA_RISC1_1) + strcpy(us.machine, "parisc"); + #endif + #if defined(CPU_PA_RISC1_2) + if (cpu_version == CPU_PA_RISC1_2) + strcpy(us.machine, "parisc"); + #endif + } + #endif } if (arch) *arch = un.machine;