rpm-4.0.2.patch.porting 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. ##
  2. ## rpm-4.0.2.patch.porting -- Annotated patch file
  3. ## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2001 Ralf S. Engelschall <rse.com>
  5. ##
  6. ## This file assembles changes to existing RPM source files between
  7. ## the original RedHat RPM and the OpenPKG RPM variant. It can be
  8. ## automatically applied to a vanilla RedHat RPM source tree with the
  9. ## 'patch' tool to upgrade those files. Each patch snippet is annotated
  10. ## with a short description.
  11. ##
  12. ## Created on: 23-Sep-2001
  13. ##
  14. +---------------------------------------------------------------------------
  15. | Replace RedHat-specific #include with general one.
  16. | Add support for Berkeley-DB 3.2.x.
  17. +---------------------------------------------------------------------------
  18. Index: lib/db3.c
  19. --- lib/db3.c 2001/02/15 00:16:09 1.1.1.3
  20. +++ lib/db3.c 2001/06/25 14:49:03 1.2
  21. @@ -13,7 +13,7 @@
  22. #include "system.h"
  23. -#include <db3/db.h>
  24. +#include <db.h>
  25. #include <rpmlib.h>
  26. #include <rpmmacro.h>
  27. @@ -135,7 +135,7 @@
  28. xx = db_env_create(&dbenv, 0);
  29. xx = cvtdberr(dbi, "db_env_create", rc, _debug);
  30. -#if DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR == 1
  31. +#if DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR >= 1
  32. xx = dbenv->remove(dbenv, dbhome, 0);
  33. #else
  34. xx = dbenv->remove(dbenv, dbhome, NULL, 0);
  35. @@ -213,7 +213,7 @@
  36. /* dbenv->set_tx_max(???) */
  37. /* dbenv->set_tx_recover(???) */
  38. if (dbi->dbi_no_fsync) {
  39. -#if DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR == 1
  40. +#if DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR >= 1
  41. xx = db_env_set_func_fsync(db3_fsync_disable);
  42. #else
  43. xx = dbenv->set_func_fsync(dbenv, db3_fsync_disable);
  44. @@ -231,7 +231,7 @@
  45. #endif /* __USE_DB3 */
  46. #if defined(__USE_DB3)
  47. -#if DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR == 1
  48. +#if DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR >= 1
  49. rc = dbenv->open(dbenv, dbhome, eflags, dbi->dbi_perms);
  50. #else
  51. rc = dbenv->open(dbenv, dbhome, NULL, eflags, dbi->dbi_perms);
  52. +---------------------------------------------------------------------------
  53. | Replace RedHat-specific #include with general one.
  54. +---------------------------------------------------------------------------
  55. Index: lib/dbconfig.c
  56. --- lib/dbconfig.c 2001/02/14 19:49:14 1.1.1.1
  57. +++ lib/dbconfig.c 2001/06/25 14:49:03 1.2
  58. @@ -4,7 +4,7 @@
  59. #include "system.h"
  60. -#include <db3/db.h>
  61. +#include <db.h>
  62. #include <rpmlib.h>
  63. #include <rpmmacro.h>
  64. +---------------------------------------------------------------------------
  65. | Avoid non-portable construct: a self-referencing structure
  66. | declaration cannot be combined with the corresponding typedef.
  67. | Although GCC supports this (and does the correct thing), most
  68. | other stricter compilers complain and fail.
  69. +---------------------------------------------------------------------------
  70. Index: rpmio/rpmmacro.h
  71. --- rpmio/rpmmacro.h 2000/12/11 18:41:27 1.1.1.2
  72. +++ rpmio/rpmmacro.h 2001/06/25 19:26:59 1.2
  73. @@ -6,14 +6,15 @@
  74. */
  75. /*! The structure used to store a macro. */
  76. -typedef /*@abstract@*/ struct MacroEntry {
  77. +struct MacroEntry {
  78. struct MacroEntry *prev;/*!< Macro entry stack. */
  79. const char *name; /*!< Macro name. */
  80. const char *opts; /*!< Macro parameters (a la getopt) */
  81. const char *body; /*!< Macro body. */
  82. int used; /*!< No. of expansions. */
  83. int level; /*!< Scoping level. */
  84. -} MacroEntry;
  85. +};
  86. +typedef /*@abstract@*/ struct MacroEntry MacroEntry;
  87. /*! The structure used to store the set of macros in a context. */
  88. typedef /*@abstract@*/ struct MacroContext {
  89. +---------------------------------------------------------------------------
  90. | Add support for OSF1/Tru64.
  91. +---------------------------------------------------------------------------
  92. Index: misc/fnmatch.h
  93. --- misc/fnmatch.h 2000/03/10 22:02:29 1.1.1.2
  94. +++ misc/fnmatch.h 2001/06/25 19:43:38 1.2
  95. @@ -55,7 +55,7 @@
  96. #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
  97. #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
  98. -#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
  99. +#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE || defined __osf__
  100. # define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
  101. # define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
  102. # define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
  103. +---------------------------------------------------------------------------
  104. | Add support for OSF1/Tru64.
  105. +---------------------------------------------------------------------------
  106. Index: misc/glob.h
  107. --- misc/glob.h 2000/03/11 20:59:30 1.1.1.3
  108. +++ misc/glob.h 2001/06/25 19:43:38 1.2
  109. @@ -74,7 +74,7 @@
  110. #define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
  111. #if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \
  112. - || defined _GNU_SOURCE)
  113. + || defined _GNU_SOURCE || defined __osf__ )
  114. # define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
  115. # define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
  116. # define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
  117. +---------------------------------------------------------------------------
  118. | Make sure db1xxx() function references are only used if Berkeley-DB
  119. | 1.x was really found.
  120. +---------------------------------------------------------------------------
  121. Index: lib/rpmdb.c
  122. --- lib/rpmdb.c 2001/02/23 21:43:20 1.1.1.17
  123. +++ lib/rpmdb.c 2001/06/25 19:45:29 1.2
  124. @@ -2124,6 +2124,7 @@
  125. case 2:
  126. case 1:
  127. case 0:
  128. +#if USE_DB1
  129. for (i = 0; i < dbiTagsMax; i++) {
  130. const char * base = db1basename(dbiTags[i]);
  131. sprintf(filename, "%s/%s/%s", rootdir, dbpath, base);
  132. @@ -2131,6 +2132,7 @@
  133. xx = unlink(filename);
  134. free((void *)base);
  135. }
  136. +#endif
  137. break;
  138. }
  139. @@ -2213,6 +2215,7 @@
  140. case 2:
  141. case 1:
  142. case 0:
  143. +#if USE_DB1
  144. for (i = 0; i < dbiTagsMax; i++) {
  145. const char * base;
  146. int rpmtag;
  147. @@ -2240,6 +2243,7 @@
  148. rc = 1;
  149. free((void *)base);
  150. }
  151. +#endif
  152. break;
  153. }
  154. if (rc || _olddbapi == _newdbapi)
  155. +---------------------------------------------------------------------------
  156. | Add support for BSD getmntinfo(3).
  157. +---------------------------------------------------------------------------
  158. Index: acconfig.h
  159. --- acconfig.h 2000/12/11 18:40:56 1.1.1.7
  160. +++ acconfig.h 2001/07/05 11:44:10 1.2
  161. @@ -65,6 +65,9 @@
  162. /* Define as 1 if you have getmntinfo_r() (only osf?) */
  163. #undef HAVE_GETMNTINFO_R
  164. +/* Define as 1 if you have getmntinfo() */
  165. +#undef HAVE_GETMNTINFO
  166. +
  167. /* Define as 1 if you have "struct mnttab" (only sco?) */
  168. #undef HAVE_STRUCT_MNTTAB
  169. +---------------------------------------------------------------------------
  170. | Add support for BSD getmntinfo(3).
  171. +---------------------------------------------------------------------------
  172. Index: config.h.in
  173. --- config.h.in 2001/02/21 20:47:08 1.1.1.12
  174. +++ config.h.in 2001/07/05 11:44:10 1.11
  175. @@ -123,6 +123,9 @@
  176. /* Define as 1 if you have getmntinfo_r() (only osf?) */
  177. #undef HAVE_GETMNTINFO_R
  178. +/* Define as 1 if you have getmntinfo() */
  179. +#undef HAVE_GETMNTINFO
  180. +
  181. /* Define as 1 if you have "struct mnttab" (only sco?) */
  182. #undef HAVE_STRUCT_MNTTAB
  183. +---------------------------------------------------------------------------
  184. | Add support for BSD getmntinfo(3).
  185. +---------------------------------------------------------------------------
  186. Index: configure.in
  187. --- configure.in 2001/02/25 17:13:26 1.1.1.17
  188. +++ configure.in 2001/07/05 11:44:11 1.2
  189. @@ -815,12 +815,13 @@
  190. AC_CHECK_FUNCS(getpassphrase)
  191. AC_CHECK_FUNC(getmntent, AC_DEFINE(HAVE_GETMNTENT), [
  192. + AC_CHECK_FUNC(getmntinfo, AC_DEFINE(HAVE_GETMNTINFO), [
  193. AC_CHECK_FUNC(mntctl, AC_DEFINE(HAVE_MNTCTL),[
  194. AC_CHECK_FUNC(getmntinfo_r, AC_DEFINE(HAVE_GETMNTINFO_R), [
  195. AC_CHECK_LIB(c_r, getmntinfo_r, [LIBS="$LIBS -lc_r";
  196. AC_DEFINE(HAVE_GETMNTINFO_R)], [
  197. AC_DEFINE([USE_GETMNTENT], 1, [Defined if getmntent replacement is used])
  198. - LIBOBJS="$LIBOBJS getmntent.o"])])])])
  199. + LIBOBJS="$LIBOBJS getmntent.o"])])])])])
  200. AC_CHECK_FUNC(lchown,
  201. [__CHOWN_RHF="%{__chown} -Rhf"
  202. +---------------------------------------------------------------------------
  203. | Add support for BSD getmntinfo(3).
  204. +---------------------------------------------------------------------------
  205. Index: system.h
  206. --- system.h 2000/12/11 18:40:56 1.1.1.5
  207. +++ system.h 2001/07/05 11:44:11 1.2
  208. @@ -325,7 +325,7 @@
  209. #define lchown chown
  210. #endif
  211. -#if HAVE_GETMNTINFO_R || HAVE_MNTCTL
  212. +#if HAVE_GETMNTINFO_R || HAVE_GETMNTINFO || HAVE_MNTCTL
  213. # define GETMNTENT_ONE 0
  214. # define GETMNTENT_TWO 0
  215. # if HAVE_SYS_MNTCTL_H
  216. +---------------------------------------------------------------------------
  217. | Add support for BSD getmntinfo(3).
  218. +---------------------------------------------------------------------------
  219. Index: lib/fs.c
  220. --- lib/fs.c 2001/01/15 23:10:04 1.1.1.8
  221. +++ lib/fs.c 2001/07/05 11:44:14 1.2
  222. @@ -138,7 +138,7 @@
  223. # if GETMNTENT_ONE || GETMNTENT_TWO
  224. our_mntent item;
  225. FILE * mtab;
  226. -# elif HAVE_GETMNTINFO_R
  227. +# elif HAVE_GETMNTINFO_R || HAVE_GETMNTINFO
  228. struct statfs * mounts = NULL;
  229. int mntCount = 0, bufSize = 0, flags = MNT_NOWAIT;
  230. int nextMount = 0;
  231. @@ -155,6 +155,8 @@
  232. }
  233. # elif HAVE_GETMNTINFO_R
  234. getmntinfo_r(&mounts, flags, &mntCount, &bufSize);
  235. +# elif HAVE_GETMNTINFO
  236. + mntCount = getmntinfo(&mounts, flags);
  237. # endif
  238. filesystems = xcalloc((numAlloced + 1), sizeof(*filesystems)); /* XXX memory leak */
  239. @@ -175,7 +177,7 @@
  240. /* Solaris, maybe others */
  241. if (getmntent(mtab, &item)) break;
  242. mntdir = item.our_mntdir;
  243. -# elif HAVE_GETMNTINFO_R
  244. +# elif HAVE_GETMNTINFO_R || HAVE_GETMNTINFO
  245. if (nextMount == mntCount) break;
  246. mntdir = mounts[nextMount++].f_mntonname;
  247. # endif