michael@13: ## michael@13: ## rpm.patch.porting -- Annotated OpenPKG RPM Patch file michael@13: ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. michael@13: ## Copyright (c) 2000-2007 Ralf S. Engelschall michael@13: ## michael@13: ## This file assembles changes to existing RPM source files between michael@13: ## the original RedHat RPM and the OpenPKG RPM variant. It can be michael@13: ## automatically applied to a vanilla RedHat RPM source tree with the michael@13: ## 'patch' tool to upgrade those files. Each patch snippet is annotated michael@13: ## with a short description. michael@13: ## michael@13: ## Created on: 13-Sep-2006 michael@13: ## michael@13: ## ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG michael@13: ## RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE. michael@13: ## michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Evil hack to get GNU libtool working under NetBSD 1.6 michael@13: | with the ugly way RPM currently has to use it. michael@13: +--------------------------------------------------------------------------- michael@13: Index: ltconfig michael@13: --- ltconfig 17 Jan 2001 16:22:58 -0000 1.1.1.7 michael@13: +++ ltconfig 29 Apr 2004 13:07:28 -0000 1.4 michael@13: @@ -2017,6 +2017,7 @@ michael@13: dynamic_linker='NetBSD ld.elf_so' michael@13: fi michael@13: shlibpath_var=LD_LIBRARY_PATH michael@13: + deplibs_check_method=pass_all michael@13: ;; michael@13: michael@13: openbsd*) michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Disable special RedHat NPTL handling. michael@13: +--------------------------------------------------------------------------- michael@13: Index: configure.ac michael@13: --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4 michael@13: +++ configure.ac 13 Sep 2006 13:40:20 -0000 michael@333: @@ -151,10 +151,10 @@ michael@13: dnl XXX Test for libpthread.a that is NPTL aware (static link only). michael@13: dnl michael@13: LDFLAGS_NPTL= michael@13: -if test -f /usr/lib/nptl/libpthread.a ; then michael@13: - LDFLAGS_NPTL="-L/usr/lib/nptl" michael@13: -# INCPATH="$INCPATH -I/usr/include/nptl" michael@13: -fi michael@13: +dnl if test -f /usr/lib/nptl/libpthread.a ; then michael@13: +dnl LDFLAGS_NPTL="-L/usr/lib/nptl" michael@13: +dnl # INCPATH="$INCPATH -I/usr/include/nptl" michael@13: +dnl fi michael@13: AC_SUBST(LDFLAGS_NPTL) michael@13: michael@13: dnl michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Disable any POSIX Pthread stuff because in OpenPKG we use michael@13: | non-Pthread mutexes in Berkeley-DB. michael@13: +--------------------------------------------------------------------------- michael@13: Index: configure.ac michael@13: --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4 michael@13: +++ configure.ac 13 Sep 2006 13:40:21 -0000 michael@333: @@ -447,14 +447,17 @@ michael@13: AC_CHECK_LIB(socket, socket) michael@13: ]) michael@13: michael@13: -AC_CHECK_HEADERS(thread.h pthread.h synch.h semaphore.h) michael@13: +dnl # required for HP-UX because of RPC stuff in DB michael@13: +AC_CHECK_LIB(nsl, svc_run) michael@13: michael@13: -AC_CHECK_LIB(pthread, pthread_mutex_trylock, [], [ michael@13: - dnl OSF 5.0 has the the symbols prefixed with __ in libpthread. michael@13: - AC_CHECK_LIB(pthread, __pthread_mutex_trylock, [], [ michael@13: - AC_CHECK_LIB(thread, mutex_lock) michael@13: - ]) michael@13: -]) michael@13: +dnl AC_CHECK_HEADERS(thread.h pthread.h synch.h semaphore.h) michael@13: +dnl michael@13: +dnl AC_CHECK_LIB(pthread, pthread_mutex_trylock, [], [ michael@13: +dnl dnl OSF 5.0 has the the symbols prefixed with __ in libpthread. michael@13: +dnl AC_CHECK_LIB(pthread, __pthread_mutex_trylock, [], [ michael@13: +dnl AC_CHECK_LIB(thread, mutex_lock) michael@13: +dnl ]) michael@13: +dnl ]) michael@13: michael@13: AC_CHECK_HEADERS(aio.h) michael@13: AC_SEARCH_LIBS(aio_read, [c rt aio posix4]) michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for BSD getmntinfo(3). michael@13: +--------------------------------------------------------------------------- michael@13: Index: configure.ac michael@13: --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4 michael@13: +++ configure.ac 13 Sep 2006 13:40:23 -0000 michael@336: @@ -967,12 +967,13 @@ michael@13: AC_CHECK_FUNCS(getpassphrase) michael@13: michael@13: AC_CHECK_FUNC(getmntent, AC_DEFINE(HAVE_GETMNTENT, 1, [Define if you have the getmntent() function]), [ michael@13: + AC_CHECK_FUNC(getmntinfo, AC_DEFINE(HAVE_GETMNTINFO, 1, [Define as 1 if you have the getmntinfo() function]), [ michael@13: AC_CHECK_FUNC(mntctl, AC_DEFINE(HAVE_MNTCTL, 1, [Define as 1 if you have mntctl() (only aix?)]),[ michael@13: AC_CHECK_FUNC(getmntinfo_r, AC_DEFINE(HAVE_GETMNTINFO_R, 1, [Define as 1 if you have getmntinfo_r() (only osf?)]), [ michael@13: AC_CHECK_LIB(c_r, getmntinfo_r, [LIBS="$LIBS -lc_r"; michael@13: AC_DEFINE(HAVE_GETMNTINFO_R, 1, [Define as 1 if you have getmntinfo_r() (only osf?)])], [ michael@13: AC_DEFINE([USE_GETMNTENT], 1, [Defined if getmntent replacement is used]) michael@13: - AC_LIBOBJ(getmntent)])])])]) michael@13: + AC_LIBOBJ(getmntent)])])])])]) michael@13: michael@13: AC_CHECK_FUNC(lchown, michael@13: [__CHOWN_RHF="%{__chown} -Rhf" michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Remove RPM's "lib64" hack because we do not install michael@13: | into any system locations at all. michael@13: +--------------------------------------------------------------------------- michael@13: Index: configure.ac michael@13: --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4 michael@13: +++ configure.ac 13 Sep 2006 13:40:25 -0000 michael@336: @@ -1146,9 +1146,6 @@ michael@13: michael@13: dnl XXX Choose /usr/lib or /usr/lib64 for library installs. michael@13: MARK64= michael@13: -case "${target_cpu}" in michael@13: -x86_64*|ppc64*|powerpc64*|sparc64*|s390x*) MARK64=64 ;; michael@13: -esac michael@13: AC_SUBST(MARK64) michael@13: michael@13: dnl Determine the canonical arch-vendor-os for the build machine michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Provide fallback definitions for uintX_t stuff, which is used by michael@13: | build/rpmfile.h and not available on all platforms. We do this by michael@13: | adding the same Autoconf checks file/configure already used for its michael@13: | original file.h. michael@13: | Additionally, do not try to configure in an internal michael@13: | beecrypt subdirectory. michael@13: +--------------------------------------------------------------------------- michael@13: Index: configure.ac michael@13: --- configure.ac 2 Jul 2003 19:20:52 -0000 1.1.1.4 michael@13: +++ configure.ac 13 Sep 2006 13:40:29 -0000 michael@336: @@ -1251,11 +1251,40 @@ michael@13: michael@13: AC_SUBST(OBJDUMP) michael@13: michael@13: +dnl OpenPKG: rpmfile.h (used in RPM) from file(1) needs additional checks michael@13: +dnl for its use of uintXX_t (which are available in file/config.h, but which michael@13: +dnl we cannot include into RPM because of conflicts with RPM's config.h) michael@13: +AC_DEFUN([AC_CHECK_TYPE_STDC], michael@13: +[AC_REQUIRE([AC_HEADER_STDC])dnl michael@13: +AC_MSG_CHECKING(for $1) michael@13: +AC_CACHE_VAL(ac_cv_type_$1, michael@13: +[AC_EGREP_CPP(dnl michael@13: +[(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]], michael@13: +[#if HAVE_STDINT_H michael@13: +#include michael@13: +#endif michael@13: +#include michael@13: +#if STDC_HEADERS michael@13: +#include michael@13: +#include michael@13: +#endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl michael@13: +AC_MSG_RESULT($ac_cv_type_$1) michael@13: +if test $ac_cv_type_$1 = no; then michael@13: + AC_DEFINE($1, $2, $1) michael@13: +fi]) michael@13: +AC_CHECK_TYPE_STDC(uint8_t, unsigned char) michael@13: +AC_CHECK_TYPE_STDC(uint16_t, unsigned short) michael@13: +AC_CHECK_TYPE_STDC(uint32_t, unsigned int) michael@13: + michael@13: +dnl OpenPKG: some strange platforms (like Unixware) really have MADV_XXX michael@13: +dnl but no madvise(2) function itself, so check for madvise explicitly. michael@13: +AC_CHECK_FUNC(madvise) michael@13: + michael@13: dnl XXX this causes popt to depend on zlib et al michael@13: dnl # XXX Propagate -lucb to popt ... michael@13: dnl export LIBS INCPATH CONFIG_SITE michael@13: michael@13: -AC_CONFIG_SUBDIRS(popt beecrypt zlib elfutils file db3) michael@13: +AC_CONFIG_SUBDIRS(popt zlib elfutils file db3) michael@13: michael@13: AC_OUTPUT([ Doxyfile Makefile rpmrc macros platform rpmpopt rpm.spec michael@13: rpmio/Makefile rpmdb/Makefile lib/Makefile build/Makefile michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Remove RPM's "lib64" hack because we do not install michael@13: | into any system locations at all. michael@13: +--------------------------------------------------------------------------- michael@13: Index: popt/configure.ac michael@13: --- popt/configure.ac 27 Mar 2003 17:23:18 -0000 1.1.1.3 michael@13: +++ popt/configure.ac 12 May 2004 14:34:35 -0000 1.2 michael@13: @@ -53,9 +53,6 @@ michael@13: michael@13: dnl XXX Choose /usr/lib or /usr/lib64 for library installs. michael@13: MARK64= michael@13: -case "${target_cpu}" in michael@13: -x86_64*|powerpc64*|ppc64*|sparc64*|s390x*) MARK64=64 ;; michael@13: -esac michael@13: AC_SUBST(MARK64) michael@13: michael@13: AC_CHECK_HEADERS(alloca.h float.h libintl.h mcheck.h unistd.h) michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Prevent (at least NetBSD's) gcc 2.95 from optimizing (at least sha1.c) michael@13: | and this way run into a resource (virtual memory) exhaustion situation. michael@13: | Not all Bourne-Shells support embedded TAB characters in michael@13: | here-document style constructs. Insert the TAB character indirectly michael@13: | to workaround problems. michael@13: | Additionally, there is no need to build a shared library version of michael@13: | Berkeley-DB. michael@13: | Finally, enforce the use of the standard UNIX/fcntl mutex type for michael@13: | full portability and to get rid of Pthread library dependencies michael@13: | (which especially are nasty for the external RPM API users). michael@13: +--------------------------------------------------------------------------- michael@13: Index: db3/configure michael@13: --- db3/configure 18 Jan 2003 14:04:22 -0000 1.1.1.4 michael@13: +++ db3/configure 6 Jun 2005 15:53:05 -0000 1.3 michael@13: @@ -7,19 +7,29 @@ michael@13: # XXX edit CFLAGS= ... out of invocation args ??? michael@13: ARGS="`echo $* | sed -e 's% [^ ]*CFLAGS=[^ ]*%%' -e 's% -[^-][^ ]*%%g' -e 's%--cache-file=.*$%%'`" michael@13: michael@13: +# prevent gcc 2.95 from optimizing (at least sha1.c) michael@13: +# and this way get into a resource exhaustion situation michael@13: +if [ ".`($CC -v; $CC --version) &1 | grep -i 'gcc'`" != . ]; then michael@13: + case "`$CC -dumpversion 2>/dev/null`" in michael@13: + 3.* ) ;; michael@13: + * ) CFLAGS=`echo " $CFLAGS -O0" | sed -e 's; -O[0-9]* ; ;g' -e 's;^ *;;'` ;; michael@13: + esac michael@13: +fi michael@13: + michael@13: CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure $ARGS \ michael@13: - --enable-shared --enable-static --enable-rpc \ michael@13: - --with-uniquename=_rpmdb --srcdir=$db_dist michael@13: + --disable-shared --enable-static --enable-rpc \ michael@13: + --with-uniquename=_rpmdb --srcdir=$db_dist \ michael@13: + --with-mutex="UNIX/fcntl" --disable-largefile michael@13: michael@13: mv Makefile Makefile.orig michael@13: cat Makefile.orig | sed -e '/^install[:-]/c\ michael@13: .PHONY: listobjs\ michael@13: listobjs:\ michael@13: - @echo $(OBJS) $(C_OBJS) \ michael@13: +~@echo $(OBJS) $(C_OBJS) \ michael@13: \ michael@13: distdir install check:\ michael@13: \ michael@13: -db4_install: all install_setip' > Makefile michael@13: +db4_install: all install_setip' | tr '~' ' ' > Makefile michael@13: michael@13: mv db.h db.h.orig michael@13: cat db.h.orig | sed \ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for BSD getmntinfo(3). michael@13: +--------------------------------------------------------------------------- michael@13: Index: lib/fs.c michael@13: --- lib/fs.c 4 Jun 2003 18:09:43 -0000 1.1.1.13 michael@13: +++ lib/fs.c 25 Nov 2004 09:32:16 -0000 1.3 michael@13: @@ -164,6 +164,15 @@ michael@13: int nextMount = 0; michael@13: michael@13: getmntinfo_r(&mounts, flags, &mntCount, &bufSize); michael@13: +# elif HAVE_GETMNTINFO michael@13: +# if defined(__NetBSD__) && (__NetBSD_Version__ > 200030000) michael@13: +# define statfs statvfs michael@13: +# endif michael@13: + struct statfs * mounts = NULL; michael@13: + int mntCount, flags = MNT_NOWAIT; michael@13: + int nextMount = 0; michael@13: + michael@13: + mntCount = getmntinfo(&mounts, flags); michael@13: # endif michael@13: michael@13: filesystems = xcalloc((numAlloced + 1), sizeof(*filesystems)); /* XXX memory leak */ michael@13: @@ -193,6 +202,9 @@ michael@13: # elif HAVE_GETMNTINFO_R michael@13: if (nextMount == mntCount) break; michael@13: mntdir = mounts[nextMount++].f_mntonname; michael@13: +# elif HAVE_GETMNTINFO michael@13: + if (nextMount == mntCount) break; michael@13: + mntdir = mounts[nextMount++].f_mntonname; michael@13: # endif michael@13: michael@13: if (stat(mntdir, &sb)) { michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for Compaq/HP OSF1/Tru64. michael@13: +--------------------------------------------------------------------------- michael@13: Index: misc/fnmatch.h michael@13: --- misc/fnmatch.h 22 Feb 2002 17:12:15 -0000 1.1.1.3 michael@13: +++ misc/fnmatch.h 22 Jan 2004 21:42:26 -0000 1.2 michael@13: @@ -55,7 +55,7 @@ michael@13: #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ michael@13: #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ michael@13: michael@13: -#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE michael@13: +#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE || defined __osf__ michael@13: # define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ michael@13: # define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ michael@13: # define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Use more correct Autoconf based size_t check. michael@13: | Add support for Compaq/HP OSF1/Tru64 and SCO UnixWare. michael@13: +--------------------------------------------------------------------------- michael@13: Index: misc/glob.h michael@13: --- misc/glob.h 11 Mar 2000 20:59:30 -0000 1.1.1.3 michael@13: +++ misc/glob.h 22 Jan 2004 21:42:27 -0000 1.2 michael@13: @@ -46,7 +46,7 @@ michael@13: #endif /* C++ or ANSI C. */ michael@13: michael@13: /* We need `size_t' for the following definitions. */ michael@13: -#ifndef __size_t michael@13: +#if !defined(__size_t) && !defined(_SIZE_T_DECLARED) michael@13: # if defined __GNUC__ && __GNUC__ >= 2 michael@13: typedef __SIZE_TYPE__ __size_t; michael@13: # ifdef _XOPEN_SOURCE michael@13: @@ -74,7 +74,7 @@ michael@13: #define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */ michael@13: michael@13: #if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \ michael@13: - || defined _GNU_SOURCE) michael@13: + || defined _GNU_SOURCE || defined __osf__ ) michael@13: # define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */ michael@13: # define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */ michael@13: # define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */ michael@13: @@ -151,7 +151,8 @@ michael@13: `glob' returns GLOB_ABEND; if it returns zero, the error is ignored. michael@13: If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned. michael@13: Otherwise, `glob' returns zero. */ michael@13: -#if _FILE_OFFSET_BITS != 64 michael@13: +/* #if _FILE_OFFSET_BITS != 64 || defined(OPENPKG_UNIXWARE) */ michael@13: +#if !defined(__linux__) michael@13: extern int glob __P ((__const char *__pattern, int __flags, michael@13: int (*__errfunc) (__const char *, int), michael@13: glob_t *__pglob)); michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Better portability. michael@13: +--------------------------------------------------------------------------- michael@13: Index: misc/glob.c michael@13: --- misc/glob.c 11 Mar 2000 21:13:18 -0000 1.1.1.4 michael@13: +++ misc/glob.c 22 Jan 2004 21:42:26 -0000 1.2 michael@13: @@ -813,6 +813,7 @@ michael@13: michael@13: michael@13: /* Free storage allocated in PGLOB by a previous `glob' call. */ michael@13: +#if !defined(__linux__) || (defined(__linux__) && (_FILE_OFFSET_BITS != 64) || (__GNUC__ >= 2)) michael@13: void michael@13: globfree (pglob) michael@13: register glob_t *pglob; michael@13: @@ -826,7 +827,7 @@ michael@13: free ((__ptr_t) pglob->gl_pathv); michael@13: } michael@13: } michael@13: - michael@13: +#endif michael@13: michael@13: /* Do a collated comparison of A and B. */ michael@13: static int michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add libmisc.a for platform portability. michael@13: +--------------------------------------------------------------------------- michael@13: Index: tools/Makefile.am michael@13: --- tools/Makefile.am 29 May 2003 17:40:17 -0000 1.1.1.14 michael@13: +++ tools/Makefile.am 22 Jan 2004 21:42:34 -0000 1.2 michael@13: @@ -22,7 +22,7 @@ michael@13: michael@13: LDADD = \ michael@13: $(top_builddir)/lib/librpm.la \ michael@13: - @INTLLIBS@ michael@13: + @INTLLIBS@ @LIBMISC@ michael@13: michael@13: staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@ michael@13: michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add libmisc.a for platform portability. michael@13: +--------------------------------------------------------------------------- michael@13: Index: tools/Makefile.in michael@13: --- tools/Makefile.in 16 Jul 2003 17:05:51 -0000 1.1.1.20 michael@13: +++ tools/Makefile.in 22 Jan 2004 21:42:35 -0000 1.2 michael@13: @@ -275,7 +275,7 @@ michael@13: michael@13: LDADD = \ michael@13: $(top_builddir)/lib/librpm.la \ michael@13: - @INTLLIBS@ michael@13: + @INTLLIBS@ @LIBMISC@ michael@13: michael@13: michael@13: staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Drop GCC "inline" attribute if not compiling with GCC. michael@13: | Workaround some other GCC'isms, too. michael@13: | Do not take over "const" replacements from Zlib. michael@13: +--------------------------------------------------------------------------- michael@13: Index: file/system.h michael@13: --- file/system.h 24 Jan 2003 19:41:56 -0000 1.1.1.1 michael@13: +++ file/system.h 6 Jun 2005 15:53:05 -0000 1.4 michael@13: @@ -13,6 +13,9 @@ michael@13: #endif michael@13: michael@13: #include michael@13: +#ifdef HAVE_INTTYPES_H michael@13: +#include michael@13: +#endif michael@13: michael@13: #include michael@13: #include michael@13: @@ -53,6 +56,8 @@ michael@13: #else michael@13: #if HAVE_ERROR && HAVE_ERROR_H michael@13: #include michael@13: +#else michael@13: +extern void error(int status, int errnum, const char *format, ...); michael@13: #endif michael@13: #endif michael@13: michael@13: @@ -194,6 +199,7 @@ michael@13: michael@13: #ifdef HAVE_LIBZ michael@13: #include michael@13: +#undef const michael@13: #endif michael@13: michael@13: #ifndef HAVE_STRERROR michael@13: @@ -246,7 +252,11 @@ michael@13: */ michael@13: /*@-shadow@*/ michael@13: /*@unused@*/ /*@exits@*/ /*@only@*/ michael@13: +#if defined(__GNUC__) michael@13: static inline void * vmefail(/*@unused@*/ size_t nb) michael@13: +#else michael@13: +static void * vmefail(/*@unused@*/ size_t nb) michael@13: +#endif michael@13: /*@globals fileSystem @*/ michael@13: /*@modifies fileSystem @*/ michael@13: { michael@13: @@ -286,9 +296,33 @@ michael@13: michael@13: #if !defined(__LCLINT__) michael@13: /* Memory allocation via macro defs to get meaningful locations from mtrace() */ michael@13: +#if defined(__GNUC__) michael@13: #define xmalloc(_size) (malloc(_size) ? : vmefail(0)) michael@13: #define xcalloc(_nmemb, _size) (calloc((_nmemb), (_size)) ? : vmefail(0)) michael@13: #define xrealloc(_ptr, _size) (realloc((_ptr), (_size)) ? : vmefail(0)) michael@13: +#else michael@13: +static void *xmalloc(size_t size) michael@13: +{ michael@13: + void *vp = malloc(size); michael@13: + if (vp == NULL) michael@13: + vmefail(0); michael@13: + return vp; michael@13: +} michael@13: +static void *xcalloc(size_t number, size_t size) michael@13: +{ michael@13: + void *vp = calloc(number, size); michael@13: + if (vp == NULL) michael@13: + vmefail(0); michael@13: + return vp; michael@13: +} michael@13: +static void *xrealloc(void *ptr, size_t size) michael@13: +{ michael@13: + void *vp = realloc(ptr, size); michael@13: + if (vp == NULL) michael@13: + vmefail(0); michael@13: + return vp; michael@13: +} michael@13: +#endif michael@13: #define xstrdup(_str) (strcpy(xmalloc(strlen(_str)+1), (_str))) michael@13: #endif michael@13: michael@13: @@ -314,9 +348,14 @@ michael@13: michael@13: #if defined(__LCLINT__) michael@13: #define FILE_RCSID(id) michael@13: -#else michael@13: +#elif defined(__GNUC__) michael@13: #define FILE_RCSID(id) \ michael@13: static inline const char *rcsid(const char *p) { \ michael@13: + return rcsid(p = id); \ michael@13: +} michael@13: +#else michael@13: +#define FILE_RCSID(id) \ michael@13: +static const char *rcsid(const char *p) { \ michael@13: return rcsid(p = id); \ michael@13: } michael@13: #endif michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Use GCC extensional features only if compiled with GCC. michael@13: +--------------------------------------------------------------------------- michael@13: Index: file/file.h michael@13: --- file/file.h 24 Jan 2003 19:41:56 -0000 1.1.1.1 michael@13: +++ file/file.h 22 Jan 2004 21:42:22 -0000 1.2 michael@13: @@ -95,7 +95,11 @@ michael@13: } value; /* either number or string */ michael@13: uint32_t mask; /* mask before comparison with value */ michael@13: char desc[MAXDESC]; /* description */ michael@13: +#if defined(__GNUC__) michael@13: } __attribute__((__packed__)); michael@13: +#else michael@13: +}; michael@13: +#endif michael@13: michael@13: #define BIT(A) (1 << (A)) michael@13: #define STRING_IGNORE_LOWERCASE BIT(0) michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add int32_t detection and automatic fallback support. michael@13: +--------------------------------------------------------------------------- michael@13: Index: file/config.h.in michael@13: --- file/config.h.in 7 Mar 2003 19:39:18 -0000 1.1.1.1 michael@13: +++ file/config.h.in 13 Sep 2006 13:40:49 -0000 michael@13: @@ -106,6 +106,9 @@ michael@13: /* Define to 1 if you have the header file. */ michael@13: #undef HAVE_UNISTD_H michael@13: michael@13: +/* Define to 1 if you have the `vsnprintf' function. */ michael@13: +#undef HAVE_VSNPRINTF michael@13: + michael@13: /* Define to 1 if `major', `minor', and `makedev' are declared in . michael@13: */ michael@13: #undef MAJOR_IN_MKDEV michael@13: @@ -162,12 +165,16 @@ michael@13: /* Define to empty if `const' does not conform to ANSI C. */ michael@13: #undef const michael@13: michael@13: +/* int32_t */ michael@13: +#undef int32_t michael@13: + michael@13: /* Define to `long' if does not define. */ michael@13: #undef off_t michael@13: michael@13: /* Define to `unsigned' if does not define. */ michael@13: #undef size_t michael@13: michael@13: +#ifndef HAVE_STDINT_H michael@13: /* uint16_t */ michael@13: #undef uint16_t michael@13: michael@13: @@ -179,3 +186,4 @@ michael@13: michael@13: /* uint8_t */ michael@13: #undef uint8_t michael@13: +#endif michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add int32_t detection and automatic fallback support. michael@13: +--------------------------------------------------------------------------- michael@13: Index: file/configure.ac michael@13: --- file/configure.ac 1 Dec 2002 21:34:06 -0000 1.1.1.1 michael@13: +++ file/configure.ac 6 Jun 2005 15:53:05 -0000 1.2 michael@13: @@ -92,6 +92,7 @@ michael@13: AC_CHECK_TYPE_STDC(uint8_t, unsigned char) michael@13: AC_CHECK_TYPE_STDC(uint16_t, unsigned short) michael@13: AC_CHECK_TYPE_STDC(uint32_t, unsigned int) michael@13: +AC_CHECK_TYPE_STDC(int32_t, int) michael@13: AC_C_LONG_LONG michael@13: if test $ac_cv_c_long_long = yes; then michael@13: long64='unsigned long long'; michael@13: @@ -107,7 +108,7 @@ michael@13: AC_CHECK_SIZEOF_STDC_HEADERS(uint64_t, 0) michael@13: michael@13: dnl Checks for functions michael@13: -AC_CHECK_FUNCS(error mtrace mkstemp mmap strdup strerror strtoul) michael@13: +AC_CHECK_FUNCS(error mtrace mkstemp mmap strdup strerror strtoul vsnprintf) michael@13: michael@13: dnl Checks for libraries michael@13: AC_CHECK_LIB(z, gzopen) michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add int32_t detection and automatic fallback support. michael@13: +--------------------------------------------------------------------------- michael@13: Index: file/configure michael@13: --- file/configure 16 Jul 2003 17:05:25 -0000 1.1.1.2 michael@13: +++ file/configure 6 Jun 2005 15:53:05 -0000 1.2 michael@13: @@ -10847,6 +10847,46 @@ michael@13: michael@13: fi michael@13: michael@13: +echo "$as_me:$LINENO: checking for int32_t" >&5 michael@13: +echo $ECHO_N "checking for int32_t... $ECHO_C" >&6 michael@13: +if test "${ac_cv_type_int32_t+set}" = set; then michael@13: + echo $ECHO_N "(cached) $ECHO_C" >&6 michael@13: +else michael@13: + cat >conftest.$ac_ext <<_ACEOF michael@13: +#line $LINENO "configure" michael@13: +/* confdefs.h. */ michael@13: +_ACEOF michael@13: +cat confdefs.h >>conftest.$ac_ext michael@13: +cat >>conftest.$ac_ext <<_ACEOF michael@13: +/* end confdefs.h. */ michael@13: +#if HAVE_STDINT_H michael@13: +#include michael@13: +#endif michael@13: +#include michael@13: +#if STDC_HEADERS michael@13: +#include michael@13: +#include michael@13: +#endif michael@13: +_ACEOF michael@13: +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | michael@13: + $EGREP "(^|[^a-zA-Z_0-9])int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then michael@13: + ac_cv_type_int32_t=yes michael@13: +else michael@13: + ac_cv_type_int32_t=no michael@13: +fi michael@13: +rm -f conftest* michael@13: + michael@13: +fi michael@13: +echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5 michael@13: +echo "${ECHO_T}$ac_cv_type_int32_t" >&6 michael@13: +if test $ac_cv_type_int32_t = no; then michael@13: + michael@13: +cat >>confdefs.h <<\_ACEOF michael@13: +#define int32_t int michael@13: +_ACEOF michael@13: + michael@13: +fi michael@13: + michael@13: echo "$as_me:$LINENO: checking for long long" >&5 michael@13: echo $ECHO_N "checking for long long... $ECHO_C" >&6 michael@13: if test "${ac_cv_c_long_long+set}" = set; then michael@13: @@ -11220,7 +11260,8 @@ michael@13: michael@13: michael@13: michael@13: -for ac_func in error mtrace mkstemp mmap strdup strerror strtoul michael@13: + michael@13: +for ac_func in error mtrace mkstemp mmap strdup strerror strtoul vsnprintf michael@13: do michael@13: as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` michael@13: echo "$as_me:$LINENO: checking for $ac_func" >&5 michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Fallback to vsprintf(3) if vsnprintf(3) does not exist. michael@13: +--------------------------------------------------------------------------- michael@13: Index: file/print.c michael@13: --- file/print.c 24 Jan 2003 19:41:56 -0000 1.1.1.1 michael@13: +++ file/print.c 6 Jun 2005 15:53:05 -0000 1.2 michael@13: @@ -187,7 +187,11 @@ michael@13: michael@13: va_start(va, f); michael@13: /*@-boundswrite@*/ michael@13: +#ifdef HAVE_VSNPRINTF michael@13: rc = vsnprintf(fm->obp, fm->nob, f, va); michael@13: +#else michael@13: + rc = vsprintf(fm->obp, f, va); michael@13: +#endif michael@13: /*@=boundswrite@*/ michael@13: va_end(va); michael@13: michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Use GNU libtool's weaker -static (link with own static libraries) michael@13: | instead of the strong -all-static (link even with static libc, etc), michael@13: | because OpenPKG does not need to be fully static. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmdb/Makefile.am michael@13: --- rpmdb/Makefile.am 2 Jul 2003 20:14:07 -0000 1.1.1.7 michael@13: +++ rpmdb/Makefile.am 22 Jan 2004 21:42:29 -0000 1.2 michael@13: @@ -18,7 +18,7 @@ michael@13: EXTRA_PROGRAMS = tjfn michael@13: michael@13: tjfn_SOURCES = tjfn.c michael@13: -tjfn_LDFLAGS = -all-static michael@13: +tjfn_LDFLAGS = -static michael@13: tjfn_LDADD = librpmdb.la michael@13: michael@13: pkgincdir = $(pkgincludedir) michael@13: @@ -180,4 +180,4 @@ michael@13: $(LINT) $(DEFS) $(INCLUDES) $(librpmdb_la_SOURCES) michael@13: michael@13: tdbi: librpmdb.la tdbi.o michael@13: - $(LINK) -all-static $@.o $< $(mylibpaths) $(mylibs) $(LIBS) michael@13: + $(LINK) -static $@.o $< $(mylibpaths) $(mylibs) $(LIBS) michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Use GNU libtool's weaker -static (link with own static libraries) michael@13: | instead of the strong -all-static (link even with static libc, etc), michael@13: | because OpenPKG does not need to be fully static. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmdb/Makefile.in michael@13: --- rpmdb/Makefile.in 16 Jul 2003 17:05:48 -0000 1.1.1.7 michael@13: +++ rpmdb/Makefile.in 22 Jan 2004 21:42:29 -0000 1.2 michael@13: @@ -273,7 +273,7 @@ michael@13: EXTRA_PROGRAMS = tjfn michael@13: michael@13: tjfn_SOURCES = tjfn.c michael@13: -tjfn_LDFLAGS = -all-static michael@13: +tjfn_LDFLAGS = -static michael@13: tjfn_LDADD = librpmdb.la michael@13: michael@13: pkgincdir = $(pkgincludedir) michael@13: @@ -952,7 +952,7 @@ michael@13: $(LINT) $(DEFS) $(INCLUDES) $(librpmdb_la_SOURCES) michael@13: michael@13: tdbi: librpmdb.la tdbi.o michael@13: - $(LINK) -all-static $@.o $< $(mylibpaths) $(mylibs) $(LIBS) michael@13: + $(LINK) -static $@.o $< $(mylibpaths) $(mylibs) $(LIBS) michael@13: # Tell versions [3.59,3.63) of GNU make to not export all variables. michael@13: # Otherwise a system limit (for SysV at least) may be exceeded. michael@13: .NOEXPORT: michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Use GNU libtool's weaker -static (link with own static libraries) michael@13: | instead of the strong -all-static (link even with static libc, etc), michael@13: | because OpenPKG does not need to be fully static. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmio/Makefile.am michael@13: --- rpmio/Makefile.am 5 Jun 2003 12:05:23 -0000 1.1.1.9 michael@13: +++ rpmio/Makefile.am 22 Jan 2004 21:42:31 -0000 1.2 michael@13: @@ -68,27 +68,27 @@ michael@13: tdigest_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: tdir_SOURCES = tdir.c michael@13: -tdir_LDFLAGS = -all-static michael@13: +tdir_LDFLAGS = -static michael@13: tdir_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: tfts_SOURCES = tfts.c michael@13: -tfts_LDFLAGS = -all-static michael@13: +tfts_LDFLAGS = -static michael@13: tfts_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: tglob_SOURCES = tglob.c michael@13: -tglob_LDFLAGS = -all-static michael@13: +tglob_LDFLAGS = -static michael@13: tglob_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: tinv_SOURCES = tinv.c michael@13: -tinv_LDFLAGS = -all-static michael@13: +tinv_LDFLAGS = -static michael@13: tinv_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: tkey_SOURCES = tkey.c michael@13: -tkey_LDFLAGS = -all-static michael@13: +tkey_LDFLAGS = -static michael@13: tkey_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: tring_SOURCES = tring.c michael@13: -tring_LDFLAGS = -all-static michael@13: +tring_LDFLAGS = -static michael@13: tring_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: trpmio_SOURCES = trpmio.c michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Use GNU libtool's weaker -static (link with own static libraries) michael@13: | instead of the strong -all-static (link even with static libc, etc), michael@13: | because OpenPKG does not need to be fully static. michael@13: | Additionally, remove hard-coded Linux'ism of linking against POSIX michael@13: | rt/pthread libraries (is not needed even under Linux itself) and michael@13: | make sure the build does not break by an empty argument list when michael@13: | iterating over (the not existing) BeeCrypt objects. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmio/Makefile.in michael@13: --- rpmio/Makefile.in 16 Jul 2003 17:05:49 -0000 1.1.1.9 michael@13: +++ rpmio/Makefile.in 22 Jan 2004 21:42:31 -0000 1.2 michael@13: @@ -288,8 +288,7 @@ michael@13: librpmio_la_LDFLAGS = -release 4.2 \ michael@13: @WITH_BEECRYPT_LIB@ \ michael@13: $(top_builddir)/file/libfmagic.la \ michael@13: - @WITH_ZLIB_LIB@ \ michael@13: - -lrt -lpthread michael@13: + @WITH_ZLIB_LIB@ michael@13: michael@13: librpmio_la_LIBADD = $(BEECRYPTLOBJS) michael@13: librpmio_la_DEPENDENCIES = .created michael@13: @@ -298,27 +297,27 @@ michael@13: tdigest_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: tdir_SOURCES = tdir.c michael@13: -tdir_LDFLAGS = -all-static michael@13: +tdir_LDFLAGS = -static michael@13: tdir_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: tfts_SOURCES = tfts.c michael@13: -tfts_LDFLAGS = -all-static michael@13: +tfts_LDFLAGS = -static michael@13: tfts_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: tglob_SOURCES = tglob.c michael@13: -tglob_LDFLAGS = -all-static michael@13: +tglob_LDFLAGS = -static michael@13: tglob_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: tinv_SOURCES = tinv.c michael@13: -tinv_LDFLAGS = -all-static michael@13: +tinv_LDFLAGS = -static michael@13: tinv_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: tkey_SOURCES = tkey.c michael@13: -tkey_LDFLAGS = -all-static michael@13: +tkey_LDFLAGS = -static michael@13: tkey_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: tring_SOURCES = tring.c michael@13: -tring_LDFLAGS = -all-static michael@13: +tring_LDFLAGS = -static michael@13: tring_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la michael@13: michael@13: trpmio_SOURCES = trpmio.c michael@13: @@ -743,8 +742,8 @@ michael@13: .created: michael@13: if test X"@WITH_BEECRYPT_SUBDIR@" != X; then \ michael@13: ${MAKE} -C $(top_builddir)/@WITH_BEECRYPT_SUBDIR@ listobjs ; \ michael@13: - for lo in $(BEECRYPTLOBJS); do \ michael@13: - [ -f $$lo ] || $(LN_S) $(top_builddir)/@WITH_BEECRYPT_SUBDIR@/$$lo $$lo ; \ michael@13: + for lo in $(BEECRYPTLOBJS) ''; do \ michael@13: + [ ".$$lo" = . ] || [ -f $$lo ] || $(LN_S) $(top_builddir)/@WITH_BEECRYPT_SUBDIR@/$$lo $$lo ; \ michael@13: done \ michael@13: fi michael@13: touch $@ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add Unixware support. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmio/fts.h michael@13: --- rpmio/fts.h 18 Jan 2003 16:13:17 -0000 1.1.1.3 michael@13: +++ rpmio/fts.h 22 Jan 2004 21:42:32 -0000 1.2 michael@13: @@ -51,7 +51,7 @@ michael@13: # define _LARGEFILE64_SOURCE michael@13: #endif michael@13: michael@13: -#if defined(sun) michael@13: +#if defined(sun) || defined(OPENPKG_UNIXWARE) michael@13: # define _D_EXACT_NAMLEN(d) ((d)->d_reclen) michael@13: #endif michael@13: michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add FreeBSD/NetBSD/OpenBSD support. michael@13: | Workaround some GCC'isms. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmio/fts.c michael@13: --- rpmio/fts.c 18 Jan 2003 16:13:17 -0000 1.1.1.3 michael@13: +++ rpmio/fts.c 8 Jun 2005 13:16:25 -0000 1.5 michael@13: @@ -34,6 +34,8 @@ michael@13: static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; michael@13: #endif /* LIBC_SCCS and not lint */ michael@13: michael@13: +#include michael@13: + michael@13: #if defined(_LIBC) michael@13: #include michael@13: #include michael@330: @@ -45,20 +47,52 @@ michael@13: #include michael@13: #include michael@13: #else michael@13: -#if defined(hpux) michael@13: +#if defined(OPENPKG_HPUX) michael@13: # define _INCLUDE_POSIX_SOURCE michael@13: # define __errno_location() (&errno) michael@330: -# define dirfd(dirp) -1 michael@330: +# define locdirfd(dirp) -1 michael@13: # define stat64 stat michael@13: # define _STAT_VER 0 michael@13: # define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp)) michael@13: +# define _D_EXACT_NAMLEN(d) ((d)->d_namlen) michael@13: #endif michael@13: -#if defined(sun) michael@13: +#if defined(sun) || defined(OPENPKG_UNIXWARE) michael@13: # define __errno_location() (&errno) michael@330: -# define dirfd(dirp) -1 michael@330: +# define locdirfd(dirp) -1 michael@13: # define _STAT_VER 0 michael@13: # define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp)) michael@13: #endif michael@13: +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENPKG_DARWIN) michael@13: +# define __errno_location() (&errno) michael@13: +# define stat64 stat michael@13: +# define _STAT_VER 0 michael@13: +# define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp)) michael@13: +# define _D_EXACT_NAMLEN(d) ((d)->d_namlen) michael@13: +#endif michael@13: +#if defined(__osf__) michael@13: +# define __errno_location() (&errno) michael@330: +# define locdirfd(dirp) -1 michael@13: +# define stat64 stat michael@13: +# define _STAT_VER 0 michael@13: +# define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp)) michael@13: +# define _D_EXACT_NAMLEN(d) ((d)->d_namlen) michael@13: +#endif michael@13: +#if defined(OPENPKG_IRIX64) michael@13: +# define __errno_location() (&errno) michael@330: +# define locdirfd(dirp) -1 michael@13: +# define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp)) michael@13: +# define _D_EXACT_NAMLEN(d) ((d)->d_reclen) michael@13: +#endif michael@13: +#if defined(OPENPKG_AIX) michael@13: +# define __errno_location() (&errno) michael@13: +# define _STAT_VER 0 michael@330: +# define locdirfd(dirp) ((dirp)->dd_fd) michael@13: +# define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp)) michael@13: +# define _D_EXACT_NAMLEN(d) ((d)->d_namlen) michael@13: +#endif michael@330: +#if !defined(locdirfd) michael@330: +# define locdirfd(dirp) dirfd(dirp) michael@330: +#endif michael@13: #include "system.h" michael@13: #include "fts.h" michael@13: #include "rpmio.h" michael@330: @@ -73,7 +107,12 @@ michael@13: /* Largest alignment size needed, minus one. michael@13: Usually long double is the worst case. */ michael@13: #ifndef ALIGNBYTES michael@13: +#if defined(__GNUC__) michael@13: #define ALIGNBYTES (__alignof__ (long double) - 1) michael@13: +#else michael@13: +/* not accurate enough (usually too large), but sufficient (and this way equal safe) */ michael@13: +#define ALIGNBYTES (sizeof (long double) - 1) michael@13: +#endif michael@13: #endif michael@13: /* Align P to that size. */ michael@13: #ifndef ALIGN michael@330: @@ -107,9 +146,13 @@ michael@13: /*@modifies fileSystem, internalState @*/; michael@13: michael@13: #ifndef MAX michael@13: +#if defined(__GNUC__) michael@13: #define MAX(a, b) ({ __typeof__ (a) _a = (a); \ michael@13: __typeof__ (b) _b = (b); \ michael@13: _a > _b ? _a : _b; }) michael@13: +#else michael@13: +#define MAX(a, b) ((a) > (b) ? (a) : (b)) michael@13: +#endif michael@13: #endif michael@13: michael@13: #define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) michael@330: @@ -719,7 +762,7 @@ michael@330: */ michael@330: cderrno = 0; michael@330: if (nlinks || type == BREAD) { michael@330: - if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) { michael@330: + if (fts_safe_changedir(sp, cur, locdirfd(dirp), NULL)) { michael@330: if (nlinks && type == BREAD) michael@330: cur->fts_errno = errno; michael@330: cur->fts_flags |= FTS_DONTCHDIR; michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Remove inclusion of system because RPM uses its own glob(3) michael@13: | implementation and this can conflict with the system one. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmio/rpmio.h michael@13: --- rpmio/rpmio.h 12 Jun 2003 18:22:18 -0000 1.1.1.7 michael@13: +++ rpmio/rpmio.h 22 Jan 2004 21:42:33 -0000 1.2 michael@13: @@ -9,9 +9,6 @@ michael@13: #include michael@13: #include michael@13: #include michael@13: -/*@-noparams@*/ michael@13: -#include michael@13: -/*@=noparams@*/ michael@13: #include michael@13: #include michael@13: #include michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Make this whole "dirent" fiddling at least working on michael@13: | FreeBSD/NetBSD/OpenBSD, Solaris, HPUX and Unixware. This certainly michael@13: | is a bad corner of RPM which inherently leads to portability michael@13: | problems. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmio/rpmrpc.c michael@13: --- rpmio/rpmrpc.c 29 May 2003 22:14:04 -0000 1.1.1.8 michael@13: +++ rpmio/rpmrpc.c 8 Jun 2005 13:16:26 -0000 1.5 michael@13: @@ -1079,6 +1079,8 @@ michael@13: return rc; michael@13: } michael@13: michael@13: +#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(sun) && !defined(OPENPKG_DARWIN) michael@13: + michael@13: struct __dirstream { michael@13: int fd; /* File descriptor. */ michael@13: char * data; /* Directory block. */ michael@13: @@ -1091,6 +1093,8 @@ michael@13: #endif michael@13: }; michael@13: michael@13: +#endif michael@13: + michael@13: #if !defined(DT_DIR) michael@13: # define DT_UNKNOWN 0 michael@13: # define DT_FIFO 1 michael@13: @@ -1101,14 +1105,30 @@ michael@13: # define DT_LNK 10 michael@13: # define DT_SOCK 12 michael@13: # define DT_WHT 14 michael@13: -typedef struct __dirstream * FTPDIR; michael@13: -#else michael@13: -typedef DIR * FTPDIR; michael@13: #endif michael@13: michael@13: +struct mydirstreament { michael@13: + unsigned char type; michael@13: + char *name; michael@13: +}; michael@13: +struct mydirstream { michael@13: + DIR dir; michael@13: + struct dirent ent; michael@13: + unsigned int offset; michael@13: + unsigned int size; michael@13: + struct mydirstreament av[1]; michael@13: +}; michael@13: +typedef struct mydirstream *FTPDIR; michael@13: + michael@13: /*@unchecked@*/ michael@13: static int ftpmagicdir = 0x8440291; michael@13: -#define ISFTPMAGIC(_dir) (!memcmp((_dir), &ftpmagicdir, sizeof(ftpmagicdir))) michael@13: +#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(sun) && !defined(OPENPKG_UNIXWARE) && !defined(OPENPKG_DARWIN) && !defined(__osf__) && !defined(OPENPKG_IRIX64) && !defined(OPENPKG_HPUX) && !defined(OPENPKG_AIX) michael@13: +#define SETFTPMAGIC(_dir) ((_dir)->fd) = ftpmagicdir michael@13: +#define ISFTPMAGIC(_dir) ((_dir)->fd == ftpmagicdir) michael@13: +#else michael@13: +#define SETFTPMAGIC(_dir) ((_dir)->dd_fd) = ftpmagicdir michael@13: +#define ISFTPMAGIC(_dir) ((_dir)->dd_fd == ftpmagicdir) michael@13: +#endif michael@13: michael@13: /*@-boundswrite@*/ michael@13: /*@-type@*/ /* FIX: abstract DIR */ michael@13: @@ -1121,8 +1141,7 @@ michael@13: struct dirent * dp; michael@13: size_t nb; michael@13: const char * s, * sb, * se; michael@13: - const char ** av; michael@13: - unsigned char * dt; michael@13: + struct mydirstreament * av; michael@13: char * t; michael@13: int ac; michael@13: int c; michael@13: @@ -1165,28 +1184,22 @@ michael@13: } michael@13: } michael@13: michael@13: - nb += sizeof(*mydir) + sizeof(*dp) + ((ac + 1) * sizeof(*av)) + (ac + 1); michael@13: + nb = sizeof(*mydir) + (ac * sizeof(*av)) + nb; michael@13: mydir = xcalloc(1, nb); michael@13: /*@-abstract@*/ michael@13: - dp = (struct dirent *) (mydir + 1); michael@13: - av = (const char **) (dp + 1); michael@13: - dt = (char *) (av + (ac + 1)); michael@13: - t = (char *) (dt + ac + 1); michael@13: + dp = &mydir->ent; michael@13: + av = &mydir->av[0]; michael@13: + t = (char *)&mydir->av[ac+1]; michael@13: /*@=abstract@*/ michael@13: michael@13: - mydir->fd = ftpmagicdir; michael@13: -/*@-usereleased@*/ michael@13: - mydir->data = (char *) dp; michael@13: -/*@=usereleased@*/ michael@13: - mydir->allocation = nb; michael@13: - mydir->size = ac; michael@13: - mydir->offset = -1; michael@13: - mydir->filepos = 0; michael@13: + SETFTPMAGIC((DIR *)mydir); michael@13: + mydir->size = ac; michael@13: + mydir->offset = 0; michael@13: michael@13: ac = 0; michael@13: /*@-dependenttrans -unrecog@*/ michael@13: - dt[ac] = DT_DIR; av[ac++] = t; t = stpcpy(t, "."); t++; michael@13: - dt[ac] = DT_DIR; av[ac++] = t; t = stpcpy(t, ".."); t++; michael@13: + av[ac].type = DT_DIR; av[ac].name = t; t = stpcpy(t, "."); ++ac; michael@13: + av[ac].type = DT_DIR; av[ac].name = t; t = stpcpy(t, ".."); ++ac; michael@13: /*@=dependenttrans =unrecog@*/ michael@13: sb = NULL; michael@13: s = se = ftpBuf; michael@13: @@ -1198,34 +1211,34 @@ michael@13: /*@switchbreak@*/ break; michael@13: case '\r': michael@13: /*@-dependenttrans@*/ michael@13: - av[ac] = t; michael@13: + av[ac].name = t; michael@13: /*@=dependenttrans@*/ michael@13: if (sb == NULL) { michael@13: /*@-unrecog@*/ michael@13: switch(*s) { michael@13: case 'p': michael@13: - dt[ac] = DT_FIFO; michael@13: + av[ac].type = DT_FIFO; michael@13: /*@innerbreak@*/ break; michael@13: case 'c': michael@13: - dt[ac] = DT_CHR; michael@13: + av[ac].type = DT_CHR; michael@13: /*@innerbreak@*/ break; michael@13: case 'd': michael@13: - dt[ac] = DT_DIR; michael@13: + av[ac].type = DT_DIR; michael@13: /*@innerbreak@*/ break; michael@13: case 'b': michael@13: - dt[ac] = DT_BLK; michael@13: + av[ac].type = DT_BLK; michael@13: /*@innerbreak@*/ break; michael@13: case '-': michael@13: - dt[ac] = DT_REG; michael@13: + av[ac].type = DT_REG; michael@13: /*@innerbreak@*/ break; michael@13: case 'l': michael@13: - dt[ac] = DT_LNK; michael@13: + av[ac].type = DT_LNK; michael@13: /*@innerbreak@*/ break; michael@13: case 's': michael@13: - dt[ac] = DT_SOCK; michael@13: + av[ac].type = DT_SOCK; michael@13: /*@innerbreak@*/ break; michael@13: default: michael@13: - dt[ac] = DT_UNKNOWN; michael@13: + av[ac].type = DT_UNKNOWN; michael@13: /*@innerbreak@*/ break; michael@13: } michael@13: /*@=unrecog@*/ michael@13: @@ -1243,7 +1256,7 @@ michael@13: /*@switchbreak@*/ break; michael@13: } michael@13: } michael@13: - av[ac] = NULL; michael@13: + av[ac].name = NULL; michael@13: michael@13: /*@-kepttrans@*/ michael@13: return (DIR *) mydir; michael@13: @@ -1258,43 +1271,50 @@ michael@13: { michael@13: FTPDIR mydir = (FTPDIR)dir; michael@13: struct dirent * dp; michael@13: - const char ** av; michael@13: - unsigned char * dt; michael@13: + struct mydirstreament * av; michael@13: int ac; michael@13: int i; michael@13: michael@13: /*@+voidabstract@*/ michael@13: - if (mydir == NULL || !ISFTPMAGIC(mydir) || mydir->data == NULL) { michael@13: + if (dir == NULL || !ISFTPMAGIC(dir)) { michael@13: /* XXX TODO: EBADF errno. */ michael@13: return NULL; michael@13: } michael@13: /*@=voidabstract@*/ michael@13: michael@13: - dp = (struct dirent *) mydir->data; michael@13: - av = (const char **) (dp + 1); michael@13: + dp = &mydir->ent; michael@13: + av = &mydir->av[0]; michael@13: ac = mydir->size; michael@13: - dt = (char *) (av + (ac + 1)); michael@13: - i = mydir->offset + 1; michael@13: + i = mydir->offset + 1; michael@13: michael@13: /*@-boundsread@*/ michael@13: - if (i < 0 || i >= ac || av[i] == NULL) michael@13: + if (i < 0 || i >= ac || av[i].name == NULL) michael@13: return NULL; michael@13: /*@=boundsread@*/ michael@13: michael@13: mydir->offset = i; michael@13: michael@13: +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENPKG_DARWIN) michael@13: + dp->d_ino = i + 1; michael@13: + dp->d_reclen = 0; michael@13: + dp->d_type = av[i].type; michael@13: + strncpy(dp->d_name, av[i].name, sizeof(dp->d_name) - 1); michael@13: + dp->d_name[sizeof(dp->d_name)-1] = '\0'; michael@13: + dp->d_namlen = strlen(dp->d_name); michael@13: +#elif defined(OPENPKG_HPUX) || defined(sun) || defined(OPENPKG_UNIXWARE) || defined(__osf__) || defined(OPENPKG_IRIX64) || defined(OPENPKG_AIX) michael@13: + /* XXX glob(3) uses REAL_DIR_ENTRY(dp) test on d_ino */ michael@13: + dp->d_ino = i + 1; /* W2DO? */ michael@13: + dp->d_reclen = 0; /* W2DO? */ michael@13: + strncpy(dp->d_name, av[i].name, sizeof(dp->d_name)); michael@13: +#else michael@13: /* XXX glob(3) uses REAL_DIR_ENTRY(dp) test on d_ino */ michael@13: dp->d_ino = i + 1; /* W2DO? */ michael@13: dp->d_reclen = 0; /* W2DO? */ michael@13: - michael@13: -#if !defined(hpux) && !defined(sun) michael@13: dp->d_off = 0; /* W2DO? */ michael@13: -/*@-boundsread@*/ michael@13: - dp->d_type = dt[i]; michael@13: -/*@=boundsread@*/ michael@13: + dp->d_type = av[i].type; michael@13: + strncpy(dp->d_name, av[i].name, sizeof(dp->d_name)); michael@13: #endif michael@13: michael@13: - strncpy(dp->d_name, av[i], sizeof(dp->d_name)); michael@13: /*@+voidabstract@*/ michael@13: if (_ftp_debug) michael@13: fprintf(stderr, "*** ftpReaddir(%p) %p \"%s\"\n", (void *)mydir, dp, dp->d_name); michael@13: @@ -1313,7 +1333,7 @@ michael@13: /*@+voidabstract@*/ michael@13: if (_ftp_debug) michael@13: fprintf(stderr, "*** ftpClosedir(%p)\n", (void *)mydir); michael@13: - if (mydir == NULL || !ISFTPMAGIC(mydir)) { michael@13: + if (dir == NULL || !ISFTPMAGIC(dir)) { michael@13: /* XXX TODO: EBADF errno. */ michael@13: return -1; michael@13: } michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Remove inclusion of ancient (and since years deprecated) michael@13: | header. This especially makes sure RPM build does not break on michael@13: | strict platforms like FreeBSD 5. michael@13: +--------------------------------------------------------------------------- michael@13: Index: system.h michael@13: --- system.h 1 Mar 2003 19:53:08 -0000 1.1.1.10 michael@13: +++ system.h 8 Jun 2005 13:15:16 -0000 1.4 michael@13: @@ -256,10 +256,6 @@ michael@13: #include michael@13: #endif michael@13: michael@13: -#if HAVE_MALLOC_H && !defined(__LCLINT__) michael@13: -#include michael@13: -#endif michael@13: - michael@13: /*@-declundef -incondefs @*/ /* FIX: these are macros */ michael@13: /** michael@13: */ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Add support for BSD getmntinfo(3). michael@13: +--------------------------------------------------------------------------- michael@13: Index: system.h michael@13: --- system.h 1 Mar 2003 19:53:08 -0000 1.1.1.10 michael@13: +++ system.h 8 Jun 2005 13:15:16 -0000 1.4 michael@336: @@ -546,7 +546,7 @@ michael@13: #define lchown chown michael@13: #endif michael@13: michael@13: -#if HAVE_GETMNTINFO_R || HAVE_MNTCTL michael@13: +#if HAVE_GETMNTINFO_R || HAVE_GETMNTINFO || HAVE_MNTCTL michael@13: # define GETMNTENT_ONE 0 michael@13: # define GETMNTENT_TWO 0 michael@13: # if HAVE_SYS_MNTCTL_H michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Drop GCC "inline" attribute if not compiling with GCC. michael@13: +--------------------------------------------------------------------------- michael@13: Index: system.h michael@13: --- system.h 1 Mar 2003 19:53:08 -0000 1.1.1.10 michael@13: +++ system.h 8 Jun 2005 13:15:16 -0000 1.4 michael@336: @@ -599,11 +599,24 @@ michael@13: michael@13: #if defined(__LCLINT__) michael@13: #define FILE_RCSID(id) michael@13: -#else michael@13: +#elif defined(__GNUC__) michael@13: #define FILE_RCSID(id) \ michael@13: static inline const char *rcsid(const char *p) { \ michael@13: return rcsid(p = id); \ michael@13: } michael@13: +#else michael@13: +#define FILE_RCSID(id) \ michael@13: +static const char *rcsid(const char *p) { \ michael@13: + return rcsid(p = id); \ michael@13: +} michael@13: +#endif michael@13: + michael@13: +/* for basename(3) and dirname(3) */ michael@13: +#if !defined(OPENPKG_AIX) michael@13: +#include michael@13: +#endif michael@13: +#if defined(OPENPKG_AIX) michael@13: +#define unsetenv(x) /* unsetenv() is used in RPM just for malloc debugging purposes */ michael@13: #endif michael@13: michael@13: #endif /* H_SYSTEM */ michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Remove GCC'ism. michael@13: +--------------------------------------------------------------------------- michael@13: Index: build/rpmfile.h michael@13: --- build/rpmfile.h 24 Jan 2003 19:41:56 -0000 1.1.1.1 michael@13: +++ build/rpmfile.h 22 Jan 2004 21:42:14 -0000 1.2 michael@13: @@ -95,7 +95,11 @@ michael@13: } value; /* either number or string */ michael@13: uint32_t mask; /* mask before comparison with value */ michael@13: char desc[MAXDESC]; /* description */ michael@13: +#if defined(__GNUC__) michael@13: } __attribute__((__packed__)); michael@13: +#else michael@13: +}; michael@13: +#endif michael@13: michael@13: #define BIT(A) (1 << (A)) michael@13: #define STRING_IGNORE_LOWERCASE BIT(0) michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Better portability for madvise(2) usage. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmdb/legacy.c michael@13: --- rpmdb/legacy.c 18 Dec 2002 22:40:19 -0000 1.1.1.4 michael@13: +++ rpmdb/legacy.c 22 Jan 2004 21:42:30 -0000 1.2 michael@13: @@ -182,7 +182,7 @@ michael@13: break; michael@13: } michael@13: michael@13: -#ifdef MADV_SEQUENTIAL michael@13: +#if defined(HAVE_MADVISE) && defined(MADV_SEQUENTIAL) michael@13: xx = madvise(mapped, fsize, MADV_SEQUENTIAL); michael@13: #endif michael@13: michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Better portability for madvise(2) usage. michael@13: +--------------------------------------------------------------------------- michael@13: Index: lib/fsm.c michael@13: --- lib/fsm.c 3 Mar 2003 21:28:12 -0000 1.1.1.5 michael@13: +++ lib/fsm.c 22 Jan 2004 21:42:23 -0000 1.2 michael@13: @@ -879,7 +879,7 @@ michael@13: rdbuf = fsm->rdbuf; michael@13: fsm->rdbuf = (char *) mapped; michael@13: fsm->rdlen = nmapped = st->st_size; michael@13: -#if defined(MADV_DONTNEED) michael@13: +#if defined(HAVE_MADVISE) && defined(MADV_DONTNEED) michael@13: xx = madvise(mapped, nmapped, MADV_DONTNEED); michael@13: #endif michael@13: } michael@13: @@ -909,7 +909,7 @@ michael@13: #if HAVE_MMAP michael@13: if (mapped != (void *)-1) { michael@13: xx = msync(mapped, nmapped, MS_ASYNC); michael@13: -#if defined(MADV_DONTNEED) michael@13: +#if defined(HAVE_MADVISE) && defined(MADV_DONTNEED) michael@13: xx = madvise(mapped, nmapped, MADV_DONTNEED); michael@13: #endif michael@13: /*@-noeffect@*/ xx = munmap(mapped, nmapped) /*@=noeffect@*/; michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Support UnixWare 7.1.3 and OpenDarwin 6.6.2, too. michael@13: +--------------------------------------------------------------------------- michael@13: Index: aclocal.m4 michael@13: --- aclocal.m4 16 Jul 2003 17:05:28 -0000 1.1.1.10 michael@13: +++ aclocal.m4 6 Jun 2005 15:53:03 -0000 1.4 michael@13: @@ -2838,7 +2838,7 @@ michael@13: runpath_var=LD_RUN_PATH michael@13: ;; michael@13: michael@13: - sysv5uw7* | unixware7*) michael@13: + sysv5uw7* | unixware7* | sysv5UnixWare7* ) michael@13: no_undefined_flag='${wl}-z ${wl}text' michael@13: if test "$GCC" = yes; then michael@13: archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' michael@13: @@ -4311,6 +4311,7 @@ michael@13: ;; michael@13: *) # Darwin 1.3 on michael@13: lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' michael@13: + lt_cv_deplibs_check_method=pass_all michael@13: ;; michael@13: esac michael@13: ;; michael@13: @@ -4336,7 +4337,7 @@ michael@13: ;; michael@13: michael@13: hpux10.20*|hpux11*) michael@13: - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' michael@13: + lt_cv_deplibs_check_method='pass_all' michael@13: lt_cv_file_magic_cmd=/usr/bin/file michael@13: lt_cv_file_magic_test_file=/usr/lib/libc.sl michael@13: ;; michael@13: @@ -4375,11 +4376,7 @@ michael@13: ;; michael@13: michael@13: netbsd*) michael@13: - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then michael@13: - lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$' michael@13: - else michael@13: - lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$' michael@13: - fi michael@13: + lt_cv_deplibs_check_method='pass_all' michael@13: ;; michael@13: michael@13: newos6*) michael@13: @@ -4414,7 +4411,7 @@ michael@13: lt_cv_file_magic_test_file=/lib/libc.so michael@13: ;; michael@13: michael@13: -sysv5uw[[78]]* | sysv4*uw2*) michael@13: +sysv5uw[[78]]* | sysv4*uw2* | sysv5UnixWare7* ) michael@13: lt_cv_deplibs_check_method=pass_all michael@13: ;; michael@13: michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Use Linux i386 assembly specific stuff on Linux only. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmio/rpmsw.c michael@13: --- rpmio/rpmsw.c 5 Jun 2003 12:04:05 -0000 1.1.1.1 michael@13: +++ rpmio/rpmsw.c 22 Jan 2004 21:42:33 -0000 1.2 michael@13: @@ -27,7 +27,7 @@ michael@13: /*@unchecked@*/ michael@13: static int rpmsw_initialized = 0; michael@13: michael@13: -#if defined(__i386__) michael@13: +#if defined(__linux__) && defined(__i386__) michael@13: /* Swiped from glibc-2.3.2 sysdeps/i386/i686/hp-timing.h */ michael@13: michael@13: #define HP_TIMING_ZERO(Var) (Var) = (0) michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Fix "environ" declaration. michael@13: +--------------------------------------------------------------------------- michael@13: Index: lib/signature.c michael@13: --- lib/signature.c 29 May 2003 18:42:23 -0000 1.1.1.23 michael@13: +++ lib/signature.c 22 Jan 2004 21:42:25 -0000 1.2 michael@13: @@ -27,7 +27,7 @@ michael@13: /*@access pgpDigParams@*/ michael@13: michael@13: #if !defined(__GLIBC__) michael@13: -char ** environ = NULL; michael@13: +extern char ** environ; michael@13: #endif michael@13: michael@13: int rpmLookupSignatureType(int action) michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Rename own mergesort(3) implementation to avoid conflicts michael@13: | with a possibly existing vendor version. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmdb/merge.c michael@13: --- rpmdb/merge.c 22 Jun 2002 18:51:58 -0000 1.1.1.2 michael@13: +++ rpmdb/merge.c 22 Jan 2004 21:42:30 -0000 1.2 michael@13: @@ -204,7 +204,7 @@ michael@13: * Arguments are as for qsort. michael@13: */ michael@13: int michael@13: -mergesort(void *base, size_t nmemb, size_t size, michael@13: +rpmdb_mergesort(void *base, size_t nmemb, size_t size, michael@13: int (*cmp) (const void *, const void *)) michael@13: { michael@13: register int i, sense; michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Rename own mergesort(3) implementation to avoid conflicts michael@13: | with a possibly existing vendor version. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmdb/rpmdb.h michael@13: --- rpmdb/rpmdb.h 18 Jan 2003 14:04:35 -0000 1.1.1.5 michael@13: +++ rpmdb/rpmdb.h 22 Jan 2004 21:42:31 -0000 1.2 michael@13: @@ -1080,7 +1080,7 @@ michael@13: * Mergesort, same arguments as qsort(2). michael@13: */ michael@13: /*@unused@*/ michael@13: -int mergesort(void *base, size_t nmemb, size_t size, michael@13: +int rpmdb_mergesort(void *base, size_t nmemb, size_t size, michael@13: int (*cmp) (const void *, const void *)) michael@13: /*@globals errno @*/ michael@13: /*@modifies base, errno @*/; michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Rename own mergesort(3) implementation to avoid conflicts michael@13: | with a possibly existing vendor version. michael@13: +--------------------------------------------------------------------------- michael@13: Index: rpmdb/rpmdb.c michael@13: --- rpmdb/rpmdb.c 2 Jul 2003 19:21:54 -0000 1.1.1.6 michael@13: +++ rpmdb/rpmdb.c 22 Jan 2004 21:42:30 -0000 1.2 michael@13: @@ -2361,7 +2361,7 @@ michael@13: sizeof(*mi->mi_set->recs), hdrNumCmp); michael@13: /*@=boundsread@*/ michael@13: #else michael@13: - mergesort(mi->mi_set->recs, mi->mi_set->count, michael@13: + rpmdb_mergesort(mi->mi_set->recs, mi->mi_set->count, michael@13: sizeof(*mi->mi_set->recs), hdrNumCmp); michael@13: #endif michael@13: mi->mi_sorted = 1; michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Workaround a double-inclusion problem under AIX. michael@13: +--------------------------------------------------------------------------- michael@13: Index: lib/getdate.y michael@13: --- lib/getdate.y 24 Sep 2001 21:53:15 -0000 1.1.1.2 michael@13: +++ lib/getdate.y 8 Jun 2005 13:16:22 -0000 1.2 michael@13: @@ -30,7 +30,9 @@ michael@13: #undef static michael@13: #endif michael@13: michael@13: +#ifndef OPENPKG_AIX michael@13: #include michael@13: +#endif michael@13: #include michael@13: michael@13: /* The code at the top of get_date which figures out the offset of the michael@13: michael@13: +--------------------------------------------------------------------------- michael@13: | Workaround a double-inclusion problem under AIX. michael@13: +--------------------------------------------------------------------------- michael@13: Index: lib/getdate.c michael@13: --- lib/getdate.c 2 Jul 2003 19:21:45 -0000 1.1.1.4 michael@13: +++ lib/getdate.c 8 Jun 2005 13:16:21 -0000 1.2 michael@13: @@ -50,7 +50,9 @@ michael@13: #undef static michael@13: #endif michael@13: michael@13: +#ifndef OPENPKG_AIX michael@13: #include michael@13: +#endif michael@13: #include michael@13: michael@13: /* The code at the top of get_date which figures out the offset of the michael@14: michael@14: +--------------------------------------------------------------------------- michael@14: | The following patch works around a general failure of RPM to michael@14: | adhere to the ISO C standard, for which newer GCC releases claim michael@14: | compile errors and fail. michael@14: +--------------------------------------------------------------------------- michael@14: Index: misc/err.h michael@14: --- misc/err.h 2009-01-06 22:48:16.104430941 +0100 michael@14: +++ misc/err.h 2009-01-06 22:47:55.944312482 +0100 michael@14: @@ -29,31 +29,4 @@ michael@14: # define __gnuc_va_list __ptr_t michael@14: #endif michael@14: michael@14: -__BEGIN_DECLS michael@14: - michael@14: -/* Print "program: ", FORMAT, ": ", the standard error string for errno, michael@14: - and a newline, on stderr. */ michael@14: -extern void warn __P ((__const char *__format, ...)) michael@14: - __attribute__ ((__format__ (__printf__, 1, 2))); michael@14: -extern void vwarn __P ((__const char *__format, __gnuc_va_list)) michael@14: - __attribute__ ((__format__ (__printf__, 1, 0))); michael@14: - michael@14: -/* Likewise, but without ": " and the standard error string. */ michael@14: -extern void warnx __P ((__const char *__format, ...)) michael@14: - __attribute__ ((__format__ (__printf__, 1, 2))); michael@14: -extern void vwarnx __P ((__const char *__format, __gnuc_va_list)) michael@14: - __attribute__ ((__format__ (__printf__, 1, 0))); michael@14: - michael@14: -/* Likewise, and then exit with STATUS. */ michael@14: -extern void err __P ((int __status, __const char *__format, ...)) michael@14: - __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3))); michael@14: -extern void verr __P ((int __status, __const char *__format, __gnuc_va_list)) michael@14: - __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); michael@14: -extern void errx __P ((int __status, __const char *__format, ...)) michael@14: - __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3))); michael@14: -extern void verrx __P ((int __status, __const char *, __gnuc_va_list)) michael@14: - __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); michael@14: - michael@14: -__END_DECLS michael@14: - michael@14: #endif /* err.h */