1.1 --- a/openpkg/rpm.patch.bugfix Tue Jul 31 12:27:54 2012 +0200 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,369 +0,0 @@ 1.4 -## 1.5 -## rpm.patch.bugfix -- Annotated OpenPKG RPM Patch file 1.6 -## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/> 1.7 -## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/> 1.8 -## 1.9 -## This file assembles changes to existing RPM source files between 1.10 -## the original RedHat RPM and the OpenPKG RPM variant. It can be 1.11 -## automatically applied to a vanilla RedHat RPM source tree with the 1.12 -## 'patch' tool to upgrade those files. Each patch snippet is annotated 1.13 -## with a short description. 1.14 -## 1.15 -## Created on: 13-Sep-2006 1.16 -## 1.17 -## ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG 1.18 -## RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE. 1.19 -## 1.20 - 1.21 -+--------------------------------------------------------------------------- 1.22 -| %setup and %patch macros are treated very special internally, but 1.23 -| make sure they at least optically can be used like any other macro 1.24 -| and especially can have leading whitespaces. 1.25 -+--------------------------------------------------------------------------- 1.26 -Index: build/parsePrep.c 1.27 ---- build/parsePrep.c 7 Aug 2002 14:20:45 -0000 1.1.1.10 1.28 -+++ build/parsePrep.c 6 Jun 2005 15:53:04 -0000 1.4 1.29 -@@ -584,12 +584,15 @@ 1.30 - saveLines = splitString(getStringBuf(sb), strlen(getStringBuf(sb)), '\n'); 1.31 - /*@-usereleased@*/ 1.32 - for (lines = saveLines; *lines; lines++) { 1.33 -+ char *cp; 1.34 -+ for (cp = *lines; *cp == ' ' || *cp == '\t'; cp++) 1.35 -+ ; 1.36 - res = 0; 1.37 - /*@-boundsread@*/ 1.38 -- if (! strncmp(*lines, "%setup", sizeof("%setup")-1)) { 1.39 -- res = doSetupMacro(spec, *lines); 1.40 -- } else if (! strncmp(*lines, "%patch", sizeof("%patch")-1)) { 1.41 -- res = doPatchMacro(spec, *lines); 1.42 -+ if (! strncmp(cp, "%setup", sizeof("%setup")-1)) { 1.43 -+ res = doSetupMacro(spec, cp); 1.44 -+ } else if (! strncmp(cp, "%patch", sizeof("%patch")-1)) { 1.45 -+ res = doPatchMacro(spec, cp); 1.46 - } else { 1.47 - appendLineStringBuf(spec->prep, *lines); 1.48 - } 1.49 - 1.50 -+--------------------------------------------------------------------------- 1.51 -| Do not pick of the vendor BeeCrypt package on RedHat Linux. 1.52 -+--------------------------------------------------------------------------- 1.53 -Index: configure.ac 1.54 ---- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4 1.55 -+++ configure.ac 13 Sep 2006 13:38:23 -0000 1.56 -@@ -416,7 +416,7 @@ 1.57 - AC_CHECK_HEADER([beecrypt/beecrypt.h], [ 1.58 - AC_CHECK_LIB(beecrypt, mpfprintln, [ 1.59 - AC_DEFINE(HAVE_LIBBEECRYPT, 1, [Define to 1 if you have the `beecrypt' library (-lbeecrypt).]) 1.60 -- WITH_BEECRYPT_INCLUDE="-I/usr/include/beecrypt" 1.61 -+ WITH_BEECRYPT_INCLUDE="" 1.62 - WITH_BEECRYPT_LIB="-lbeecrypt" 1.63 - ]) 1.64 - ], [ 1.65 - 1.66 -+--------------------------------------------------------------------------- 1.67 -| Remove access to not-existing beecrypt/ subdirectory 1.68 -| to avoid the configure script to break building. 1.69 -+--------------------------------------------------------------------------- 1.70 -Index: configure.ac 1.71 ---- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4 1.72 -+++ configure.ac 13 Sep 2006 13:38:26 -0000 1.73 -@@ -1274,7 +1274,6 @@ 1.74 - python/rpmdb/Makefile 1.75 - python/test/Makefile 1.76 - ], [ echo timestamp > popt/stamp-h.in 1.77 -- echo timestamp > beecrypt/stamp-h.in 1.78 - echo timestamp > stamp-h.in 1.79 - ] 1.80 - ) 1.81 - 1.82 -+--------------------------------------------------------------------------- 1.83 -| Fix filedescriptor leakage. 1.84 -+--------------------------------------------------------------------------- 1.85 -Index: lib/psm.c 1.86 ---- lib/psm.c 5 Jun 2003 12:43:18 -0000 1.1.1.6 1.87 -+++ lib/psm.c 13 Sep 2006 13:38:27 -0000 1.88 -@@ -940,6 +940,8 @@ 1.89 - if (sfdno > STDERR_FILENO) { 1.90 - xx = Fclose (scriptFd); 1.91 - } 1.92 -+ } else { 1.93 -+ xx = Fclose(out); 1.94 - } 1.95 - 1.96 - { const char *ipath = rpmExpand("PATH=%{_install_script_path}", NULL); 1.97 - 1.98 -+--------------------------------------------------------------------------- 1.99 -| Fix trigger argument passing. For more details see RPM BugDB under: 1.100 -| http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=100509 1.101 -+--------------------------------------------------------------------------- 1.102 -Index: lib/psm.c 1.103 ---- lib/psm.c 5 Jun 2003 12:43:18 -0000 1.1.1.6 1.104 -+++ lib/psm.c 13 Sep 2006 13:38:29 -0000 1.105 -@@ -1108,11 +1108,13 @@ 1.106 - const char ** triggerProgs; 1.107 - int_32 * triggerIndices; 1.108 - const char * sourceName; 1.109 -+ const char * triggerName; 1.110 - rpmRC rc = RPMRC_OK; 1.111 - int xx; 1.112 - int i; 1.113 - 1.114 - xx = headerNVR(sourceH, &sourceName, NULL, NULL); 1.115 -+ xx = headerNVR(triggeredH, &triggerName, NULL, NULL); 1.116 - 1.117 - trigger = rpmdsInit(rpmdsNew(triggeredH, RPMTAG_TRIGGERNAME, scareMem)); 1.118 - if (trigger == NULL) 1.119 -@@ -1151,7 +1153,7 @@ 1.120 - { int arg1; 1.121 - int index; 1.122 - 1.123 -- arg1 = rpmdbCountPackages(rpmtsGetRdb(ts), Name); 1.124 -+ arg1 = rpmdbCountPackages(rpmtsGetRdb(ts), triggerName); 1.125 - if (arg1 < 0) { 1.126 - /* XXX W2DO? fails as "execution of script failed" */ 1.127 - rc = RPMRC_FAIL; 1.128 - 1.129 -+--------------------------------------------------------------------------- 1.130 -| Make sure RPM does not try to set file owner/group on files during 1.131 -| installation of _source_ RPMs. Instead, let it use the current 1.132 -| run-time owner/group, because most of the time the owner/group in 1.133 -| the source RPM (which is the owner/group of the files as staying on 1.134 -| the package author system) is not existing on the target system, of 1.135 -| course. 1.136 -+--------------------------------------------------------------------------- 1.137 -Index: lib/psm.c 1.138 ---- lib/psm.c 5 Jun 2003 12:43:18 -0000 1.1.1.6 1.139 -+++ lib/psm.c 13 Sep 2006 13:38:32 -0000 1.140 -@@ -1714,6 +1714,7 @@ 1.141 - 1.142 - uid = fi->uid; 1.143 - gid = fi->gid; 1.144 -+ if (!headerIsEntry(fi->h, RPMTAG_SOURCEPACKAGE)) { 1.145 - if (fi->fuser && unameToUid(fi->fuser[i], &uid)) { 1.146 - rpmMessage(RPMMESS_WARNING, 1.147 - _("user %s does not exist - using root\n"), 1.148 -@@ -1731,6 +1732,7 @@ 1.149 - /* XXX this diddles header memory. */ 1.150 - fi->fmodes[i] &= ~S_ISGID; /* turn off the sgid bit */ 1.151 - } 1.152 -+ } 1.153 - if (fi->fuids) fi->fuids[i] = uid; 1.154 - if (fi->fgids) fi->fgids[i] = gid; 1.155 - } 1.156 - 1.157 -+--------------------------------------------------------------------------- 1.158 -| Fix --justdb operation by consistently use the same rootDir checks 1.159 -| RPM uses everywhere else, too. 1.160 -+--------------------------------------------------------------------------- 1.161 -Index: lib/psm.c 1.162 ---- lib/psm.c 5 Jun 2003 12:43:18 -0000 1.1.1.6 1.163 -+++ lib/psm.c 13 Sep 2006 13:38:33 -0000 1.164 -@@ -2033,7 +2033,8 @@ 1.165 - case PSM_CHROOT_IN: 1.166 - { const char * rootDir = rpmtsRootDir(ts); 1.167 - /* Change root directory if requested and not already done. */ 1.168 -- if (rootDir != NULL && !rpmtsChrootDone(ts) && !psm->chrootDone) { 1.169 -+ if (rootDir != NULL && !(rootDir[0] == '/' && rootDir[1] == '\0') 1.170 -+ && !rpmtsChrootDone(ts) && !psm->chrootDone) { 1.171 - static int _loaded = 0; 1.172 - 1.173 - /* 1.174 - 1.175 -+--------------------------------------------------------------------------- 1.176 -| First, remove incorrectly introduced buffer assignment. Second, fix 1.177 -| second and subsequent "%{foo -x}" constructs for non-Linux systems 1.178 -| (without resetting the option index only the first construct would 1.179 -| work). Third, bugfix the handling of macros inside macro arguments 1.180 -| as in "%{foo bar%{quux}baz}": RPM correctly determined the pointer 1.181 -| to the terminating second closing brace, but instead of passing 1.182 -| this pointer to the subroutine which handles the macro argument 1.183 -| construction, it passed the underlying character. This in turn 1.184 -| obviously leaded to an incorrect determination of the argument end 1.185 -| (it then though the first closing brace is the end). We fix this by 1.186 -| passing the pointer and not the underlying character. 1.187 -+--------------------------------------------------------------------------- 1.188 -Index: rpmio/macro.c 1.189 ---- rpmio/macro.c 15 May 2003 13:42:01 -0000 1.1.1.7 1.190 -+++ rpmio/macro.c 22 Jan 2004 21:42:32 -0000 1.2 1.191 -@@ -879,7 +879,7 @@ 1.192 - */ 1.193 - /*@-bounds@*/ 1.194 - /*@dependent@*/ static const char * 1.195 --grabArgs(MacroBuf mb, const MacroEntry me, /*@returned@*/ const char * se, char lastc) 1.196 -+grabArgs(MacroBuf mb, const MacroEntry me, /*@returned@*/ const char * se, char *lastc) 1.197 - /*@globals rpmGlobalMacroContext @*/ 1.198 - /*@modifies mb, rpmGlobalMacroContext @*/ 1.199 - { 1.200 -@@ -900,7 +900,7 @@ 1.201 - 1.202 - /* Copy args into buf until lastc */ 1.203 - *be++ = ' '; 1.204 -- while ((c = *se++) != '\0' && c != lastc) { 1.205 -+ while ((c = *se++) != '\0' && (se-1) != lastc) { 1.206 - /*@-globs@*/ 1.207 - if (!isblank(c)) { 1.208 - *be++ = c; 1.209 -@@ -968,6 +968,8 @@ 1.210 - /*@-mods@*/ 1.211 - optind = 0; /* XXX but posix != glibc */ 1.212 - /*@=mods@*/ 1.213 -+#else 1.214 -+ optind = 1; 1.215 - #endif 1.216 - 1.217 - opts = me->opts; 1.218 -@@ -1168,7 +1170,7 @@ 1.219 - int c; 1.220 - int rc = 0; 1.221 - int negate; 1.222 -- char grab; 1.223 -+ char *grab; 1.224 - int chkexist; 1.225 - 1.226 - if (++mb->depth > max_macro_depth) { 1.227 -@@ -1202,7 +1204,7 @@ 1.228 - if (mb->depth > 1) /* XXX full expansion for outermost level */ 1.229 - t = mb->t; /* save expansion pointer for printExpand */ 1.230 - negate = 0; 1.231 -- grab = '\0'; 1.232 -+ grab = NULL; 1.233 - chkexist = 0; 1.234 - switch ((c = *s)) { 1.235 - default: /* %name substitution */ 1.236 -@@ -1237,7 +1239,8 @@ 1.237 - /* For "%name " macros ... */ 1.238 - /*@-globs@*/ 1.239 - if ((c = *fe) && isblank(c)) 1.240 -- grab = '\n'; 1.241 -+ if ((grab = strchr(fe,'\n')) == NULL) 1.242 -+ grab = strchr(fe, '\0'); 1.243 - /*@=globs@*/ 1.244 - /*@switchbreak@*/ break; 1.245 - case '(': /* %(...) shell escape */ 1.246 -@@ -1284,7 +1287,7 @@ 1.247 - ge = se - 1; 1.248 - /*@innerbreak@*/ break; 1.249 - case ' ': 1.250 -- grab = se[-1]; 1.251 -+ grab = se-1; 1.252 - /*@innerbreak@*/ break; 1.253 - default: 1.254 - /*@innerbreak@*/ break; 1.255 -@@ -1438,7 +1441,7 @@ 1.256 - 1.257 - /* Setup args for "%name " macros with opts */ 1.258 - if (me && me->opts != NULL) { 1.259 -- if (grab != '\0') { 1.260 -+ if (grab != NULL) { 1.261 - se = grabArgs(mb, me, fe, grab); 1.262 - } else { 1.263 - addMacro(mb->mc, "**", NULL, "", mb->depth); 1.264 - 1.265 -+--------------------------------------------------------------------------- 1.266 -| Backported RPM vendor patch: 1.267 -| "fix: packages w/o file colors segfault" 1.268 -| (cvs diff -r2.41.2.6 -r2.41.2.7 lib/rpmfi.c) 1.269 -+--------------------------------------------------------------------------- 1.270 -Index: lib/rpmfi.c 1.271 ---- lib/rpmfi.c 17 Jul 2003 22:44:28 -0000 1.1.1.3 1.272 -+++ lib/rpmfi.c 22 Jan 2004 21:42:24 -0000 1.2 1.273 -@@ -866,6 +866,7 @@ 1.274 - *fn = '\0'; 1.275 - fnlen = stpcpy( stpcpy(fn, dirNames[dirIndexes[i]]), baseNames[i]) - fn; 1.276 - 1.277 -+if (fColors != NULL) 1.278 - dColors[dirIndexes[i]] |= fColors[i]; 1.279 - /* 1.280 - * See if this file path needs relocating. 1.281 - 1.282 -+--------------------------------------------------------------------------- 1.283 -| The "%_excludedocs" macro is intended to set the _default_ if 1.284 -| both --excludedocs and --includedocs are not specified and it is 1.285 -| evaluated already before. So, do not override it here again, because 1.286 -| it would not allow us to make "%_excludedocs 1" the default. 1.287 -+--------------------------------------------------------------------------- 1.288 -Index: lib/transaction.c 1.289 ---- lib/transaction.c 15 Jul 2003 15:15:47 -0000 1.1.1.15 1.290 -+++ lib/transaction.c 22 Jan 2004 21:42:26 -0000 1.2 1.291 -@@ -702,8 +702,10 @@ 1.292 - int dc; 1.293 - int i, j; 1.294 - 1.295 -+#if 0 1.296 - if (!noDocs) 1.297 - noDocs = rpmExpandNumeric("%{_excludedocs}"); 1.298 -+#endif 1.299 - 1.300 - { const char *tmpPath = rpmExpand("%{_netsharedpath}", NULL); 1.301 - /*@-branchstate@*/ 1.302 - 1.303 -+--------------------------------------------------------------------------- 1.304 -| Bugfix: POSIX/SUSv3 clearly expresses that fcntl(2) returns "value 1.305 -| other than -1" on success, so check for equality to -1 instead of 1.306 -| non-equality to 0. In practice this does not harm on most platforms, 1.307 -| because they fortunately (by conincidence and common practice) 1.308 -| return 0. 1.309 -| Additionally, at least Solaris may reject (see fcntl(2) manpage) the 1.310 -| (partial) locking, because DB mmap(2)'ed the file (or vice versa). 1.311 -| The workaround is to lock the entire(!) file. 1.312 -+--------------------------------------------------------------------------- 1.313 -Index: db/mutex/mut_fcntl.c 1.314 ---- db/mutex/mut_fcntl.c 18 Jan 2003 14:05:03 -0000 1.1.1.5 1.315 -+++ db/mutex/mut_fcntl.c 22 Jan 2004 21:42:18 -0000 1.2 1.316 -@@ -84,8 +84,13 @@ 1.317 - 1.318 - /* Initialize the lock. */ 1.319 - k_lock.l_whence = SEEK_SET; 1.320 -+#if 0 1.321 - k_lock.l_start = mutexp->off; 1.322 - k_lock.l_len = 1; 1.323 -+#else 1.324 -+ k_lock.l_start = 0; 1.325 -+ k_lock.l_len = 0; 1.326 -+#endif 1.327 - 1.328 - for (locked = waited = 0;;) { 1.329 - /* 1.330 -@@ -101,7 +106,7 @@ 1.331 - 1.332 - /* Acquire an exclusive kernel lock. */ 1.333 - k_lock.l_type = F_WRLCK; 1.334 -- if (fcntl(dbenv->lockfhp->fd, F_SETLKW, &k_lock)) 1.335 -+ if (fcntl(dbenv->lockfhp->fd, F_SETLKW, &k_lock) == -1) 1.336 - return (__os_get_errno()); 1.337 - 1.338 - /* If the resource is still available, it's ours. */ 1.339 -@@ -112,7 +117,7 @@ 1.340 - 1.341 - /* Release the kernel lock. */ 1.342 - k_lock.l_type = F_UNLCK; 1.343 -- if (fcntl(dbenv->lockfhp->fd, F_SETLK, &k_lock)) 1.344 -+ if (fcntl(dbenv->lockfhp->fd, F_SETLK, &k_lock) == -1) 1.345 - return (__os_get_errno()); 1.346 - 1.347 - /* 1.348 - 1.349 -+--------------------------------------------------------------------------- 1.350 -| The O_DIRECT feature is fully broken under at least Linux 2.2 and 1.351 -| 2.4. It is sometimes accepted by open(2) without error and later 1.352 -| causes a write(2) to fail with EINVAL -- all depending on the 1.353 -| underlying filesystem (usually works on tmpfs and fails on ext3). 1.354 -| Sometimes it also causes open(2) to fail with EINVAL. In general, 1.355 -| it does especially no "graceful degradation" and so is useless for 1.356 -| use mostly all platforms except for those where we know it works 1.357 -| (currently FreeBSD only). Interestingly, RPM works on RedHat, just 1.358 -| because RedHat's "kernel" package contains a patch which masks out 1.359 -| O_DIRECT usage... ;-) 1.360 -+--------------------------------------------------------------------------- 1.361 -Index: db/os/os_open.c 1.362 ---- db/os/os_open.c 18 Jan 2003 14:05:03 -0000 1.1.1.5 1.363 -+++ db/os/os_open.c 22 Jan 2004 21:42:19 -0000 1.2 1.364 -@@ -93,7 +93,7 @@ 1.365 - if (LF_ISSET(DB_OSO_TRUNC)) 1.366 - oflags |= O_TRUNC; 1.367 - 1.368 --#ifdef HAVE_O_DIRECT 1.369 -+#if defined(HAVE_O_DIRECT) && defined(__FreeBSD__) 1.370 - if (LF_ISSET(DB_OSO_DIRECT)) 1.371 - oflags |= O_DIRECT; 1.372 - #endif