OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 04-Jun-2004 16:34:29
Branch: HEAD Handle: 2004060415342900
Modified files:
openpkg-src/openpkg rpm.patch.feature
Log:
add workaround for too small uname(2) structures which prevent us from
getting correct platform identifications under at least HP-UX 11.11
Summary:
Revision Changes Path
1.54 +37 -5 openpkg-src/openpkg/rpm.patch.feature
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg/rpm.patch.feature
============================================================================
$ cvs diff -u -r1.53 -r1.54 rpm.patch.feature
--- openpkg-src/openpkg/rpm.patch.feature 4 Jun 2004 13:11:06 -0000 1.53
+++ openpkg-src/openpkg/rpm.patch.feature 4 Jun 2004 14:34:29 -0000 1.54
@@ -1022,7 +1022,7 @@
+---------------------------------------------------------------------------
Index: lib/rpmrc.c
--- lib/rpmrc.c 4 Jun 2003 18:18:45 -0000 1.1.1.25
-+++ lib/rpmrc.c 22 Jan 2004 21:42:25 -0000 1.2
++++ lib/rpmrc.c 4 Jun 2004 14:10:21 -0000
@@ -27,7 +27,7 @@
const char * macrofiles = MACROFILES;
@@ -1044,7 +1044,27 @@
nplatpat++;
platpat[nplatpat] = NULL;
/[EMAIL PROTECTED]@*/
-@@ -1062,7 +1066,15 @@
+@@ -1055,14 +1059,35 @@
+ /[EMAIL PROTECTED] rpmGlobalMacroContext, fileSystem, internalState @*/
+ /[EMAIL PROTECTED] *arch, *os, rpmGlobalMacroContext, fileSystem,
internalState @*/
+ {
++#ifdef OPENPKG
++ static struct utsname un_real;
++ /* utsname fields on some platforms (like HP-UX) are very small
++ (about 8 characters). This is too small for OpenPKG, so cheat! */
++ static struct {
++ char *sysname[32];
++ char *nodename[32];
++ char *release[32];
++ char *version[32];
++ char *machine[32];
++ } un;
++#else
+ static struct utsname un;
++#endif
+ static int gotDefaults = 0;
+ char * chptr;
+ canonEntry canon;
int rc;
while (!gotDefaults) {
@@ -1060,8 +1080,20 @@
const char * s;
s = rpmExpand("%{_host_cpu}", NULL);
if (s) {
-@@ -1082,6 +1094,32 @@
+@@ -1079,9 +1104,44 @@
+ gotDefaults = 1;
+ break;
+ }
++#ifdef OPENPKG
++ rc = uname(&un_real);
++ strncpy(un.sysname, un_real.sysname, sizeof(un.sysname)); un.sysname
[sizeof(un.sysname)-1] = '\0';
++ strncpy(un.nodename, un_real.nodename, sizeof(un.nodename));
un.nodename[sizeof(un.nodename)-1] = '\0';
++ strncpy(un.release, un_real.release, sizeof(un.release)); un.release
[sizeof(un.release)-1] = '\0';
++ strncpy(un.version, un_real.version, sizeof(un.version)); un.version
[sizeof(un.version)-1] = '\0';
++ strncpy(un.machine, un_real.machine, sizeof(un.machine)); un.machine
[sizeof(un.machine)-1] = '\0';
++#else
rc = uname(&un);
++#endif
if (rc < 0) return;
+#ifdef OPENPKG
@@ -1072,7 +1104,7 @@
+ cpR = un.release;
+ if ((n = strcspn(cpR, "0123456789")) > 0)
+ cpR += n;
-+ if ((n = strspn(cpR,"0123456789.")) > 0) {
++ if ((n = strspn(cpR, "0123456789.")) > 0) {
+ /* terminate after "N.N.N...." prefix */
+ cpR[n] = '\0';
+ /* shorten to "N.N" if longer */
@@ -1093,7 +1125,7 @@
#if !defined(__linux__)
#ifdef SNI
/* USUALLY un.sysname on sinix does start with the word "SINIX"
-@@ -1298,6 +1336,7 @@
+@@ -1298,6 +1358,7 @@
}
}
# endif
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]