From 25f00b6cb5839b45e7c5f6ff09d57a72e632c67d809690c581d986111a4112de Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 28 Aug 2009 13:54:03 +0000 Subject: [PATCH] Accepting request 18841 from Base:System Copy from Base:System/rpm based on submit request 18841 from user mlschroe OBS-URL: https://build.opensuse.org/request/show/18841 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpm?expand=0&rev=84 --- autodeps.diff | 5 +- baselibs.conf | 4 - brp.diff | 38 +- build.diff | 443 +------- buildidprov.diff | 2 +- chownwarn.diff | 12 +- convertdb1static.diff | 400 ++++++- dbfsync.diff | 30 +- dbprivate.diff | 12 +- dbrointerruptable.diff | 22 +- debugedit-canon-fix.diff | 286 +---- debugedit-comp-dir.diff | 8 +- debugedit.diff | 45 +- debuglink.diff | 6 +- debugsource-package.diff | 16 +- debugsubpkg.diff | 104 +- diskspace.diff | 2 +- disttag-macro.diff | 16 +- elfflagreqprov.diff | 12 - extcond.diff | 47 +- files.diff | 10 +- findfplistexclude.diff | 114 -- findksyms.diff | 24 + findlang.diff | 46 +- fingerprint.diff | 24 - globlstat.diff | 20 - legacyprereq.diff | 16 - localetag.diff | 161 ++- luaroot.diff | 42 +- lzma-payload-2.diff | 454 -------- lzma-payload.diff | 116 -- macrosin.diff | 66 +- mimetype.diff | 6 +- missingok.diff | 14 +- modalias.diff | 16 +- nameversioncompare.diff | 16 +- nodefattr.diff | 2 +- patchrpms.diff | 745 ------------ platformin.diff | 28 +- popt-to-lib.diff | 32 - refreshtestarch.diff | 25 +- remove-brp-strips.diff | 12 +- requires-ge-macro.diff | 2 +- rpm-4.4.2.3-db.tar.bz2 | 3 + rpm-4.4.2.3.tar.bz2 | 3 - rpm-4.7.1.tar.bz2 | 3 + rpm-beecrypt.diff | 1835 ++++++++++++++++++++++++++++++ rpm-filelist-bufferoverflow.diff | 12 - rpm-python.spec | 10 +- rpm-shorten-changelog.diff | 31 +- rpm.changes | 10 + rpm.spec | 274 ++--- rpmpopt.diff | 74 +- rpmqpack.diff | 51 +- rpmrc.diff | 91 +- rpmrctests.diff | 10 +- specfilemacro.diff | 14 +- suspendlock.diff | 61 +- taggedfileindex.diff | 212 ++-- tagsbackport.diff | 37 - waitlock.diff | 82 +- weakdeps.diff | 230 ++-- whatrequires-doc.diff | 12 +- xz.diff | 86 -- 64 files changed, 3179 insertions(+), 3463 deletions(-) delete mode 100644 baselibs.conf delete mode 100644 elfflagreqprov.diff delete mode 100644 findfplistexclude.diff delete mode 100644 fingerprint.diff delete mode 100644 globlstat.diff delete mode 100644 legacyprereq.diff delete mode 100644 lzma-payload-2.diff delete mode 100644 lzma-payload.diff delete mode 100644 patchrpms.diff delete mode 100644 popt-to-lib.diff create mode 100644 rpm-4.4.2.3-db.tar.bz2 delete mode 100644 rpm-4.4.2.3.tar.bz2 create mode 100644 rpm-4.7.1.tar.bz2 create mode 100644 rpm-beecrypt.diff delete mode 100644 rpm-filelist-bufferoverflow.diff delete mode 100644 tagsbackport.diff delete mode 100644 xz.diff diff --git a/autodeps.diff b/autodeps.diff index 0a791aa..ffcf061 100644 --- a/autodeps.diff +++ b/autodeps.diff @@ -223,7 +223,7 @@ Index: autodeps/linux.req /^$/ { START=0; } /^Dynamic Section:$/ { START=1; } (START==1) && /NEEDED/ { -@@ -110,26 +114,37 @@ for f in $liblist $exelist ; do +@@ -111,7 +115,7 @@ for f in $liblist $exelist ; do sub(/:/, "", $3); LIBNAME=$3; } @@ -231,9 +231,8 @@ Index: autodeps/linux.req + (START==2) && (LIBNAME!="") && ($4!="") { print LIBNAME "(" $4 ")'$lib64'"; } -- /^[A-Za-z]/ { START=3; } ' - done | sort -u +@@ -119,17 +123,29 @@ done | sort -u # # --- Perl modules. diff --git a/baselibs.conf b/baselibs.conf deleted file mode 100644 index 5f85cd9..0000000 --- a/baselibs.conf +++ /dev/null @@ -1,4 +0,0 @@ -popt -rpm -arch ppc package popt-devel -arch ppc package rpm-devel diff --git a/brp.diff b/brp.diff index 74e65e0..3f7a341 100644 --- a/brp.diff +++ b/brp.diff @@ -47,18 +47,6 @@ Index: scripts/brp-lib64-linux + fi +done +exit 0 -Index: scripts/brp-sparc64-linux -=================================================================== ---- scripts/brp-sparc64-linux.orig -+++ scripts/brp-sparc64-linux -@@ -6,6 +6,7 @@ fi - files= - LC_ALL= - LANG= -+LC_TIME=POSIX - - # Move 64bit ELF objects from /lib, /usr/lib, /usr/X11R6/lib to */lib64 - # directories Index: scripts/brp-strip =================================================================== --- scripts/brp-strip.orig @@ -273,3 +261,29 @@ Index: scripts/brp-symlink +if test "$had_errors" = 1; then + exit 1 +fi +Index: scripts/Makefile.am +=================================================================== +--- scripts/Makefile.am.orig ++++ scripts/Makefile.am +@@ -6,8 +6,10 @@ CLEANFILES = + + EXTRA_DIST = \ + brp-compress brp-python-bytecompile brp-java-gcjcompile \ ++ brp-lib64-linux \ + brp-strip brp-strip-comment-note \ + brp-strip-shared brp-strip-static-archive \ ++ brp-symlink \ + check-files check-prereqs \ + check-buildroot check-rpaths check-rpaths-worker \ + find-debuginfo.sh find-lang.sh \ +@@ -23,8 +25,10 @@ EXTRA_DIST = \ + + rpmconfig_SCRIPTS = \ + brp-compress brp-python-bytecompile brp-java-gcjcompile \ ++ brp-lib64-linux \ + brp-strip brp-strip-comment-note \ + brp-strip-shared brp-strip-static-archive \ ++ brp-symlink \ + check-files check-prereqs \ + check-buildroot check-rpaths check-rpaths-worker \ + find-lang.sh \ diff --git a/build.diff b/build.diff index a1b5a7a..7aa43dc 100644 --- a/build.diff +++ b/build.diff @@ -15,272 +15,11 @@ on SUSE systems. scripts/Makefile.am | 8 ++ 11 files changed, 132 insertions(+), 82 deletions(-) -Index: autogen.sh -=================================================================== ---- autogen.sh.orig -+++ autogen.sh -@@ -26,12 +26,12 @@ case $libtoolize in - esac - esac - --[ "`$libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1 --[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1 --[ "`automake --version | head -1 | sed -e 's/1\.4[a-z]/1.4/'`" != "$AMV" ] && echo "$USAGE" # && exit 1 -+#[ "`$libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1 -+#[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1 -+#[ "`automake --version | head -1 | sed -e 's/1\.4[a-z]/1.4/'`" != "$AMV" ] && echo "$USAGE" # && exit 1 - - myopts= --if [ X"$@" = X -a "X`uname -s`" = "XDarwin" -a -d /opt/local ]; then -+if [ X"$*" = X -a "X`uname -s`" = "XDarwin" -a -d /opt/local ]; then - export myopts="--prefix=/usr --disable-nls" - export CPPFLAGS="-I${myprefix}/include" - fi -@@ -49,10 +49,11 @@ if [ -d zlib ]; then - (echo "--- zlib"; cd zlib; ./autogen.sh --noconfigure "$@") - fi - if [ -d beecrypt ]; then -- (echo "--- beecrypt"; cd beecrypt; ./autogen.sh --noconfigure "$@") -+ #(echo "--- beecrypt"; cd beecrypt; ./autogen.sh --noconfigure "$@") -+ (echo "--- beecrypt"; cd beecrypt; ./autogen.sh --without-cplusplus --without-java --without-python "$@") - fi - if [ -d elfutils ]; then -- (echo "--- elfutils"; cd elfutils; ./autogen.sh --noconfigure "$@") -+ (echo "--- elfutils"; cd elfutils; ./autogen.sh "$@") - fi - if [ -d file ]; then - (echo "--- file"; cd file; ./autogen.sh --noconfigure "$@") -@@ -60,6 +61,7 @@ fi - if [ -d neon ]; then - (echo "--- neon"; cd neon; ./autogen.sh "$@") - fi -+(echo "--- db"; cd db/dist; libtoolize --copy --force ; rm aclocal/libtool.ac ; ./s_config ) - - echo "--- rpm" - $libtoolize --copy --force -@@ -72,7 +74,7 @@ if [ "$1" = "--noconfigure" ]; then - exit 0; - fi - --if [ X"$@" = X -a "X`uname -s`" = "XLinux" ]; then -+if [ X"$*" = X -a "X`uname -s`" = "XLinux" ]; then - if [ -d /usr/share/man ]; then - mandir=/usr/share/man - infodir=/usr/share/info -Index: build/Makefile.am -=================================================================== ---- build/Makefile.am.orig -+++ build/Makefile.am -@@ -22,7 +22,7 @@ pkgincdir = $(pkgincludedir) - pkginc_HEADERS = rpmbuild.h rpmfc.h rpmfile.h rpmspec.h - noinst_HEADERS = buildio.h - --LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir) -+LDFLAGS = - - usrlibdir = $(libdir)@MARK64@ - usrlib_LTLIBRARIES = librpmbuild.la Index: configure.ac =================================================================== --- configure.ac.orig +++ configure.ac -@@ -327,9 +327,9 @@ AC_SUBST(WITH_BZIP2) - localdone= - - dirs=$prefix --if test "$cross_compiling" != "yes"; then -- dirs="$dirs /usr/local" --fi -+#if test "$cross_compiling" != "yes"; then -+# dirs="$dirs /usr/local" -+#fi - for dir in $dirs - do - case $dir in -@@ -430,9 +430,9 @@ WITH_LIBELF_LIB= - AC_CHECK_HEADER([libelf.h]) - AC_CHECK_HEADER([gelf.h], [ - AC_DEFINE(HAVE_GELF_H, 1, [Define to 1 if you have the header file.]) -- AC_CHECK_LIB(elf, gelf_getvernaux, [ -+ AC_CHECK_LIB(elf_pic, gelf_getvernaux, [ - AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).]) -- WITH_LIBELF_LIB="-lelf" -+ WITH_LIBELF_LIB="-lelf_pic" - ]) - ], [ - if test -d elfutils/libelf ; then -@@ -440,7 +440,7 @@ AC_CHECK_HEADER([gelf.h], [ - AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).]) - WITH_ELFUTILS_SUBDIR=elfutils - WITH_LIBELF_INCLUDE="-I\${top_srcdir}/${WITH_ELFUTILS_SUBDIR}/libelf" -- WITH_LIBELF_LIB="\${top_builddir}/${WITH_ELFUTILS_SUBDIR}/libelf/libelf.a" -+ WITH_LIBELF_LIB="\${top_builddir}/${WITH_ELFUTILS_SUBDIR}/libelf/libelf_pic.a" - fi - ]) - AC_SUBST(WITH_ELFUTILS_SUBDIR) -@@ -481,12 +481,13 @@ AC_CHECK_HEADER([beecrypt/beecrypt.h], [ - AC_DEFINE(HAVE_LIBBEECRYPT, 1, [Define to 1 if you have the 'beecrypt' library (-lbeecrypt).]) - WITH_BEECRYPT_SUBDIR=beecrypt - WITH_BEECRYPT_INCLUDE="-I\${top_srcdir}/${WITH_BEECRYPT_SUBDIR}" -- WITH_BEECRYPT_LIB="\${top_builddir}/${WITH_BEECRYPT_SUBDIR}/libbeecrypt.la" -- fi -- -+ dnl WITH_BEECRYPT_LIB="\${top_builddir}/${WITH_BEECRYPT_SUBDIR}/libbeecrypt.la" -+ AC_DEFINE(HAVE_BEECRYPT_API_H, 1, [Define to 1 if you have the header file.]) -+ else - if test -z "${WITH_BEECRYPT_LIB}" ; then - AC_MSG_ERROR([rpm requires beecrypt]) - fi -+ fi - ]) - AC_SUBST(WITH_BEECRYPT_SUBDIR) - AC_SUBST(WITH_BEECRYPT_INCLUDE) -@@ -861,8 +862,23 @@ withval=auto - AC_ARG_WITH(python, [ --with-python build rpm python bindings ]) - - WITH_PYTHON_VERSION=$withval -+ - if test $withval = auto ; then -+AC_MSG_CHECKING(for python 2.6) -+AC_RUN_IFELSE([AC_LANG_SOURCE([[ -+#include -+main() { -+ exit(strncmp("2.6", PY_VERSION, 3)); -+} ]])],[withval=yes],[withval=no],[withval=yes]) -+ AC_MSG_RESULT($withval) -+ if test $withval = yes ; then -+ WITH_PYTHON_VERSION="2.6" -+ else -+ withval=auto -+ fi -+fi - -+if test $withval = auto ; then - AC_MSG_CHECKING(for python 2.5) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include -@@ -873,56 +889,74 @@ main() { - if test $withval = yes ; then - WITH_PYTHON_VERSION="2.5" - else -+ withval=auto -+ fi -+fi - -- AC_MSG_CHECKING(for python 2.4) -- AC_RUN_IFELSE([AC_LANG_SOURCE([[ -- #include -- main() { -- exit(strncmp("2.4", PY_VERSION, 3)); -- } ]])],[withval=yes],[withval=no],[withval=yes]) -- AC_MSG_RESULT($withval) -- if test $withval = yes ; then -- WITH_PYTHON_VERSION="2.4" -- else -- -- AC_MSG_CHECKING(for python 2.3) -- AC_RUN_IFELSE([AC_LANG_SOURCE([[ -- #include -- main() { -- exit(strncmp("2.3", PY_VERSION, 3)); -- } ]])],[withval=yes],[withval=no],[withval=yes]) -- AC_MSG_RESULT($withval) -- if test $withval = yes ; then -- WITH_PYTHON_VERSION="2.3" -- else -- -- AC_MSG_CHECKING(for python 2.2) -- AC_RUN_IFELSE([AC_LANG_SOURCE([[ -- #include -- main() { -- exit(strncmp("2.2", PY_VERSION, 3)); -- } ]])],[withval=yes],[withval=no],[withval=yes]) -- AC_MSG_RESULT($withval) -- if test $withval = yes ; then -- WITH_PYTHON_VERSION="2.2" -- else -- -- AC_MSG_CHECKING(for python 1.5.2) -- AC_RUN_IFELSE([AC_LANG_SOURCE([[ -- #include -- main() { -- exit(strcmp("1.5.2", PY_VERSION)); -- } ]])],[withval=yes],[withval=no],[withval=yes]) -- AC_MSG_RESULT($withval) -- if test $withval = yes ; then -- WITH_PYTHON_VERSION="1.5" -- fi -- fi -- fi -- fi -+if test $withval = auto ; then -+AC_MSG_CHECKING(for python 2.4) -+AC_RUN_IFELSE([AC_LANG_SOURCE([[ -+#include -+main() { -+ exit(strncmp("2.4", PY_VERSION, 3)); -+} ]])],[withval=yes],[withval=no],[withval=yes]) -+ AC_MSG_RESULT($withval) -+ if test $withval = yes ; then -+ WITH_PYTHON_VERSION="2.4" -+ else -+ withval=auto -+ fi -+fi -+ -+if test $withval = auto ; then -+AC_MSG_CHECKING(for python 2.3) -+AC_RUN_IFELSE([AC_LANG_SOURCE([[ -+#include -+main() { -+ exit(strncmp("2.3", PY_VERSION, 3)); -+} ]])],[withval=yes],[withval=no],[withval=yes]) -+ AC_MSG_RESULT($withval) -+ if test $withval = yes ; then -+ WITH_PYTHON_VERSION="2.3" -+ else -+ withval=auto -+ fi -+fi -+ -+if test $withval = auto ; then -+AC_MSG_CHECKING(for python 2.2) -+AC_RUN_IFELSE([AC_LANG_SOURCE([[ -+#include -+main() { -+ exit(strncmp("2.2", PY_VERSION, 3)); -+} ]])],[withval=yes],[withval=no],[withval=yes]) -+ AC_MSG_RESULT($withval) -+ if test $withval = yes ; then -+ WITH_PYTHON_VERSION="2.2" -+ else -+ withval=auto - fi - fi - -+if test $withval = auto ; then -+AC_MSG_CHECKING(for python 1.5.2) -+AC_RUN_IFELSE([AC_LANG_SOURCE([[ -+#include -+main() { -+ exit(strcmp("1.5.2", PY_VERSION)); -+} ]])],[withval=yes],[withval=no],[withval=yes]) -+ AC_MSG_RESULT($withval) -+ if test $withval = yes ; then -+ WITH_PYTHON_VERSION="1.5" -+ else -+ withval=auto -+ fi -+fi -+ -+if test $withval = auto ; then -+ WITH_PYTHON_VERSION="no" -+fi -+ - if test "$WITH_PYTHON_VERSION" != no ; then - WITH_PYTHON_SUBDIR=python - WITH_PYTHON_SUBPACKAGE=1 -@@ -1218,6 +1252,7 @@ arm*) RPMCANONCOLOR=0; RPMCANONARCH=arm +@@ -1009,6 +1009,7 @@ arm*) RPMCANONCOLOR=0; RPMCANONARCH=arm mipsel*) RPMCANONCOLOR=0; RPMCANONARCH=mipsel ;; mips*) RPMCANONCOLOR=0; RPMCANONARCH=mips ;; m68k*) RPMCANONCOLOR=0; RPMCANONARCH=m68k ;; @@ -288,28 +27,24 @@ Index: configure.ac sh3*) RPMCANONCOLOR=0; RPMCANONARCH=sh3 ;; sh4*) RPMCANONCOLOR=0; RPMCANONARCH=sh4 ;; *) RPMCANONCOLOR=0; RPMCANONARCH=unknown ;; -@@ -1227,7 +1262,8 @@ mint) RPMCANONARCH=m68kmint ;; - esac +@@ -1019,6 +1020,7 @@ esac RPMCANONVENDOR="$build_vendor" case "${build_vendor}" in --unknown|pc|ibm|redhat|pld|mandrake|conectiva|lvr|yellowdog|caos) -+unknown|pc|ibm|redhat|pld|mandrake|conectiva|lvr|yellowdog|caos|suse) + unknown|pc|ibm|redhat|pld|mandrake|conectiva|lvr|yellowdog|caos|suse) + RPMCANONVENDOR=suse test -f /etc/redhat-release && RPMCANONVENDOR=redhat + test -f /etc/SuSE-release && RPMCANONVENDOR=suse test -f /etc/pld-release && RPMCANONVENDOR=pld - test -f /etc/mandrake-release && RPMCANONVENDOR=mandrake -@@ -1237,6 +1273,11 @@ unknown|pc|ibm|redhat|pld|mandrake|conec - test -f /etc/caos-release && RPMCANONVENDOR=caos - ;; +@@ -1031,6 +1033,9 @@ unknown|pc|ibm|redhat|pld|mandrake|conec esac + RPMCANONOS="$host_os_noversion" + RPMCANONGNU="$host_os_gnu" +if test "$RPMCANONVENDOR" = suse ; then + RPMCANONCOLOR=0 -+ autorelocate_path='%{nil}' -+ autorelocate_dcolor='0' +fi - RPMCANONOS="$build_os_noversion" - RPMCANONGNU="$build_os_gnu" AC_SUBST(RPMCANONCOLOR) + AC_SUBST(RPMCANONARCH) + AC_SUBST(RPMCANONVENDOR) Index: db3/configure =================================================================== --- db3/configure.orig @@ -322,44 +57,29 @@ Index: db3/configure - --enable-shared --enable-static --enable-rpc \ - --with-uniquename=_rpmdb --srcdir=$db_dist +CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure \ -+ --enable-shared --enable-static \ ++ --enable-shared --enable-static --enable-rpc \ + --with-uniquename=_rpmdb --srcdir=$db_dist $ARGS mv Makefile Makefile.orig cat Makefile.orig | sed -e '/^install[:-]/c\ -Index: file/src/Makefile.am -=================================================================== ---- file/src/Makefile.am.orig -+++ file/src/Makefile.am -@@ -26,7 +26,7 @@ libmagic_la_LDFLAGS = -version-info 1:0: - - noinst_PROGRAMS = file - file_SOURCES = file.c --file_LDFLAGS = -L../../zlib # -all-static -+file_LDFLAGS = # -L../../zlib # -all-static - file_LDADD = libmagic.la - - listobjs: Index: installplatform =================================================================== --- installplatform.orig +++ installplatform -@@ -68,11 +68,11 @@ for SUBST in $SUBSTS ; do - sparc64-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-sparc64-linux; LIB=lib64; MULTILIBNO=2 ;; - sparc64v-linux) ARCH_INSTALL_PORT=${pkglibdir}/brp-sparc64-linux; LIB=lib64; MULTILIBNO=2 ;; - s390-linux) MULTILIBNO=1 ;; -- s390x-linux) LIB=lib64; MULTILIBNO=2 ;; -+ s390x-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-lib64-linux; LIB=lib64; MULTILIBNO=2 ;; - ppc-linux) MULTILIBNO=1 ;; -- ppc64-linux) LIB=lib64; MULTILIBNO=2 ;; -+ ppc64-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-lib64-linux; LIB=lib64; MULTILIBNO=2 ;; - i?86-linux|pentium?-linux|athlon-linux|geode-linux) MULTILIBNO=1 ;; -- x86_64-linux|amd64-linux|ia32e-linux) LIB=lib64; MULTILIBNO=2 ;; -+ x86_64-linux|amd64-linux|ia32e-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-lib64-linux; LIB=lib64; MULTILIBNO=2 ;; +@@ -54,9 +54,9 @@ for SUBST in $SUBSTS ; do + ARCH_INSTALL_POST='%{nil}' + case "${ARCH}-${OS}" in + sparc64*-linux) LIB=lib64 ;; +- s390x-linux) LIB=lib64 ;; +- ppc64-linux|powerpc64-linux) LIB=lib64 ;; +- x86_64-linux|amd64-linux|ia32e-linux) LIB=lib64 ;; ++ s390x-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-lib64-linux ; LIB=lib64 ;; ++ ppc64-linux|powerpc64-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-lib64-linux ; LIB=lib64 ;; ++ x86_64-linux|amd64-linux|ia32e-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-lib64-linux ; LIB=lib64 ;; + *) LIB=lib;; esac - if [ -n "$MULTILIBNO" ]; then -@@ -102,6 +102,9 @@ for SUBST in $SUBSTS ; do +@@ -136,6 +136,9 @@ for SUBST in $SUBSTS ; do apple) VENDORSED='-e s,^@apple@,,' ;; @@ -369,122 +89,3 @@ Index: installplatform esac CANONARCH="`echo $ARCH|sed -e "$canonarch_sed"`" -Index: lib/Makefile.am -=================================================================== ---- lib/Makefile.am.orig -+++ lib/Makefile.am -@@ -29,7 +29,7 @@ noinst_HEADERS = \ - mylibs = librpm.la - LIBS = - --LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir) -+LDFLAGS = - - usrlibdir = $(libdir)@MARK64@ - usrlib_LTLIBRARIES = librpm.la -Index: popt/autogen.sh -=================================================================== ---- popt/autogen.sh.orig -+++ popt/autogen.sh -@@ -28,7 +28,7 @@ fi - - cd "$THEDIR" - --if [ X"$@" = X -a "X`uname -s`" = "XLinux" ]; then -+if [ X"$*" = X -a "X`uname -s`" = "XLinux" ]; then - $srcdir/configure --prefix=/usr "$@" - else - $srcdir/configure "$@" -Index: rpmdb/Makefile.am -=================================================================== ---- rpmdb/Makefile.am.orig -+++ rpmdb/Makefile.am -@@ -31,7 +31,7 @@ noinst_HEADERS = fprint.h header_interna - pkgbindir = @RPMCONFIGDIR@ - pkgbin_PROGRAMS = \ - rpmdb_archive rpmdb_checkpoint rpmdb_deadlock rpmdb_dump rpmdb_load \ -- rpmdb_printlog rpmdb_recover rpmdb_svc rpmdb_stat rpmdb_upgrade \ -+ rpmdb_printlog rpmdb_recover rpmdb_stat rpmdb_upgrade \ - rpmdb_verify - - mylibs = librpmdb.la -@@ -42,7 +42,7 @@ LIBS = - libdb_la = $(top_builddir)/$(WITH_DB_SUBDIR)/libdb.la - - # XXX grrr, RPM_BUILD_ROOT prevents build pollution if/when -lrpm different --LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir) -+LDFLAGS = - - usrlibdir = $(libdir)@MARK64@ - usrlib_LTLIBRARIES = librpmdb.la -Index: rpmio/Makefile.am -=================================================================== ---- rpmio/Makefile.am.orig -+++ rpmio/Makefile.am -@@ -24,9 +24,9 @@ pkginc_HEADERS = \ - rpmsq.h rpmsw.h ugid.h - noinst_HEADERS = rpmio_internal.h rpmlua.h rpmhook.h - --BEECRYPTLOBJS = $(shell test X"@WITH_BEECRYPT_SUBDIR@" != X && cat $(top_builddir)/@WITH_BEECTYPT_SUBDIR@/listobjs) -+BEECRYPTLOBJS = $(shell test X"@WITH_BEECRYPT_SUBDIR@" != X && cat $(top_builddir)/@WITH_BEECRYPT_SUBDIR@/listobjs) - --LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir) -+LDFLAGS = - - usrlibdir = $(libdir)@MARK64@ - usrlib_LTLIBRARIES = librpmio.la -@@ -41,14 +41,14 @@ librpmio_la_LDFLAGS = -release 4.4 $(LDF - @WITH_MAGIC_LIB@ \ - @WITH_ZLIB_LIB@ \ - -lpthread --librpmio_la_LIBADD = # $(BEECRYPTLOBJS) --librpmio_la_DEPENDENCIES = # .created -+librpmio_la_LIBADD = $(BEECRYPTLOBJS) -+librpmio_la_DEPENDENCIES = .created - - .created: - if test X"@WITH_BEECRYPT_SUBDIR@" != X; then \ - ${MAKE} -C $(top_builddir)/@WITH_BEECRYPT_SUBDIR@ listobjs ; \ - for lo in $(BEECRYPTLOBJS); do \ -- [ -f $$lo ] || $(LN_S) $(top_builddir)/@WITH_BEECRYPT_SUBDIR@/$$lo $$lo ; \ -+ [ -f $$lo ] || sed -e "s!'!'$(top_builddir)/beecrypt/!" < $(top_builddir)/beecrypt/$$lo > $$lo ; \ - done \ - fi - touch $@ -Index: scripts/Makefile.am -=================================================================== ---- scripts/Makefile.am.orig -+++ scripts/Makefile.am -@@ -9,6 +9,7 @@ EXTRA_DIST = \ - brp-compress brp-python-bytecompile brp-java-gcjcompile brp-redhat \ - brp-strip brp-strip-comment-note \ - brp-strip-shared brp-strip-static-archive brp-sparc64-linux \ -+ brp-lib64-linux brp-symlink \ - check-files check-prereqs convertrpmrc.sh cross-build \ - check-buildroot check-rpaths check-rpaths-worker \ - find-debuginfo.sh find-lang.sh find-prov.pl find-req.pl \ -@@ -21,7 +22,8 @@ EXTRA_DIST = \ - sql.prov sql.req tcl.req tgpg trpm u_pkg.sh \ - vpkg-provides.sh vpkg-provides2.sh \ - macros.perl* macros.python* \ -- macros.php* find-*.php find-php-* mono-find* osgideps.pl -+ macros.php* find-*.php find-php-* mono-find* osgideps.pl \ -+ find-provides.ksyms find-requires.ksyms - - installprefix = $(DESTDIR) - -@@ -32,6 +34,7 @@ config_SCRIPTS = \ - brp-compress brp-python-bytecompile brp-java-gcjcompile brp-redhat \ - brp-strip brp-strip-comment-note \ - brp-strip-shared brp-strip-static-archive brp-sparc64-linux \ -+ brp-lib64-linux brp-symlink \ - check-files check-prereqs convertrpmrc.sh cross-build \ - check-buildroot check-rpaths check-rpaths-worker \ - find-debuginfo.sh find-lang.sh find-prov.pl find-req.pl \ -@@ -42,4 +45,5 @@ config_SCRIPTS = \ - rpmdb_loadcvt rpmdiff rpmdiff.cgi \ - rpm.daily rpm.log rpm.xinetd rpm2cpio.sh \ - sql.prov sql.req tcl.req tgpg trpm u_pkg.sh \ -- vpkg-provides.sh vpkg-provides2.sh -+ vpkg-provides.sh vpkg-provides2.sh \ -+ find-provides.ksyms find-requires.ksyms diff --git a/buildidprov.diff b/buildidprov.diff index d05c515..6cbc765 100644 --- a/buildidprov.diff +++ b/buildidprov.diff @@ -46,7 +46,7 @@ Index: macros.in =================================================================== --- macros.in.orig +++ macros.in -@@ -175,7 +175,8 @@ +@@ -179,7 +179,8 @@ %package debuginfo\ Summary: Debug information for package %{name}\ Group: Development/Debug\ diff --git a/chownwarn.diff b/chownwarn.diff index 2e1100d..7d56a31 100644 --- a/chownwarn.diff +++ b/chownwarn.diff @@ -4,25 +4,25 @@ Index: lib/fsm.c =================================================================== --- lib/fsm.c.orig +++ lib/fsm.c -@@ -2193,6 +2193,10 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS +@@ -2093,6 +2093,10 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS break; case FSM_CHOWN: rc = chown(fsm->path, st->st_uid, st->st_gid); + if (rc < 0 && errno == EPERM) { -+ rpmMessage(RPMMESS_WARNING, "can't chown %s (%s)\n", fsm->path, strerror(errno)); ++ rpmlog(RPMLOG_WARNING, "can't chown %s (%s)\n", fsm->path, strerror(errno)); + rc = 0; + } if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, %d, %d) %s\n", cur, + rpmlog(RPMLOG_DEBUG, " %8s (%s, %d, %d) %s\n", cur, fsm->path, (int)st->st_uid, (int)st->st_gid, -@@ -2202,6 +2206,10 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS +@@ -2102,6 +2106,10 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS case FSM_LCHOWN: #if ! CHOWN_FOLLOWS_SYMLINK rc = lchown(fsm->path, st->st_uid, st->st_gid); + if (rc < 0 && errno == EPERM) { -+ rpmMessage(RPMMESS_WARNING, "can't lchown %s (%s)\n", fsm->path, strerror(errno)); ++ rpmlog(RPMLOG_WARNING, "can't lchown %s (%s)\n", fsm->path, strerror(errno)); + rc = 0; + } if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, %d, %d) %s\n", cur, + rpmlog(RPMLOG_DEBUG, " %8s (%s, %d, %d) %s\n", cur, fsm->path, (int)st->st_uid, (int)st->st_gid, diff --git a/convertdb1static.diff b/convertdb1static.diff index 2d7a45f..f1ead10 100644 --- a/convertdb1static.diff +++ b/convertdb1static.diff @@ -1,40 +1,368 @@ Build convertdb1, too. -Index: tools/Makefile.am +Index: Makefile.am =================================================================== ---- tools/Makefile.am.orig -+++ tools/Makefile.am -@@ -18,25 +18,29 @@ INCLUDES = -I. \ +--- Makefile.am.orig ++++ Makefile.am +@@ -143,6 +143,10 @@ bin_PROGRAMS += rpmqpack + rpmqpack_SOURCES = rpmqpack.c + rpmqpack_LDADD = lib/librpm.la - EXTRA_DIST = rpminject.c rpmsort.c rpmxml.c rpmxp.c rpmxp.h hashtab.h - --EXTRA_PROGRAMS = debugedit convertdb1 rpminject rpmsort rpmtool rpmxml -+EXTRA_PROGRAMS = rpminject rpmsort rpmtool rpmxml - - LDADD = \ - $(top_builddir)/lib/librpm.la - --staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@ -+staticLDFLAGS = @LDFLAGS_STATIC@ # @LDFLAGS_NPTL@ - - noinst_PROGRAMS = dumpdb - - pkgbindir = @RPMCONFIGDIR@ --pkgbin_PROGRAMS = @WITH_LIBDWARF_DEBUGEDIT@ javadeps rpmcache rpmdeps rpmfile -+pkgbin_PROGRAMS = debugedit javadeps rpmcache rpmdeps rpmfile convertdb1 - MAGIC = $(pkgbindir)/magic - - bin_PROGRAMS = rpmgraph - - convertdb1_SOURCES = convertdb1.c -+#convertdb1_LDFLAGS = $(staticLDFLAGS) -+convertdb1_LDADD = \ -+ $(top_builddir)/lib/librpm.la \ -+ @WITH_LIBELF_LIB@ - - debugedit_SOURCES = debugedit.c hashtab.c --#debugedit_LDADD = @LDFLAGS_STATIC@ \ -+#debugedit_LDADD = @LDFLAGS_STATIC@ - debugedit_LDADD = \ - @WITH_LIBELF_LIB@ \ - $(top_builddir)/rpmdb/librpmdb.la \ ++check_PROGRAMS += convertdb1 ++convertdb1_SOURCES = tools/convertdb1.c ++convertdb1_LDADD = lib/librpm.la ++ + rpmconfig_DATA = rpmrc + rpmrc: $(top_srcdir)/rpmrc.in + @$(SED) \ +Index: tools/convertdb1.c +=================================================================== +--- /dev/null ++++ tools/convertdb1.c +@@ -0,0 +1,346 @@ ++#if defined(HAVE_CONFIG_H) ++#include "system.h" ++const char *__progname; ++#else ++#include ++#include ++#include ++#endif ++ ++#include ++#include ++#include ++#include ++ ++#define FA_MAGIC 0x02050920 ++ ++struct faFileHeader{ ++ unsigned int magic; ++ unsigned int firstFree; ++}; ++ ++struct faHeader { ++ unsigned int size; ++ unsigned int freeNext; /* offset of the next free block, 0 if none */ ++ unsigned int freePrev; ++ unsigned int isFree; ++ ++ /* note that the u16's appear last for alignment/space reasons */ ++}; ++ ++ ++static int fadFileSize; ++ ++static ssize_t Pread(FD_t fd, void * buf, size_t count, off_t offset) { ++ if (Fseek(fd, offset, SEEK_SET) < 0) ++ return -1; ++ return Fread(buf, sizeof(char), count, fd); ++} ++ ++static FD_t fadOpen(const char * path) ++{ ++ struct faFileHeader newHdr; ++ FD_t fd; ++ struct stat stb; ++ ++ fd = Fopen(path, "r.fdio"); ++ if (!fd || Ferror(fd)) ++ return NULL; ++ ++ if (fstat(Fileno(fd), &stb)) { ++ Fclose(fd); ++ return NULL; ++ } ++ fadFileSize = stb.st_size; ++ ++ /* is this file brand new? */ ++ if (fadFileSize == 0) { ++ Fclose(fd); ++ return NULL; ++ } ++ if (Pread(fd, &newHdr, sizeof(newHdr), 0) != sizeof(newHdr)) { ++ Fclose(fd); ++ return NULL; ++ } ++ if (newHdr.magic != FA_MAGIC) { ++ Fclose(fd); ++ return NULL; ++ } ++ /*@-refcounttrans@*/ return fd /*@=refcounttrans@*/ ; ++} ++ ++static int fadNextOffset(FD_t fd, unsigned int lastOffset) ++{ ++ struct faHeader header; ++ int offset; ++ ++ offset = (lastOffset) ++ ? (lastOffset - sizeof(header)) ++ : sizeof(struct faFileHeader); ++ ++ if (offset >= fadFileSize) ++ return 0; ++ ++ if (Pread(fd, &header, sizeof(header), offset) != sizeof(header)) ++ return 0; ++ ++ if (!lastOffset && !header.isFree) ++ return (offset + sizeof(header)); ++ ++ do { ++ offset += header.size; ++ ++ if (Pread(fd, &header, sizeof(header), offset) != sizeof(header)) ++ return 0; ++ ++ if (!header.isFree) break; ++ } while (offset < fadFileSize && header.isFree); ++ ++ if (offset < fadFileSize) { ++ /* Sanity check this to make sure we're not going in loops */ ++ offset += sizeof(header); ++ ++ if (offset <= lastOffset) return -1; ++ ++ return offset; ++ } else ++ return 0; ++} ++ ++static int fadFirstOffset(FD_t fd) ++{ ++ return fadNextOffset(fd, 0); ++} ++ ++/*@-boundsread@*/ ++static int dncmp(const void * a, const void * b) ++ /*@*/ ++{ ++ const char *const * first = a; ++ const char *const * second = b; ++ return strcmp(*first, *second); ++} ++/*@=boundsread@*/ ++ ++static void compressFilelist(Header h) ++{ ++ struct rpmtd_s fileNames; ++ char ** dirNames; ++ const char ** baseNames; ++ uint32_t * dirIndexes; ++ rpm_count_t count; ++ int xx, i; ++ int dirIndex = -1; ++ ++ /* ++ * This assumes the file list is already sorted, and begins with a ++ * single '/'. That assumption isn't critical, but it makes things go ++ * a bit faster. ++ */ ++ ++ if (headerIsEntry(h, RPMTAG_DIRNAMES)) { ++ xx = headerDel(h, RPMTAG_OLDFILENAMES); ++ return; /* Already converted. */ ++ } ++ ++ if (!headerGet(h, RPMTAG_OLDFILENAMES, &fileNames, HEADERGET_MINMEM)) ++ return; ++ count = rpmtdCount(&fileNames); ++ if (count < 1) ++ return; ++ ++ dirNames = xmalloc(sizeof(*dirNames) * count); /* worst case */ ++ baseNames = xmalloc(sizeof(*dirNames) * count); ++ dirIndexes = xmalloc(sizeof(*dirIndexes) * count); ++ ++ /* HACK. Source RPM, so just do things differently */ ++ { const char *fn = rpmtdGetString(&fileNames); ++ if (fn && *fn != '/') { ++ dirIndex = 0; ++ dirNames[dirIndex] = xstrdup(""); ++ while ((i = rpmtdNext(&fileNames)) >= 0) { ++ dirIndexes[i] = dirIndex; ++ baseNames[i] = rpmtdGetString(&fileNames); ++ } ++ goto exit; ++ } ++ } ++ ++ while ((i = rpmtdNext(&fileNames)) >= 0) { ++ char ** needle; ++ char savechar; ++ char * baseName; ++ size_t len; ++ const char *filename = rpmtdGetString(&fileNames); ++ ++ if (filename == NULL) /* XXX can't happen */ ++ continue; ++ baseName = strrchr(filename, '/') + 1; ++ len = baseName - filename; ++ needle = dirNames; ++ savechar = *baseName; ++ *baseName = '\0'; ++ if (dirIndex < 0 || ++ (needle = bsearch(&filename, dirNames, dirIndex + 1, sizeof(dirNames[0]), dncmp)) == NULL) { ++ char *s = xmalloc(len + 1); ++ rstrlcpy(s, filename, len + 1); ++ dirIndexes[i] = ++dirIndex; ++ dirNames[dirIndex] = s; ++ } else ++ dirIndexes[i] = needle - dirNames; ++ ++ *baseName = savechar; ++ baseNames[i] = baseName; ++ } ++ ++exit: ++ if (count > 0) { ++ headerPutUint32(h, RPMTAG_DIRINDEXES, dirIndexes, count); ++ headerPutStringArray(h, RPMTAG_BASENAMES, baseNames, count); ++ headerPutStringArray(h, RPMTAG_DIRNAMES, ++ (const char **) dirNames, dirIndex + 1); ++ } ++ ++ rpmtdFreeData(&fileNames); ++ for (i = 0; i <= dirIndex; i++) { ++ free(dirNames[i]); ++ } ++ free(dirNames); ++ free(baseNames); ++ free(dirIndexes); ++ ++ xx = headerDel(h, RPMTAG_OLDFILENAMES); ++} ++ ++/* ++ * Up to rpm 3.0.4, packages implicitly provided their own name-version-release. ++ * Retrofit an explicit "Provides: name = epoch:version-release. ++ */ ++static void providePackageNVR(Header h) ++{ ++ const char *name; ++ char *pEVR; ++ rpmsenseFlags pFlags = RPMSENSE_EQUAL; ++ int bingo = 1; ++ struct rpmtd_s pnames; ++ rpmds hds, nvrds; ++ ++ /* Generate provides for this package name-version-release. */ ++ pEVR = headerGetEVR(h, &name); ++ if (!(name && pEVR)) ++ return; ++ ++ /* ++ * Rpm prior to 3.0.3 does not have versioned provides. ++ * If no provides at all are available, we can just add. ++ */ ++ if (!headerGet(h, RPMTAG_PROVIDENAME, &pnames, HEADERGET_MINMEM)) { ++ goto exit; ++ } ++ ++ /* ++ * Otherwise, fill in entries on legacy packages. ++ */ ++ if (!headerIsEntry(h, RPMTAG_PROVIDEVERSION)) { ++ while (rpmtdNext(&pnames) >= 0) { ++ rpmsenseFlags fdummy = RPMSENSE_ANY; ++ ++ headerPutString(h, RPMTAG_PROVIDEVERSION, ""); ++ headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &fdummy, 1); ++ } ++ goto exit; ++ } ++ ++ /* see if we already have this provide */ ++ hds = rpmdsNew(h, RPMTAG_PROVIDENAME, 0); ++ nvrds = rpmdsSingle(RPMTAG_PROVIDENAME, name, pEVR, pFlags); ++ if (rpmdsFind(hds, nvrds) >= 0) { ++ bingo = 0; ++ } ++ rpmdsFree(hds); ++ rpmdsFree(nvrds); ++ ++exit: ++ if (bingo) { ++ const char *evr = pEVR; ++ headerPutString(h, RPMTAG_PROVIDENAME, name); ++ headerPutString(h, RPMTAG_PROVIDEVERSION, evr); ++ headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &pFlags, 1); ++ } ++ rpmtdFreeData(&pnames); ++ free(pEVR); ++} ++/*@=bounds@*/ ++ ++static rpmdb db; ++ ++int ++main(int argc, char ** argv) ++{ ++ FD_t fd; ++ int offset; ++ Header h; ++ const char *name; ++ const char *version; ++ const char *release; ++ ++ if (argc != 2) ++ { ++ fprintf(stderr, "usage: %s \n", argv[0]); ++ exit(1); ++ } ++ if ((fd = fadOpen(argv[1])) == 0) ++ { ++ fprintf(stderr, "could not open %s\n", argv[1]); ++ exit(1); ++ } ++ rpmInitMacros(NULL, "/usr/lib/rpm/macros"); ++ ++ /* speed things up */ ++ (void) rpmDefineMacro(NULL, "_rpmdb_rebuild %{nil}", -1); ++ ++ if (rpmdbOpen("/", &db, O_RDWR, 0644)) { ++ fprintf(stderr, "could not open rpm database\n"); ++ exit(1); ++ } ++ ++ for (offset = fadFirstOffset(fd); offset; offset = fadNextOffset(fd, offset)) ++ { ++ rpmdbMatchIterator mi; ++ ++ /* have to use lseek instead of Fseek because headerRead ++ * uses low level IO ++ */ ++ if (lseek(Fileno(fd), (off_t)offset, SEEK_SET) == -1) ++ { ++ perror("lseek"); ++ continue; ++ } ++ h = headerRead(fd, HEADER_MAGIC_NO); ++ if (!h) ++ continue; ++ compressFilelist(h); ++ providePackageNVR(h); ++ headerNVR(h, &name, &version, &release); ++ mi = rpmdbInitIterator(db, RPMTAG_NAME, name, 0); ++ rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_DEFAULT, version); ++ rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_DEFAULT, release); ++ if (rpmdbNextIterator(mi)) ++ { ++ printf("%s-%s-%s is already in database\n", name, version, release); ++ rpmdbFreeIterator(mi); ++ headerFree(h); ++ continue; ++ } ++ rpmdbFreeIterator(mi); ++ if (rpmdbAdd(db, -1, h, 0, 0)) ++ { ++ fprintf(stderr, "could not add %s-%s-%s!\n", name, version, release); ++ } ++ headerFree(h); ++ } ++ Fclose(fd); ++ rpmdbClose(db); ++ return 0; ++} ++ diff --git a/dbfsync.diff b/dbfsync.diff index 00da14c..4c5c9c4 100644 --- a/dbfsync.diff +++ b/dbfsync.diff @@ -1,40 +1,40 @@ Support a database-local fsync setting. Needs berkeley db patch. ---- ./rpmdb/db3.c.orig 2005-03-23 18:15:28.000000000 +0000 -+++ ./rpmdb/db3.c 2006-01-27 20:08:29.000000000 +0000 -@@ -211,11 +211,13 @@ static int db_fini(dbiIndex dbi, const c +Index: lib/backend/db3.c +=================================================================== +--- lib/backend/db3.c.orig ++++ lib/backend/db3.c +@@ -191,10 +191,12 @@ static int db_fini(dbiIndex dbi, const c return rc; } +#if 0 - static int db3_fsync_disable(/*@unused@*/ int fd) - /*@*/ + static int db3_fsync_disable(int fd) { return 0; } +#endif - #if 0 - #if HAVE_LIBPTHREAD -@@ -414,6 +416,7 @@ static int db_init(dbiIndex dbi, const c + #if (DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 5) + /* +@@ -357,10 +359,12 @@ static int db_init(dbiIndex dbi, const c /* dbenv->set_rep_transport(???) */ /* dbenv->set_rep_limit(???) */ +#if 0 if (dbi->dbi_no_fsync) { - #if (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR != 0) || (DB_VERSION_MAJOR == 4) xx = db_env_set_func_fsync(db3_fsync_disable); -@@ -422,6 +425,7 @@ static int db_init(dbiIndex dbi, const c - #endif xx = cvtdberr(dbi, "db_env_set_func_fsync", xx, _debug); } +#endif if (dbi->dbi_shmkey) { xx = dbenv->set_shm_key(dbenv, dbi->dbi_shmkey); ---- ./rpmdb/dbconfig.c.orig 2004-10-16 12:50:52.000000000 +0000 -+++ ./rpmdb/dbconfig.c 2005-12-15 13:12:32.000000000 +0000 -@@ -99,6 +99,8 @@ struct poptOption rdbOptions[] = { +Index: lib/backend/dbconfig.c +=================================================================== +--- lib/backend/dbconfig.c.orig ++++ lib/backend/dbconfig.c +@@ -94,6 +94,8 @@ struct poptOption rdbOptions[] = { NULL, NULL }, { "fcntl_locking",0,POPT_BIT_SET, &db3dbi.dbi_oflags, DB_FCNTL_LOCKING, NULL, NULL }, @@ -43,7 +43,7 @@ Support a database-local fsync setting. Needs berkeley db patch. { "btree", 0,POPT_ARG_VAL, &db3dbi.dbi_type, DB_BTREE, NULL, NULL }, -@@ -145,8 +147,6 @@ struct poptOption rdbOptions[] = { +@@ -140,8 +142,6 @@ struct poptOption rdbOptions[] = { NULL, NULL }, { "usedbenv", 0,POPT_ARG_NONE, &db3dbi.dbi_use_dbenv, 0, NULL, NULL }, diff --git a/dbprivate.diff b/dbprivate.diff index 08ebadb..da64e54 100644 --- a/dbprivate.diff +++ b/dbprivate.diff @@ -1,12 +1,12 @@ Always use DB_PRIVATE. Should probably be configured instead. -Index: rpmdb/db3.c +Index: lib/backend/db3.c =================================================================== ---- rpmdb/db3.c.orig -+++ rpmdb/db3.c -@@ -1050,6 +1050,9 @@ static int db3open(rpmdb rpmdb, rpmTag r - #endif - #endif +--- lib/backend/db3.c.orig ++++ lib/backend/db3.c +@@ -804,6 +804,9 @@ static int db3open(rpmdb rpmdb, rpmTag r + */ + if (dbi->dbi_use_dbenv) { + /* always use fcntl lock */ + dbi->dbi_eflags |= DB_PRIVATE; diff --git a/dbrointerruptable.diff b/dbrointerruptable.diff index 355cfc4..a9bc1c7 100644 --- a/dbrointerruptable.diff +++ b/dbrointerruptable.diff @@ -1,11 +1,11 @@ Do not block signals if the database is opened read-only, it jst annoys the users. [#48026] -Index: rpmdb/rpmdb.c +Index: lib/rpmdb.c =================================================================== ---- rpmdb/rpmdb.c.orig -+++ rpmdb/rpmdb.c -@@ -873,10 +873,12 @@ int rpmdbClose(rpmdb db) +--- lib/rpmdb.c.orig ++++ lib/rpmdb.c +@@ -819,10 +819,12 @@ int rpmdbClose(rpmdb db) rpmdb * prev, next; int dbix; int rc = 0; @@ -15,12 +15,12 @@ Index: rpmdb/rpmdb.c goto exit; + dbmode = db->db_mode; - (void) rpmdbUnlink(db, "rpmdbClose"); + (void) rpmdbUnlink(db, RPMDBG_M("rpmdbClose")); - /*@-usereleased@*/ -@@ -913,12 +915,14 @@ int rpmdbClose(rpmdb db) - /*@-refcounttrans@*/ db = _free(db); /*@=refcounttrans@*/ - /*@=usereleased@*/ + if (db->nrefs > 0) +@@ -855,12 +857,14 @@ int rpmdbClose(rpmdb db) + + dbiTagsFree(); + if ((dbmode & (O_RDWR|O_WRONLY)) != 0) { + (void) rpmsqEnable(-SIGHUP, NULL); @@ -37,8 +37,8 @@ Index: rpmdb/rpmdb.c - (void) rpmsqEnable(-SIGPIPE,NULL); return rc; } - /*@=incondefs@*/ -@@ -1050,11 +1054,13 @@ static int openDatabase(/*@null@*/ const + +@@ -956,11 +960,13 @@ static int openDatabase(const char * pre if (db == NULL) return 1; diff --git a/debugedit-canon-fix.diff b/debugedit-canon-fix.diff index 2bc7a42..8d6ad2a 100644 --- a/debugedit-canon-fix.diff +++ b/debugedit-canon-fix.diff @@ -11,7 +11,7 @@ Index: tools/debugedit.c =================================================================== --- tools/debugedit.c.orig +++ tools/debugedit.c -@@ -157,7 +157,7 @@ strptr (DSO *dso, int sec, off_t offset) +@@ -158,7 +158,7 @@ strptr (DSO *dso, int sec, off_t offset) { if (data->d_buf && offset >= data->d_off @@ -20,24 +20,8 @@ Index: tools/debugedit.c return (const char *) data->d_buf + (offset - data->d_off); } } -@@ -471,13 +471,13 @@ has_prefix (const char *str, - { - int str_len; - int prefix_len; -- -+ - str_len = strlen (str); - prefix_len = strlen (prefix); - - if (str_len < prefix_len) - return 0; -- -+ - return strncmp (str, prefix, prefix_len) == 0; - } - -@@ -485,9 +485,10 @@ static int - edit_dwarf2_line (DSO *dso, uint_32 off, char *comp_dir, int phase) +@@ -488,9 +488,10 @@ static int + edit_dwarf2_line (DSO *dso, uint32_t off, char *comp_dir, int phase) { unsigned char *ptr = debug_sections[DEBUG_LINE].data, *dir; - unsigned char **dirt; @@ -46,114 +30,60 @@ Index: tools/debugedit.c unsigned char *endcu, *endprol; + char line_base; unsigned char opcode_base; - uint_32 value, dirt_cnt; + uint32_t value, dirt_cnt; size_t comp_dir_len = strlen (comp_dir); -@@ -496,9 +497,9 @@ edit_dwarf2_line (DSO *dso, uint_32 off, - - if (phase != 0) - return 0; -- -+ - ptr += off; -- -+ - endcu = ptr + 4; - endcu += read_32 (ptr); - if (endcu == ptr + 0xffffffff) -@@ -521,7 +522,7 @@ edit_dwarf2_line (DSO *dso, uint_32 off, - value); +@@ -534,6 +535,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off return 1; } -- -+ - endprol = ptr + 4; - endprol += read_32 (ptr); - if (endprol > endcu) -@@ -530,26 +531,27 @@ edit_dwarf2_line (DSO *dso, uint_32 off, - dso->filename); - return 1; - } -- -+ + + line_base = (char) (ptr[2] & 0xff); opcode_base = ptr[4]; ptr = dir = ptr + 4 + opcode_base; -- -+ - /* dir table: */ - value = 1; - while (*ptr != 0) - { -- ptr = strchr (ptr, 0) + 1; -+ ptr = (unsigned char *)strchr ((char *)ptr, 0) + 1; + +@@ -545,13 +547,13 @@ edit_dwarf2_line (DSO *dso, uint32_t off ++value; } - dirt = (unsigned char **) alloca (value * sizeof (unsigned char *)); -+ dirt = (char **) alloca (value * sizeof (char *)); - dirt[0] = "."; ++ dirt = (char **) alloca (value * sizeof (unsigned char *)); + dirt[0] = (unsigned char *) "."; dirt_cnt = 1; ptr = dir; while (*ptr != 0) { - dirt[dirt_cnt++] = ptr; -- ptr = strchr (ptr, 0) + 1; + dirt[dirt_cnt++] = (char *)ptr; -+ ptr = (unsigned char *)strchr ((char *)ptr, 0) + 1; + ptr = (unsigned char *) strchr ((char *)ptr, 0) + 1; } ptr++; - -@@ -559,8 +561,8 @@ edit_dwarf2_line (DSO *dso, uint_32 off, - char *s, *file; - size_t file_len, dir_len; - -- file = ptr; -- ptr = strchr (ptr, 0) + 1; -+ file = (char *)ptr; -+ ptr = (unsigned char *)strchr ((char *)ptr, 0) + 1; - value = read_uleb128 (ptr); - - if (value >= dirt_cnt) -@@ -629,7 +631,7 @@ edit_dwarf2_line (DSO *dso, uint_32 off, - } - - free (s); -- -+ - read_uleb128 (ptr); - read_uleb128 (ptr); - } -@@ -661,7 +663,7 @@ edit_dwarf2_line (DSO *dso, uint_32 off, +@@ -664,7 +666,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off if (dest_dir) { - unsigned char *srcptr, *buf = NULL; -+ char *srcptr, *srcstart, *buf = NULL; ++ char *srcptr, *buf = NULL; size_t base_len = strlen (base_dir); size_t dest_len = strlen (dest_dir); size_t shrank = 0; -@@ -675,12 +677,16 @@ edit_dwarf2_line (DSO *dso, uint_32 off, +@@ -678,11 +680,14 @@ edit_dwarf2_line (DSO *dso, uint32_t off ptr = dir; } else - ptr = srcptr = dir; -- unsigned char *srcstart=srcptr; + { + ptr = dir; + srcptr = (char *)dir; + } -+ -+ srcstart = srcptr; while (*srcptr != 0) { -- size_t len = strlen (srcptr) + 1; +- size_t len = strlen ((char *)srcptr) + 1; - const unsigned char *readptr = srcptr; -+ size_t len = strlen (srcptr); ++ size_t len = strlen ((char *)srcptr); + const char *readptr = srcptr; - if (*srcptr == '/' && has_prefix (srcptr, base_dir)) + if (*srcptr == '/' && has_prefix ((char *)srcptr, base_dir)) { -@@ -689,39 +695,28 @@ edit_dwarf2_line (DSO *dso, uint_32 off, +@@ -691,42 +696,27 @@ edit_dwarf2_line (DSO *dso, uint32_t off memcpy (ptr, dest_dir, dest_len); ptr += dest_len; readptr += base_len; @@ -162,32 +92,34 @@ Index: tools/debugedit.c srcptr += len; shrank += srcptr - readptr; -- canonicalize_path (readptr, ptr); -- len = strlen (ptr) + 1; -+ canonicalize_path (readptr, (char *)ptr); + canonicalize_path ((char *)readptr, (char *)ptr); +- len = strlen ((char *)ptr) + 1; +- shrank -= len; +- ptr += len; + len = strlen ((char *)ptr); -+ -+#ifdef DEBUG -+ if ((srcptr - readptr) > len) -+ error(0, 0,"canonicalization unexpectedly shrank (%lu): \"%s\"\n", -+ (long unsigned int)(srcptr - readptr) - len, ptr); -+#endif -+ - shrank -= len; - ptr += len; - elf_flagdata (debug_sections[DEBUG_STR].elf_data, - ELF_C_SET, ELF_F_DIRTY); - } -- ++#ifdef DEBUG ++ if ((srcptr - readptr) > len) ++ error(0, 0,"canonicalization unexpectedly shrank (%lu): \"%s\"\n", ++ (long unsigned int)(srcptr - readptr) - len, ptr); ++#endif + - if (shrank > 0) - { - if (--shrank == 0) - error (EXIT_FAILURE, 0, - "canonicalization unexpectedly shrank by one character"); -- memset (ptr, 'X', shrank); -- ptr += shrank; -- *ptr++ = '\0'; +- else +- { +- memset (ptr, 'X', shrank); +- ptr += shrank; +- *ptr++ = '\0'; +- } ++ shrank -= len; ++ ptr += len; + elf_flagdata (debug_sections[DEBUG_STR].elf_data, + ELF_C_SET, ELF_F_DIRTY); + ++ptr; @@ -207,7 +139,7 @@ Index: tools/debugedit.c *ptr++ = '\0'; ++srcptr; -@@ -741,21 +736,26 @@ edit_dwarf2_line (DSO *dso, uint_32 off, +@@ -746,21 +736,26 @@ edit_dwarf2_line (DSO *dso, uint32_t off elf_flagdata (debug_sections[DEBUG_STR].elf_data, ELF_C_SET, ELF_F_DIRTY); } @@ -238,147 +170,3 @@ Index: tools/debugedit.c return 0; } -@@ -767,17 +767,13 @@ edit_attributes (DSO *dso, unsigned char - int i; - uint_32 list_offs; - int found_list_offs; -- unsigned char *comp_dir; -- -- comp_dir = NULL; -- list_offs = 0; -- found_list_offs = 0; -+ char *comp_dir = NULL; -+ - for (i = 0; i < t->nattr; ++i) - { - uint_32 form = t->attr[i].form; - uint_32 len = 0; - int base_len, dest_len; -- - - while (1) - { -@@ -791,56 +787,55 @@ edit_attributes (DSO *dso, unsigned char - } - - if (t->attr[i].attr == DW_AT_comp_dir) -- { -+ { - if ( form == DW_FORM_string ) -- { -+ { - free (comp_dir); -- comp_dir = strdup (ptr); -- -- if (phase == 1 && dest_dir && has_prefix (ptr, base_dir)) -- { -+ comp_dir = strdup ((char *)ptr); -+ -+ if (phase == 1 && dest_dir -+ && has_prefix ((char *)ptr, base_dir)) -+ { - base_len = strlen (base_dir); - dest_len = strlen (dest_dir); -- -+ - memcpy (ptr, dest_dir, dest_len); - if (dest_len < base_len) -- { -+ { - memset(ptr + dest_len, '/', - base_len - dest_len); -- -- } -+ } - elf_flagdata (debug_sections[DEBUG_INFO].elf_data, - ELF_C_SET, ELF_F_DIRTY); -- } -- } -- -+ } -+ } - else if (form == DW_FORM_strp && - debug_sections[DEBUG_STR].data) -- { -+ { - char *dir; - -- dir = debug_sections[DEBUG_STR].data -- + do_read_32_relocated (ptr); -+ dir = (char *)debug_sections[DEBUG_STR].data -+ + do_read_32_relocated (ptr); - - free (comp_dir); - comp_dir = strdup (dir); - - if (phase == 1 && dest_dir && has_prefix (dir, base_dir)) -- { -+ { - base_len = strlen (base_dir); - dest_len = strlen (dest_dir); -- -+ - memcpy (dir, dest_dir, dest_len); - if (dest_len < base_len) -- { -+ { - memmove (dir + dest_len, dir + base_len, - strlen (dir + base_len) + 1); -- } -+ } - elf_flagdata (debug_sections[DEBUG_STR].elf_data, - ELF_C_SET, ELF_F_DIRTY); -- } -- } -- } -+ } -+ } -+ } - else if ((t->tag == DW_TAG_compile_unit - || t->tag == DW_TAG_partial_unit) - && t->attr[i].attr == DW_AT_name -@@ -848,9 +843,9 @@ edit_attributes (DSO *dso, unsigned char - && debug_sections[DEBUG_STR].data) - { - char *name; -- -- name = debug_sections[DEBUG_STR].data -- + do_read_32_relocated (ptr); -+ -+ name = (char *)debug_sections[DEBUG_STR].data -+ + do_read_32_relocated (ptr); - if (*name == '/' && comp_dir == NULL) - { - char *enddir = strrchr (name, '/'); -@@ -869,7 +864,7 @@ edit_attributes (DSO *dso, unsigned char - { - base_len = strlen (base_dir); - dest_len = strlen (dest_dir); -- -+ - memcpy (name, dest_dir, dest_len); - if (dest_len < base_len) - { -@@ -913,7 +908,7 @@ edit_attributes (DSO *dso, unsigned char - ptr += 4; - break; - case DW_FORM_string: -- ptr = strchr (ptr, '\0') + 1; -+ ptr = (unsigned char *)strchr ((char *)ptr, '\0') + 1; - break; - case DW_FORM_indirect: - form = read_uleb128 (ptr); -@@ -1470,10 +1465,11 @@ handle_build_id (DSO *dso, Elf_Data *bui - const unsigned char * id = build_id->d_buf + build_id_offset; - char hex[build_id_size * 2 + 1]; - int n = snprintf (hex, 3, "%02" PRIx8, id[0]); -+ size_t size; - assert (n == 2); -- for (i = 1; i < build_id_size; ++i) -+ for (size = 1; size < build_id_size; ++size) - { -- n = snprintf (&hex[i * 2], 3, "%02" PRIx8, id[i]); -+ n = snprintf (&hex[size * 2], 3, "%02" PRIx8, id[size]); - assert (n == 2); - } - puts (hex); diff --git a/debugedit-comp-dir.diff b/debugedit-comp-dir.diff index 60e749a..5dd5ae9 100644 --- a/debugedit-comp-dir.diff +++ b/debugedit-comp-dir.diff @@ -8,15 +8,15 @@ Index: tools/debugedit.c =================================================================== --- tools/debugedit.c.orig +++ tools/debugedit.c -@@ -492,6 +492,7 @@ edit_dwarf2_line (DSO *dso, uint_32 off, - uint_32 value, dirt_cnt; +@@ -495,6 +495,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off + uint32_t value, dirt_cnt; size_t comp_dir_len = strlen (comp_dir); size_t abs_file_cnt = 0, abs_dir_cnt = 0; + int comp_dir_used = 0; if (phase != 0) return 0; -@@ -600,6 +601,7 @@ edit_dwarf2_line (DSO *dso, uint_32 off, +@@ -603,6 +604,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off memcpy (p, dirt[value], dir_len); p[dir_len] = '/'; memcpy (p + dir_len + 1, file, file_len + 1); @@ -24,7 +24,7 @@ Index: tools/debugedit.c } canonicalize_path (s, s); if (list_file_fd != -1) -@@ -632,7 +634,31 @@ edit_dwarf2_line (DSO *dso, uint_32 off, +@@ -635,7 +637,31 @@ edit_dwarf2_line (DSO *dso, uint32_t off read_uleb128 (ptr); } ++ptr; diff --git a/debugedit.diff b/debugedit.diff index 3cd43ac..cb4c499 100644 --- a/debugedit.diff +++ b/debugedit.diff @@ -1,10 +1,10 @@ -Make debugedit build without dwarf.h. Also fixes a logic bug for ppc. +Make debugedit build without dwarf.h Index: tools/debugedit.c =================================================================== --- tools/debugedit.c.orig +++ tools/debugedit.c -@@ -34,7 +34,37 @@ +@@ -37,7 +37,37 @@ #include #include @@ -41,26 +41,25 @@ Index: tools/debugedit.c +#define DW_FORM_ref_udata 0x15 +#define DW_FORM_indirect 0x16 - #include - -@@ -1346,7 +1376,6 @@ handle_build_id (DSO *dso, Elf_Data *bui - or Elf64 object, only that we are consistent in what bits feed the - hash so it comes out the same for the same file contents. */ - { -- inline void process (const void *data, size_t size); - inline void process (const void *data, size_t size) - { - memchunk chunk = { .data = (void *) data, .size = size }; -Index: tools/Makefile.am + #include + #include +Index: Makefile.am =================================================================== ---- tools/Makefile.am.orig -+++ tools/Makefile.am -@@ -39,7 +39,7 @@ debugedit_SOURCES = debugedit.c hashtab. - #debugedit_LDADD = @LDFLAGS_STATIC@ \ - debugedit_LDADD = \ - @WITH_LIBELF_LIB@ \ -- @WITH_BEECRYPT_LIB@ \ -+ $(top_builddir)/rpmdb/librpmdb.la \ - @WITH_POPT_LIB@ +--- Makefile.am.orig ++++ Makefile.am +@@ -103,7 +103,6 @@ rpm2cpio_LDADD += @WITH_LIBELF_LIB@ @WIT - javadeps_SOURCES = javadeps.c + + if LIBELF +-if LIBDWARF + rpmconfig_SCRIPTS += scripts/find-debuginfo.sh + + rpmlibexec_PROGRAMS += debugedit +@@ -111,7 +110,6 @@ debugedit_SOURCES = tools/debugedit.c to + debugedit_LDADD = rpmio/librpmio.la + debugedit_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@ + endif +-endif + + rpmlibexec_PROGRAMS += javadeps + javadeps_SOURCES = tools/javadeps.c diff --git a/debuglink.diff b/debuglink.diff index 7b5ee79..39892b5 100644 --- a/debuglink.diff +++ b/debuglink.diff @@ -1,7 +1,7 @@ -Index: rpm-4.4.2.3/scripts/find-debuginfo.sh +Index: scripts/find-debuginfo.sh =================================================================== ---- rpm-4.4.2.3.orig/scripts/find-debuginfo.sh 2009-07-27 12:06:41.000000000 +0200 -+++ rpm-4.4.2.3/scripts/find-debuginfo.sh 2009-07-27 12:08:05.000000000 +0200 +--- scripts/find-debuginfo.sh.orig 2009-07-27 12:06:41.000000000 +0200 ++++ scripts/find-debuginfo.sh 2009-07-27 12:08:05.000000000 +0200 @@ -185,7 +185,8 @@ make_id_link() get_debugfn() { diff --git a/debugsource-package.diff b/debugsource-package.diff index ec03d43..17e4599 100644 --- a/debugsource-package.diff +++ b/debugsource-package.diff @@ -8,11 +8,11 @@ build the binary. The patches moves them into a separate package -debugsource. scripts/find-debuginfo.sh | 12 +++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) -Index: b/macros.in +Index: macros.in =================================================================== ---- macros.in +--- macros.in.orig +++ macros.in -@@ -183,6 +183,18 @@ Debug information is useful when develop +@@ -187,6 +187,18 @@ Debug information is useful when develop package or when debugging this package.\ %files debuginfo -f debugfiles.list\ %defattr(-,root,root)\ @@ -30,12 +30,12 @@ Index: b/macros.in +%defattr(-,root,root)\ %{nil} - %_defaultdocdir %{_usr}/doc/packages -Index: b/scripts/find-debuginfo.sh + %_defaultdocdir %{_datadir}/doc/packages +Index: scripts/find-debuginfo.sh =================================================================== ---- scripts/find-debuginfo.sh +--- scripts/find-debuginfo.sh.orig +++ scripts/find-debuginfo.sh -@@ -172,8 +172,8 @@ set -o pipefail +@@ -186,8 +186,8 @@ set -o pipefail strict_error=ERROR $strict || strict_error=WARNING @@ -46,7 +46,7 @@ Index: b/scripts/find-debuginfo.sh xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' | while read nlinks inum f; do case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in -@@ -282,10 +282,16 @@ if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o - +@@ -297,10 +297,16 @@ if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o - (cd "${RPM_BUILD_ROOT}/usr" test ! -d lib/debug || find lib/debug ! -type d diff --git a/debugsubpkg.diff b/debugsubpkg.diff index bddebd4..cab3e33 100644 --- a/debugsubpkg.diff +++ b/debugsubpkg.diff @@ -1,23 +1,22 @@ -Index: rpm-4.4.2.3/build/files.c +Index: build/files.c =================================================================== ---- rpm-4.4.2.3.orig/build/files.c 2009-07-27 17:59:07.000000000 +0200 -+++ rpm-4.4.2.3/build/files.c 2009-07-27 18:02:00.000000000 +0200 -@@ -28,6 +28,10 @@ - #define _RPMTE_INTERNAL - #include "rpmte.h" +--- build/files.c.orig ++++ build/files.c +@@ -17,6 +17,10 @@ + #include /* rpmDoDigest() */ + #include +#if HAVE_GELF_H +#include +#endif + - #include "buildio.h" - - #include "legacy.h" /* XXX domd5, expandFileList, compressFileList */ -@@ -2485,6 +2489,128 @@ exit: + #include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */ + #include "rpmio/base64.h" + #include "rpmio/fts.h" +@@ -2220,12 +2224,136 @@ exit: return rc; } -+ +/* Query the build-id from the ELF file NAME and store it in the newly + allocated *build_id array of size *build_id_size. Returns -1 on + error. */ @@ -139,40 +138,31 @@ Index: rpm-4.4.2.3/build/files.c + 0 +}; + - /*@-incondefs@*/ - int processBinaryFiles(Spec spec, int installSpecialDoc, int test) - /*@globals check_fileList @*/ -@@ -2492,12 +2618,16 @@ int processBinaryFiles(Spec spec, int in ++ + int processBinaryFiles(rpmSpec spec, int installSpecialDoc, int test) { Package pkg; - int res = 0; -+ char *buildrooturl; + int rc = RPMRC_OK; ++ char *buildroot; check_fileList = newStringBuf(); -+ buildrooturl = rpmGenPath(spec->rootURL, spec->buildRootURL, NULL); ++ buildroot = rpmGenPath(spec->rootDir, spec->buildRoot, NULL); + genSourceRpmName(spec); for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { - const char *n, *v, *r; - int rc; -+ int type, count; -+ char *ap; - - if (pkg->fileList == NULL) - continue; -@@ -2508,6 +2638,116 @@ int processBinaryFiles(Spec spec, int in - if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test))) - res = rc; - +@@ -2238,8 +2366,109 @@ int processBinaryFiles(rpmSpec spec, int + (void) headerNEVRA(pkg->header, &n, NULL, &v, &r, &a); + rpmlog(RPMLOG_NOTICE, _("Processing files: %s-%s-%s.%s\n"), n, v, r, a); + +- if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test)) != RPMRC_OK || +- (rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK) ++ if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test)) != RPMRC_OK) ++ goto exit; ++ + /* BEGIN DEBUGPKG */ +#if HAVE_GELF_H && HAVE_LIBELF + elf_version(EV_CURRENT); -+ -+ /* Now we have the file list of pkg in pkg->cpioList. Iterate over -+ them and build a file list containing debug information for them. */ -+ if (headerGetEntry (pkg->header, RPMTAG_ARCH, &type, (void **)&ap, &count) -+ && type == RPM_STRING_TYPE && count == 1 -+ && strcmp (ap, "noarch") != 0 -+ && strcmp (ap, "src") != 0) ++ if (strcmp(a, "noarch") != 0 && strcmp(a, "src") != 0 && strcmp(a, "nosrc") != 0) + { + Package dbg; + rpmfi fi = pkg->cpioList; @@ -194,10 +184,10 @@ Index: rpm-4.4.2.3/build/files.c + + name = rpmfiFN (fi); + /* Skip leading buildroot. */ -+ base = name + strlen (buildrooturl); ++ base = name + strlen (buildroot); + /* Pre-pend %buildroot/usr/lib/debug and append .debug. */ + snprintf (tmp, 1024, "%s/usr/lib/debug%s.debug", -+ buildrooturl, base); ++ buildroot, base); + /* If that file exists we have debug information for it. */ + if (access (tmp, F_OK) != 0) + continue; @@ -250,37 +240,33 @@ Index: rpm-4.4.2.3/build/files.c + headerNVR (pkg->header, &name, NULL, NULL); + /* Set name, summary and group. */ + snprintf (tmp, 1024, "%s-debuginfo", name); -+ headerAddEntry (dbg->header, RPMTAG_NAME, RPM_STRING_TYPE, tmp, 1); ++ headerPutString(dbg->header, RPMTAG_NAME, tmp); + snprintf (tmp, 1024, "Debug information for package %s", name); -+ headerAddEntry (dbg->header, RPMTAG_SUMMARY, RPM_STRING_TYPE, -+ tmp, 1); ++ headerPutString(dbg->header, RPMTAG_SUMMARY, tmp); + snprintf (tmp, 1024, "This package provides debug information for package %s.\n" + "Debug information is useful when developing applications that use this\n" + "package or when debugging this package.", name); -+ headerAddEntry (dbg->header, RPMTAG_DESCRIPTION, RPM_STRING_TYPE, -+ tmp, 1); -+ headerAddEntry (dbg->header, RPMTAG_GROUP, RPM_STRING_TYPE, -+ "Development/Debug", 1); ++ headerPutString(dbg->header, RPMTAG_DESCRIPTION, tmp); ++ headerPutString(dbg->header, RPMTAG_GROUP, "Development/Debug"); + /* Inherit other tags from parent. */ -+ headerCopyTags (pkg->header, dbg->header, -+ (int_32 *)copyTagsForDebug); ++ headerCopyTags (pkg->header, dbg->header, copyTagsForDebug); + + /* Build up the files list. */ + dbg->fileList = files; + } + } -+ -+ /* END DEBUGPKG */ +#endif ++ /* END DEBUGPKG */ + - if ((rc = rpmfcGenerateDepends(spec, pkg))) - res = rc; - } -Index: rpm-4.4.2.3/macros.in ++ if ((rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK) + goto exit; + + if (strcmp(a, "noarch") == 0 && headerGetColor(pkg->header) != 0) { +Index: macros.in =================================================================== ---- rpm-4.4.2.3.orig/macros.in 2009-07-27 17:59:07.000000000 +0200 -+++ rpm-4.4.2.3/macros.in 2009-07-27 17:59:07.000000000 +0200 -@@ -173,24 +173,10 @@ +--- macros.in.orig ++++ macros.in +@@ -176,24 +176,10 @@ # Template for debug information sub-package. %debug_package \ %global __debug_package 1\ @@ -305,10 +291,10 @@ Index: rpm-4.4.2.3/macros.in %description debugsource\ This package provides debug sources for package %{name}.\ Debug sources are useful when developing applications that use this\ -Index: rpm-4.4.2.3/scripts/find-debuginfo.sh +Index: scripts/find-debuginfo.sh =================================================================== ---- rpm-4.4.2.3.orig/scripts/find-debuginfo.sh 2009-07-27 17:59:06.000000000 +0200 -+++ rpm-4.4.2.3/scripts/find-debuginfo.sh 2009-07-27 17:59:10.000000000 +0200 +--- scripts/find-debuginfo.sh.orig ++++ scripts/find-debuginfo.sh @@ -274,19 +274,11 @@ while read nlinks inum f; do fi done || exit diff --git a/diskspace.diff b/diskspace.diff index bd0514a..f647151 100644 --- a/diskspace.diff +++ b/diskspace.diff @@ -6,7 +6,7 @@ Index: lib/rpmts.c =================================================================== --- lib/rpmts.c.orig +++ lib/rpmts.c -@@ -1358,14 +1358,14 @@ void rpmtsCheckDSIProblems(const rpmts t +@@ -924,14 +924,14 @@ void rpmtsCheckDSIProblems(const rpmts t rpmpsAppend(ps, RPMPROB_DISKSPACE, rpmteNEVRA(te), rpmteKey(te), ts->filesystems[i], NULL, NULL, diff --git a/disttag-macro.diff b/disttag-macro.diff index a294c43..e436aaf 100644 --- a/disttag-macro.diff +++ b/disttag-macro.diff @@ -1,6 +1,8 @@ ---- build/parsePreamble.c -+++ build/parsePreamble.c 2009/02/09 13:05:35 -@@ -330,6 +330,7 @@ +Index: build/parsePreamble.c +=================================================================== +--- build/parsePreamble.c.orig ++++ build/parsePreamble.c +@@ -311,6 +311,7 @@ static struct optionalTag { { RPMTAG_PACKAGER, "%{packager}" }, { RPMTAG_DISTRIBUTION, "%{distribution}" }, { RPMTAG_DISTURL, "%{disturl}" }, @@ -8,9 +10,11 @@ { -1, NULL } }; ---- macros.in -+++ macros.in 2009/02/09 13:03:08 -@@ -259,6 +259,16 @@ +Index: macros.in +=================================================================== +--- macros.in.orig ++++ macros.in +@@ -276,6 +276,16 @@ package or when debugging this package.\ # #%disturl diff --git a/elfflagreqprov.diff b/elfflagreqprov.diff deleted file mode 100644 index b815a78..0000000 --- a/elfflagreqprov.diff +++ /dev/null @@ -1,12 +0,0 @@ -Index: rpm-4.4.2.3/autodeps/linux.req -=================================================================== ---- rpm-4.4.2.3.orig/autodeps/linux.req 2009-07-24 11:38:21.000000000 +0200 -+++ rpm-4.4.2.3/autodeps/linux.req 2009-07-27 15:45:17.000000000 +0200 -@@ -110,6 +110,7 @@ for f in "${liblist[@]}" "${exelist[@]}" - } - } - /^Version References:$/ { START=2; } -+ /^private flags/ { START=3; } - (START==2) && /required from/ { - sub(/:/, "", $3); - LIBNAME=$3; diff --git a/extcond.diff b/extcond.diff index 4dcc626..20e2eed 100644 --- a/extcond.diff +++ b/extcond.diff @@ -4,11 +4,11 @@ assumed to be true. This mechanism is used by the weakdeps patch to filter the "RPMSENSE_STRONG" flag. -Index: rpmdb/header.c +Index: lib/headerfmt.c =================================================================== ---- rpmdb/header.c.orig -+++ rpmdb/header.c -@@ -2984,8 +2984,12 @@ static int parseExpression(headerSprintf +--- lib/headerfmt.c.orig ++++ lib/headerfmt.c +@@ -582,8 +582,12 @@ static int parseExpression(headerSprintf *endPtr = chptr; @@ -21,16 +21,16 @@ Index: rpmdb/header.c (void) findTag(hsa, token, str); return 0; -@@ -3226,6 +3230,7 @@ static char * singleSprintf(headerSprint - int_32 type; - int_32 count; +@@ -675,6 +679,7 @@ static char * singleSprintf(headerSprint + int i, j, found; + rpm_count_t count, numElements; sprintfToken spft; + sprintfTag stag; int condNumFormats; size_t need; -@@ -3257,6 +3262,18 @@ static char * singleSprintf(headerSprint - if (token->u.cond.tag.ext || headerIsEntry(hsa->h, token->u.cond.tag.tag)) { +@@ -705,6 +710,18 @@ static char * singleSprintf(headerSprint + headerIsEntry(hsa->h, token->u.cond.tag.tag)) { spft = token->u.cond.ifFormat; condNumFormats = token->u.cond.numIfTokens; + if (token->u.cond.tag.fmt) { @@ -48,33 +48,20 @@ Index: rpmdb/header.c } else { spft = token->u.cond.elseFormat; condNumFormats = token->u.cond.numElseTokens; -@@ -3278,19 +3295,22 @@ static char * singleSprintf(headerSprint - spft = token->u.array.format; +@@ -728,10 +745,13 @@ static char * singleSprintf(headerSprint for (i = 0; i < token->u.array.numTokens; i++, spft++) { + rpmtd td = NULL; - if (spft->type != PTOK_TAG || -- spft->u.tag.arrayCount || - spft->u.tag.justOne) continue; + if (spft->type != PTOK_TAG && spft->type != PTOK_COND) + continue; -+ + stag = (spft->type == PTOK_COND ? &spft->u.cond.tag : &spft->u.tag); -+ if (stag->arrayCount || stag->justOne) ++ if (stag->justOne) + continue; -- if (spft->u.tag.ext) { -+ if (stag->ext) { - /*@-boundswrite@*/ -- if (getExtension(hsa, spft->u.tag.ext, &type, NULL, &count, -- hsa->ec + spft->u.tag.extNum)) -+ if (getExtension(hsa, stag->ext, &type, NULL, &count, -+ hsa->ec + stag->extNum)) - continue; - /*@=boundswrite@*/ - } else { - /*@-boundswrite@*/ -- if (!headerGetEntry(hsa->h, spft->u.tag.tag, &type, NULL, &count)) -+ if (!headerGetEntry(hsa->h, stag->tag, &type, NULL, &count)) - continue; - /*@=boundswrite@*/ - } +- if (!(td = getData(hsa, spft->u.tag.tag))) { ++ if (!(td = getData(hsa, stag->tag))) { + continue; + } + diff --git a/files.diff b/files.diff index d0a2ddd..a332314 100644 --- a/files.diff +++ b/files.diff @@ -2,12 +2,12 @@ Index: build/files.c =================================================================== --- build/files.c.orig +++ build/files.c -@@ -2521,6 +2521,8 @@ int processBinaryFiles(Spec spec, int in - if (res == 0) - res = 1; +@@ -2211,6 +2211,8 @@ static int checkFiles(StringBuf fileList + _("Installed (but unpackaged) file(s) found:\n%s"), t); + } } + else + checkFiles(check_fileList); - check_fileList = freeStringBuf(check_fileList); - + exit: + sb_stdout = freeStringBuf(sb_stdout); diff --git a/findfplistexclude.diff b/findfplistexclude.diff deleted file mode 100644 index f37ed56..0000000 --- a/findfplistexclude.diff +++ /dev/null @@ -1,114 +0,0 @@ -Allow an "exclude" parameter for rpmdbFindFp, specifying a header -that is to be excluded in the match. Used to speed up package erase -operations. -Also fixes the skipDir problem that made rpm incorrectly delete -files even if another package still references them. -rh#140055 - -Index: lib/transaction.c -=================================================================== ---- lib/transaction.c.orig -+++ lib/transaction.c -@@ -1758,7 +1758,7 @@ rpmMessage(RPMMESS_DEBUG, _("computing f - (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0); - /* Extract file info for all files in this package from the database. */ - matches = xcalloc(fc, sizeof(*matches)); -- if (rpmdbFindFpList(rpmtsGetRdb(ts), fi->fps, matches, fc)) { -+ if (rpmdbFindFpListExclude(rpmtsGetRdb(ts), fi->fps, matches, fc, rpmteType(p) == TR_REMOVED ? fi->record : 0)) { - ps = rpmpsFree(ps); - rpmtsFreeLock(lock); - return 1; /* XXX WTFO? */ -Index: rpmdb/fprint.h -=================================================================== ---- rpmdb/fprint.h.orig -+++ rpmdb/fprint.h -@@ -79,6 +79,12 @@ int rpmdbFindFpList(/*@null@*/ rpmdb db, - /*@modifies db, *matchList, rpmGlobalMacroContext, - fileSystem, internalState @*/; - -+int rpmdbFindFpListExclude(/*@null@*/ rpmdb db, fingerPrint * fpList, -+ /*@out@*/ dbiIndexSet * matchList, int numItems, unsigned int exclude) -+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ -+ /*@modifies db, *matchList, rpmGlobalMacroContext, -+ fileSystem, internalState @*/; -+ - /* Be carefull with the memory... assert(*fullName == '/' || !scareMemory) */ - - /** -Index: rpmdb/rpmdb.c -=================================================================== ---- rpmdb/rpmdb.c.orig -+++ rpmdb/rpmdb.c -@@ -2390,7 +2390,7 @@ static void rpmdbSortIterator(/*@null@*/ - } - - /*@-bounds@*/ /* LCL: segfault */ --static int rpmdbGrowIterator(/*@null@*/ rpmdbMatchIterator mi, int fpNum) -+static int rpmdbGrowIterator(/*@null@*/ rpmdbMatchIterator mi, int fpNum, unsigned int exclude) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/ - { -@@ -2401,7 +2401,7 @@ static int rpmdbGrowIterator(/*@null@*/ - dbiIndexSet set; - int rc; - int xx; -- int i; -+ int i, j; - - if (mi == NULL) - return 1; -@@ -2437,6 +2437,25 @@ static int rpmdbGrowIterator(/*@null@*/ - - set = NULL; - (void) dbt2set(dbi, data, &set); -+ -+ /* prune the set against exclude */ -+ for (i = j = 0; i < set->count; i++) { -+ if (exclude && set->recs[i].hdrNum == exclude) -+ continue; -+ if (i != j) -+ set->recs[j] = set->recs[i]; -+ j++; -+ } -+ if (j == 0) { -+#ifdef SQLITE_HACK -+ xx = dbiCclose(dbi, dbcursor, 0); -+ dbcursor = NULL; -+#endif -+ set = dbiFreeIndexSet(set); -+ return DB_NOTFOUND; -+ } -+ set->count = j; -+ - for (i = 0; i < set->count; i++) - set->recs[i].fpNum = fpNum; - -@@ -3412,6 +3431,12 @@ static int skipDir(const char * dn) - int rpmdbFindFpList(rpmdb db, fingerPrint * fpList, dbiIndexSet * matchList, - int numItems) - { -+ return rpmdbFindFpListExclude(db, fpList, matchList, numItems, 0); -+} -+ -+int rpmdbFindFpListExclude(rpmdb db, fingerPrint * fpList, dbiIndexSet * matchList, -+ int numItems, unsigned int exclude) -+{ - DBT * key; - DBT * data; - HGE_t hge = (HGE_t)headerGetEntryMinMemory; -@@ -3443,10 +3468,13 @@ key->data = (void *) fpList[i].baseName; - key->size = strlen((char *)key->data); - if (key->size == 0) key->size++; /* XXX "/" fixup. */ - -- if (skipDir(fpList[i].entry->dirName)) -+ /* HACK HACK HACK: don't skip dirs while removing -+ * packages as we will loose files on conflicts. -+ * exclude is not zero when removing */ -+ if (!exclude && skipDir(fpList[i].entry->dirName)) - continue; - -- xx = rpmdbGrowIterator(mi, i); -+ xx = rpmdbGrowIterator(mi, i, exclude); - - } - diff --git a/findksyms.diff b/findksyms.diff index 2bccd1c..d279ad4 100644 --- a/findksyms.diff +++ b/findksyms.diff @@ -5,6 +5,8 @@ SUSE specific kernel provides/requires scripts scripts/find-requires.ksyms | 57 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) +Index: scripts/find-provides.ksyms +=================================================================== --- /dev/null +++ scripts/find-provides.ksyms @@ -0,0 +1,41 @@ @@ -49,6 +51,8 @@ SUSE specific kernel provides/requires scripts + | sed -r -ne "s/^0*([0-9a-f]+) A __crc_(.+)/ksym($flavor:\\2) = \\1/p" +done \ +| sort -u +Index: scripts/find-requires.ksyms +=================================================================== --- /dev/null +++ scripts/find-requires.ksyms @@ -0,0 +1,57 @@ @@ -109,3 +113,23 @@ SUSE specific kernel provides/requires scripts + { print "ksym(" flavor ":" arr[3] ") = " arr[2] } + ' +fi +Index: scripts/Makefile.am +=================================================================== +--- scripts/Makefile.am.orig ++++ scripts/Makefile.am +@@ -19,6 +19,7 @@ EXTRA_DIST = \ + tcl.req tgpg u_pkg.sh \ + vpkg-provides.sh vpkg-provides2.sh \ + find-requires.php find-provides.php \ ++ find-requires.ksyms find-provides.ksyms \ + find-php-provides find-php-requires \ + mono-find-requires mono-find-provides \ + pkgconfigdeps.sh libtooldeps.sh +@@ -33,6 +34,7 @@ rpmconfig_SCRIPTS = \ + check-buildroot check-rpaths check-rpaths-worker \ + find-lang.sh \ + perl.prov perl.req perldeps.pl pythondeps.sh osgideps.pl \ ++ find-requires.ksyms find-provides.ksyms \ + mono-find-requires mono-find-provides \ + pkgconfigdeps.sh libtooldeps.sh \ + rpmdb_loadcvt rpmdiff rpm2cpio.sh tcl.req tgpg diff --git a/findlang.diff b/findlang.diff index 0862f91..3be64ba 100644 --- a/findlang.diff +++ b/findlang.diff @@ -42,7 +42,7 @@ Index: scripts/find-lang.sh --with-qt ) QT= shift -@@ -97,32 +105,48 @@ while test $# -gt 0 ; do +@@ -97,33 +105,49 @@ while test $# -gt 0 ; do esac done @@ -60,7 +60,7 @@ Index: scripts/find-lang.sh s:^\([^%].*\):: s:%lang(C) :: -/^$/d' > $MO_NAME -+/^ *$/d' >> $MO_NAME_NEW ++/^$/d' >> $MO_NAME_NEW + +find $TOP_DIR -type f -o -type l|sed ' +s:'"$TOP_DIR"':: @@ -92,38 +92,42 @@ Index: scripts/find-lang.sh find $TOP_DIR -type d|sed ' s:'"$TOP_DIR"':: '"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'$\):%dir \1: + '"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1: s:^\([^%].*\):: -/^$/d' >> $MO_NAME +/^$/d' >> $MO_NAME_NEW find $TOP_DIR -type f|sed ' s:'"$TOP_DIR"':: -@@ -130,7 +154,7 @@ s:'"$TOP_DIR"':: +@@ -131,7 +155,7 @@ s:'"$TOP_DIR"':: '"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1: s:^[^%].*:: s:%lang(C) :: -/^$/d' >> $MO_NAME +/^$/d' >> $MO_NAME_NEW - find $TOP_DIR -type d|sed ' - s:'"$TOP_DIR"':: -@@ -138,9 +162,13 @@ s:'"$TOP_DIR"':: - '"$NO_ALL_NAME$KDE"'s:\(.*/doc/kde/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'\)$:%lang(\2) \1\2\3: - '"$ALL_NAME$KDE"'s:\(.*/doc/kde/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\):: - '"$ALL_NAME$KDE"'s:\(.*/doc/kde/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3: -+'"$NO_ALL_NAME$KDE"'s:\(.*/kde.*share/doc/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'/\):: -+'"$NO_ALL_NAME$KDE"'s:\(.*/kde.*share/doc/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'\)$:%lang(\2) %doc \1\2\3: -+'"$ALL_NAME$KDE"'s:\(.*/kde.*share/doc/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\):: -+'"$ALL_NAME$KDE"'s:\(.*/kde.*share/doc/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) %doc \1\2\3: + KDE3_HTML=`kde-config --expandvars --install html 2>/dev/null` + if [ x"$KDE3_HTML" != x -a -d "$TOP_DIR$KDE3_HTML" ]; then +@@ -143,7 +167,7 @@ s:'"$TOP_DIR"':: + '"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3: s:^\([^%].*\):: s:%lang(C) :: -/^$/d' >> $MO_NAME +/^$/d' >> $MO_NAME_NEW + fi + + KDE4_HTML=`kde4-config --expandvars --install html 2>/dev/null` +@@ -156,7 +180,7 @@ s:'"$TOP_DIR"':: + '"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3: + s:^\([^%].*\):: + s:%lang(C) :: +-/^$/d' >> $MO_NAME ++/^$/d' >> $MO_NAME_NEW + fi find $TOP_DIR -type f -o -type l|sed ' - s:'"$TOP_DIR"':: -@@ -148,7 +176,7 @@ s:'"$TOP_DIR"':: - '"$ALL_NAME$QT"'s:\(.*[/_]\([^/_]\+\)\.qm$\):%lang(\2) \1: +@@ -168,7 +192,7 @@ s:'"$TOP_DIR"':: + '"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1: s:^[^%].*:: s:%lang(C) :: -/^$/d' >> $MO_NAME @@ -131,8 +135,8 @@ Index: scripts/find-lang.sh find $TOP_DIR -type d|sed ' s:'"$TOP_DIR"':: -@@ -156,17 +184,20 @@ s:'"$TOP_DIR"':: - '"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1: +@@ -176,17 +200,22 @@ s:'"$TOP_DIR"':: + '"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*: s:^\([^%].*\):: s:%lang(C) :: -/^$/d' >> $MO_NAME @@ -140,7 +144,7 @@ Index: scripts/find-lang.sh find $TOP_DIR -type f -o -type l|sed ' s:'"$TOP_DIR"':: - '"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1: + '"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*: s:^\([^%].*\):: s:%lang(C) :: -/^$/d' >> $MO_NAME @@ -149,9 +153,11 @@ Index: scripts/find-lang.sh -if ! grep -q / $MO_NAME; then +if ! grep -q / $MO_NAME_NEW; then echo "No translations found for ${NAME} in ${TOP_DIR}" -+ rm -rf $MO_NAME_NEW ++ rm -f $MO_NAME_NEW exit 1 fi ++ +sort -u $MO_NAME_NEW >> $MO_NAME +rm -f $MO_NAME_NEW ++ exit 0 diff --git a/fingerprint.diff b/fingerprint.diff deleted file mode 100644 index bf877d4..0000000 --- a/fingerprint.diff +++ /dev/null @@ -1,24 +0,0 @@ ---- rpmio/rpmpgp.c.orig 2008-10-28 16:14:18.000000000 +0000 -+++ rpmio/rpmpgp.c 2008-10-28 16:09:51.000000000 +0000 -@@ -876,6 +876,7 @@ - const uint8_t *se, *h; - DIGEST_CTX ctx; - int rc = -1; /* assume failure. */ -+ byte in[3]; - - if (!(val & 0x80)) - return rc; -@@ -926,7 +927,12 @@ - } - - ctx = rpmDigestInit(PGPHASHALGO_SHA1, RPMDIGEST_NONE); -- (void) rpmDigestUpdate(ctx, pkt, (se-pkt)); -+ i = se - h; -+ in[0] = 0x99; -+ in[1] = i >> 8; -+ in[2] = i; -+ (void) rpmDigestUpdate(ctx, in, 3); -+ (void) rpmDigestUpdate(ctx, h, i); - (void) rpmDigestFinal(ctx, (void **)&d, &dlen, 0); - - memmove(keyid, (d + (dlen-8)), 8); diff --git a/globlstat.diff b/globlstat.diff deleted file mode 100644 index 2ab4040..0000000 --- a/globlstat.diff +++ /dev/null @@ -1,20 +0,0 @@ -Always use lstat in glob call to work around a change in glibc's -glob code. [#129434], rh#126460 - -rpm-4.4.7 comes with its own glob implementation, so it doesn't -need this patch (but it also doesn't hurt). - -Index: rpmio/rpmrpc.c -=================================================================== ---- rpmio/rpmrpc.c.orig -+++ rpmio/rpmrpc.c -@@ -1462,7 +1462,8 @@ fprintf(stderr, "*** Glob(%s,0x%x,%p,%p) - pglob->gl_readdir = Readdir; - pglob->gl_opendir = Opendir; - pglob->gl_lstat = Lstat; -- pglob->gl_stat = Stat; -+ /* always use lstat to glob symlinks */ -+ pglob->gl_stat = Lstat; - /*@=type@*/ - flags |= GLOB_ALTDIRFUNC; - flags &= ~GLOB_TILDE; diff --git a/legacyprereq.diff b/legacyprereq.diff deleted file mode 100644 index 2f7af00..0000000 --- a/legacyprereq.diff +++ /dev/null @@ -1,16 +0,0 @@ -Keep RPMSENSE_PREREQ definition to be compatible with older -versions. Maybe not needed. - -diff -ur ./lib/rpmlib.h ../rpm-4.4.2.orig/lib/rpmlib.h ---- ./lib/rpmlib.h 2006-09-21 21:07:18.000000000 +0200 -+++ ../rpm-4.4.2.orig/lib/rpmlib.h 2006-09-21 20:59:00.000000000 +0200 -@@ -517,8 +517,7 @@ - RPMSENSE_EQUAL = (1 << 3), - RPMSENSE_PROVIDES = (1 << 4), /* only used internally by builds */ - RPMSENSE_CONFLICTS = (1 << 5), /* only used internally by builds */ -- /* bit 6 used to be RPMSENSE_PREREQ */ --#define RPMSENSE_PREREQ RPMSENSE_ANY -+ RPMSENSE_PREREQ = (1 << 6), /*!< @todo Legacy. */ - RPMSENSE_OBSOLETES = (1 << 7), /* only used internally by builds */ - RPMSENSE_INTERP = (1 << 8), /*!< Interpreter used by scriptlet. */ - RPMSENSE_SCRIPT_PRE = ((1 << 9)|RPMSENSE_PREREQ), /*!< %pre dependency. */ diff --git a/localetag.diff b/localetag.diff index fd6e632..8f4ead9 100644 --- a/localetag.diff +++ b/localetag.diff @@ -1,25 +1,23 @@ Convert changelog and i18n header elements to current locale. [#43347], rh#140050 -Already in rpm-4.4.7 - -Index: lib/formats.c +Index: lib/tagexts.c =================================================================== ---- lib/formats.c.orig -+++ lib/formats.c +--- lib/tagexts.c.orig ++++ lib/tagexts.c @@ -2,6 +2,7 @@ * \file lib/formats.c */ +#include #include "system.h" - #include "rpmio_internal.h" - #include -@@ -18,6 +19,114 @@ - /*@access pgpDig @*/ - /*@access pgpDigParams @*/ -+static const char * strtolocale(const char *str) + #include +@@ -156,6 +157,114 @@ exit: + return rc; + } + ++static char * strtolocale(char *str) +{ + wchar_t *wstr, *wp; + const unsigned char *cp; @@ -101,7 +99,7 @@ Index: lib/formats.c + wstr = _free(wstr); + return str; + } -+ str = _free(str); ++ str = _free((char *)str); + memset(&ps, 0, sizeof(ps)); + ccl = cca = 0; + for (wp = wstr; ; wp++) { @@ -124,104 +122,79 @@ Index: lib/formats.c + } + } + wstr = _free(wstr); -+ return (const char *)cc; ++ return (char *)cc; +} + /** - * Identify type of trigger. - * @param type tag type -@@ -1080,6 +1189,7 @@ static int i18nTag(Header h, int_32 tag, + * Retrieve mounted file system paths. + * @param h header +@@ -534,9 +643,43 @@ static int i18nTag(Header h, rpmTag tag, + dstring = _free(dstring); - if (rc && (*data) != NULL) { - *data = xstrdup(*data); -+ *data = strtolocale(*data); - *freeData = 1; - return 0; - } -@@ -1091,6 +1201,56 @@ static int i18nTag(Header h, int_32 tag, - } - - /** -+ * Retrieve text and convert to locale. -+ */ -+static int localeTag(Header h, int_32 tag, /*@out@*/ rpmTagType * type, -+ /*@out@*/ const void ** data, /*@out@*/ int_32 * count, -+ /*@out@*/ int * freeData) -+{ -+ HGE_t hge = (HGE_t)headerGetEntryMinMemory; -+ rpmTagType t; -+ char **d, **d2, *dp; -+ int rc, i, l; -+ -+ rc = hge(h, tag, &t, (void **)&d, count); -+ if (!rc || d == NULL || *count == 0) { -+ *freeData = 0; -+ *data = NULL; -+ *count = 0; -+ return 1; + rc = headerGet(h, tag, td, HEADERGET_DEFAULT); ++ if (rc && td->data) { ++ td->data = xstrdup(td->data); ++ td->data = strtolocale(td->data); ++ td->flags = RPMTD_ALLOCED; + } -+ if (type) -+ *type = t; -+ if (t == RPM_STRING_TYPE) { -+ d = (char **)xstrdup((char *)d); -+ d = (char **)strtolocale((char *)d); -+ *freeData = 1; -+ } else if (t == RPM_STRING_ARRAY_TYPE) { -+ l = 0; -+ for (i = 0; i < *count; i++) { -+ d[i] = xstrdup(d[i]); -+ d[i] = (char *)strtolocale(d[i]); -+ l += strlen(d[i]) + 1; -+ } -+ d2 = xmalloc(*count * sizeof(char *) + l); -+ dp = (char *)(d2 + *count); -+ for (i = 0; i < *count; i++) { -+ d2[i] = dp; -+ strcpy(dp, d[i]); -+ dp += strlen(dp) + 1; -+ d[i] = _free(d[i]); -+ } -+ d = _free(d); -+ d = d2; -+ *freeData = 1; -+ } else -+ *freeData = 0; -+ *data = (void **)d; -+ return 0; ++ return rc; +} + -+ +/** - * Retrieve summary text. - * @param h header - * @retval *type tag type -@@ -1130,6 +1290,20 @@ static int descriptionTag(Header h, /*@o - return i18nTag(h, RPMTAG_DESCRIPTION, type, data, count, freeData); ++ * Retrieve text and convert to locale. ++ */ ++static int localeTag(Header h, rpmTag tag, rpmtd td) ++{ ++ int rc; ++ rc = headerGet(h, tag, td, HEADERGET_DEFAULT); ++ if (!rc) ++ return 0; ++ if (td->type == RPM_STRING_TYPE) { ++ td->data = xstrdup(td->data); ++ td->data = strtolocale(td->data); ++ td->flags = RPMTD_ALLOCED; ++ td->count = 1; ++ } else if (td->type == RPM_STRING_ARRAY_TYPE) { ++ char **arr; ++ int i; ++ arr = xmalloc(td->count * sizeof(*arr)); ++ for (i = 0; i < td->count; i++) { ++ arr[i] = xstrdup(((char **)td->data)[i]); ++ arr[i] = strtolocale(arr[i]); ++ } ++ td->data = arr; ++ td->flags = RPMTD_ALLOCED | RPMTD_PTR_ALLOCED; ++ } + return rc; } -+static int changelognameTag(Header h, /*@out@*/ rpmTagType * type, -+ /*@out@*/ const void ** data, /*@out@*/ int_32 * count, -+ /*@out@*/ int * freeData) ++ + /** + * Retrieve summary text. + * @param h header +@@ -559,6 +702,16 @@ static int descriptionTag(Header h, rpmt + return i18nTag(h, RPMTAG_DESCRIPTION, td); + } + ++static int changelognameTag(Header h, rpmtd td) +{ -+ return localeTag(h, RPMTAG_CHANGELOGNAME, type, data, count, freeData); ++ return localeTag(h, RPMTAG_CHANGELOGNAME, td); +} + -+static int changelogtextTag(Header h, /*@out@*/ rpmTagType * type, -+ /*@out@*/ const void ** data, /*@out@*/ int_32 * count, -+ /*@out@*/ int * freeData) ++static int changelogtextTag(Header h, rpmtd td) +{ -+ return localeTag(h, RPMTAG_CHANGELOGTEXT, type, data, count, freeData); ++ return localeTag(h, RPMTAG_CHANGELOGTEXT, td); +} + /** * Retrieve group text. * @param h header -@@ -1155,6 +1329,8 @@ const struct headerSprintfExtension_s rp - { HEADER_EXT_TAG, "RPMTAG_GROUP", { groupTag } }, - { HEADER_EXT_TAG, "RPMTAG_DESCRIPTION", { descriptionTag } }, - { HEADER_EXT_TAG, "RPMTAG_SUMMARY", { summaryTag } }, -+ { HEADER_EXT_TAG, "RPMTAG_CHANGELOGNAME", { changelognameTag } }, -+ { HEADER_EXT_TAG, "RPMTAG_CHANGELOGTEXT", { changelogtextTag } }, - { HEADER_EXT_TAG, "RPMTAG_FILECLASS", { fileclassTag } }, - { HEADER_EXT_TAG, "RPMTAG_FILECONTEXTS", { filecontextsTag } }, - { HEADER_EXT_TAG, "RPMTAG_FILENAMES", { filenamesTag } }, +@@ -663,6 +816,8 @@ static const struct headerTagFunc_s rpmH + { RPMTAG_LONGARCHIVESIZE, longarchivesizeTag }, + { RPMTAG_LONGSIZE, longsizeTag }, + { RPMTAG_LONGSIGSIZE, longsigsizeTag }, ++ { RPMTAG_CHANGELOGNAME, changelognameTag }, ++ { RPMTAG_CHANGELOGTEXT, changelogtextTag }, + { 0, NULL } + }; + diff --git a/luaroot.diff b/luaroot.diff index ee66eac..764aec9 100644 --- a/luaroot.diff +++ b/luaroot.diff @@ -2,67 +2,55 @@ Index: lib/psm.c =================================================================== --- lib/psm.c.orig +++ lib/psm.c -@@ -506,6 +506,8 @@ static rpmRC runLuaScript(rpmpsm psm, He - { - const rpmts ts = psm->ts; +@@ -441,6 +441,8 @@ static rpmRC runLuaScript(rpmpsm psm, He + #ifdef WITH_LUA + char *sname = NULL; int rootFd = -1; + int chroot_done; + const char *rootDir; - const char *n, *v, *r; - rpmRC rc = RPMRC_OK; - int i; -@@ -515,20 +517,27 @@ static rpmRC runLuaScript(rpmpsm psm, He - - xx = headerNVR(h, &n, &v, &r); + int xx; + rpmlua lua = NULL; /* Global state. */ + rpmluav var; +@@ -449,16 +451,21 @@ static rpmRC runLuaScript(rpmpsm psm, He + rpmlog(RPMLOG_DEBUG, "%s: %s running scriptlet.\n", + psm->stepName, sname); - if (!rpmtsChrootDone(ts)) { - const char *rootDir = rpmtsRootDir(ts); - xx = chdir("/"); +- rootFd = open(".", O_RDONLY, 0); +- if (rootFd >= 0) { +- if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') + chroot_done = rpmtsChrootDone(ts); + rootDir = rpmtsRootDir(ts); + if (!chroot_done) { + if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') { + xx = chdir("/"); - /*@-nullpass@*/ -- rootFd = open(".", O_RDONLY, 0); + rootFd = open(".", O_RDONLY, 0); - /*@=nullpass@*/ -- if (rootFd >= 0) { -- /*@-superuser -noeffect @*/ -- if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') + if (rootFd >= 0) { -+ /*@-superuser -noeffect @*/ xx = chroot(rootDir); -- /*@=superuser =noeffect @*/ - xx = rpmtsSetChrootDone(ts, 1); -+ /*@=superuser =noeffect @*/ + xx = rpmtsSetChrootDone(ts, 1); + } } + } else { -+/*@-nullpass@*/ + rootFd = open(".", O_RDONLY, 0); -+/*@=nullpass@*/ } + xx = chdir("/"); /* Create arg variable */ rpmluaPushTable(lua, "arg"); -@@ -565,14 +574,19 @@ static rpmRC runLuaScript(rpmpsm psm, He +@@ -491,12 +498,17 @@ static rpmRC runLuaScript(rpmpsm psm, He rpmluaDelVar(lua, "arg"); if (rootFd >= 0) { - const char *rootDir = rpmtsRootDir(ts); xx = fchdir(rootFd); xx = close(rootFd); -- /*@-superuser -noeffect @*/ - if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') + if (!chroot_done) { -+ /*@-superuser -noeffect @*/ xx = chroot("."); -- /*@=superuser =noeffect @*/ - xx = rpmtsSetChrootDone(ts, 0); -+ /*@=superuser =noeffect @*/ + xx = rpmtsSetChrootDone(ts, 0); + } + } @@ -71,5 +59,5 @@ Index: lib/psm.c + if (currDir != NULL) + xx = chdir(currDir); } - - return rc; + free(sname); + #else diff --git a/lzma-payload-2.diff b/lzma-payload-2.diff deleted file mode 100644 index d0e9993..0000000 --- a/lzma-payload-2.diff +++ /dev/null @@ -1,454 +0,0 @@ -Index: rpmio/rpmio.c -=================================================================== ---- rpmio/rpmio.c.orig -+++ rpmio/rpmio.c -@@ -84,6 +84,7 @@ static int inet_aton(const char *cp, str - #define FDONLY(fd) assert(fdGetIo(fd) == fdio) - #define GZDONLY(fd) assert(fdGetIo(fd) == gzdio) - #define BZDONLY(fd) assert(fdGetIo(fd) == bzdio) -+#define LZDONLY(fd) assert(fdGetIo(fd) == lzdio) - - #define UFDONLY(fd) /* assert(fdGetIo(fd) == ufdio) */ - -@@ -189,6 +190,8 @@ static /*@observer@*/ const char * fdbg( - } else if (fps->io == bzdio) { - sprintf(be, "BZD %p fdno %d", fps->fp, fps->fdno); - #endif -+ } else if (fps->io == lzdio) { -+ sprintf(be, "LZD %p fdno %d", fps->fp, fps->fdno); - } else if (fps->io == fpio) { - /*@+voidabstract@*/ - sprintf(be, "%s %p(%d) fdno %d", -@@ -2782,6 +2785,348 @@ FDIO_t bzdio = /*@-compmempass@*/ &bzdio - /*@=moduncon@*/ - #endif /* HAVE_BZLIB_H */ - -+#include -+#include -+#include -+ -+#define kBufferSize (1 << 15) -+ -+typedef struct lzfile { -+ /* IO buffer */ -+ uint8_t buf[kBufferSize]; -+ -+ lzma_stream strm; -+ -+ FILE *file; -+ -+ int encoding; -+ int eof; -+ -+} LZFILE; -+ -+static LZFILE *lzopen_internal(const char *path, const char *mode, int fd) -+{ -+ int level = 5; -+ int encoding = 0; -+ FILE *fp; -+ LZFILE *lzfile; -+ lzma_ret ret; -+ -+ for (; *mode; mode++) { -+ if (*mode == 'w') -+ encoding = 1; -+ else if (*mode == 'r') -+ encoding = 0; -+ else if (*mode >= '1' && *mode <= '9') -+ level = *mode - '0'; -+ } -+ if (fd != -1) -+ fp = fdopen(fd, encoding ? "w" : "r"); -+ else -+ fp = fopen(path, encoding ? "w" : "r"); -+ if (!fp) -+ return 0; -+ lzfile = calloc(1, sizeof(*lzfile)); -+ if (!lzfile) { -+ fclose(fp); -+ return 0; -+ } -+ lzfile->file = fp; -+ lzfile->encoding = encoding; -+ lzfile->eof = 0; -+ lzfile->strm = LZMA_STREAM_INIT_VAR; -+ if (encoding) { -+ lzma_options_alone alone; -+ alone.uncompressed_size = LZMA_VLI_VALUE_UNKNOWN; -+ memcpy(&alone.lzma, &lzma_preset_lzma[level - 1], sizeof(alone.lzma)); -+ ret = lzma_alone_encoder(&lzfile->strm, &alone); -+ } else { -+ ret = lzma_auto_decoder(&lzfile->strm, 0, 0); -+ } -+ if (ret != LZMA_OK) { -+ fclose(fp); -+ free(lzfile); -+ return 0; -+ } -+ return lzfile; -+} -+ -+static LZFILE *lzopen(const char *path, const char *mode) -+{ -+ return lzopen_internal(path, mode, -1); -+} -+ -+static LZFILE *lzdopen(int fd, const char *mode) -+{ -+ if (fd < 0) -+ return 0; -+ return lzopen_internal(0, mode, fd); -+} -+ -+static int lzflush(LZFILE *lzfile) -+{ -+ return fflush(lzfile->file); -+} -+ -+static int lzclose(LZFILE *lzfile) -+{ -+ lzma_ret ret; -+ int n; -+ -+ if (!lzfile) -+ return -1; -+ if (lzfile->encoding) { -+ for (;;) { -+ lzfile->strm.avail_out = kBufferSize; -+ lzfile->strm.next_out = lzfile->buf; -+ ret = lzma_code(&lzfile->strm, LZMA_FINISH); -+ if (ret != LZMA_OK && ret != LZMA_STREAM_END) -+ return -1; -+ n = kBufferSize - lzfile->strm.avail_out; -+ if (n && fwrite(lzfile->buf, 1, n, lzfile->file) != n) -+ return -1; -+ if (ret == LZMA_STREAM_END) -+ break; -+ } -+ } -+ lzma_end(&lzfile->strm); -+ return fclose(lzfile->file); -+ free(lzfile); -+} -+ -+static ssize_t lzread(LZFILE *lzfile, void *buf, size_t len) -+{ -+ lzma_ret ret; -+ int eof = 0; -+ -+ if (!lzfile || lzfile->encoding) -+ return -1; -+ if (lzfile->eof) -+ return 0; -+ lzfile->strm.next_out = buf; -+ lzfile->strm.avail_out = len; -+ for (;;) { -+ if (!lzfile->strm.avail_in) { -+ lzfile->strm.next_in = lzfile->buf; -+ lzfile->strm.avail_in = fread(lzfile->buf, 1, kBufferSize, lzfile->file); -+ if (!lzfile->strm.avail_in) -+ eof = 1; -+ } -+ ret = lzma_code(&lzfile->strm, LZMA_RUN); -+ if (ret == LZMA_STREAM_END) { -+ lzfile->eof = 1; -+ return len - lzfile->strm.avail_out; -+ } -+ if (ret != LZMA_OK) -+ return -1; -+ if (!lzfile->strm.avail_out) -+ return len; -+ if (eof) -+ return -1; -+ } -+} -+ -+static ssize_t lzwrite(LZFILE *lzfile, void *buf, size_t len) -+{ -+ lzma_ret ret; -+ int n; -+ if (!lzfile || !lzfile->encoding) -+ return -1; -+ if (!len) -+ return 0; -+ lzfile->strm.next_in = buf; -+ lzfile->strm.avail_in = len; -+ for (;;) { -+ lzfile->strm.next_out = lzfile->buf; -+ lzfile->strm.avail_out = kBufferSize; -+ ret = lzma_code(&lzfile->strm, LZMA_RUN); -+ if (ret != LZMA_OK) -+ return -1; -+ n = kBufferSize - lzfile->strm.avail_out; -+ if (n && fwrite(lzfile->buf, 1, n, lzfile->file) != n) -+ return -1; -+ if (!lzfile->strm.avail_in) -+ return len; -+ } -+} -+ -+/* =============================================================== */ -+ -+static inline /*@dependent@*/ void * lzdFileno(FD_t fd) -+ /*@*/ -+{ -+ void * rc = NULL; -+ int i; -+ -+ FDSANE(fd); -+ for (i = fd->nfps; i >= 0; i--) { -+/*@-boundsread@*/ -+ FDSTACK_t * fps = &fd->fps[i]; -+/*@=boundsread@*/ -+ if (fps->io != lzdio) -+ continue; -+ rc = fps->fp; -+ break; -+ } -+ -+ return rc; -+} -+ -+/*@-globuse@*/ -+static /*@null@*/ FD_t lzdOpen(const char * path, const char * mode) -+ /*@globals fileSystem @*/ -+ /*@modifies fileSystem @*/ -+{ -+ FD_t fd; -+ LZFILE *lzfile; -+ if ((lzfile = lzopen(path, mode)) == NULL) -+ return NULL; -+ fd = fdNew("open (lzdOpen)"); -+ fdPop(fd); fdPush(fd, lzdio, lzfile, -1); -+ return fdLink(fd, "lzdOpen"); -+} -+/*@=globuse@*/ -+ -+ -+/*@-globuse@*/ -+static /*@null@*/ FD_t lzdFdopen(void * cookie, const char * fmode) -+ /*@globals fileSystem, internalState @*/ -+ /*@modifies fileSystem, internalState @*/ -+{ -+ FD_t fd = c2f(cookie); -+ int fdno; -+ LZFILE *lzfile; -+ -+ if (fmode == NULL) return NULL; -+ fdno = fdFileno(fd); -+ fdSetFdno(fd, -1); /* XXX skip the fdio close */ -+ if (fdno < 0) return NULL; -+ lzfile = lzdopen(fdno, fmode); -+ if (lzfile == NULL) return NULL; -+ fdPush(fd, lzdio, lzfile, fdno); -+ return fdLink(fd, "lzdFdopen"); -+} -+/*@=globuse@*/ -+ -+/*@-globuse@*/ -+static int lzdFlush(FD_t fd) -+ /*@globals fileSystem @*/ -+ /*@modifies fileSystem @*/ -+{ -+ return lzflush(lzdFileno(fd)); -+} -+/*@=globuse@*/ -+ -+/* =============================================================== */ -+/*@-globuse@*/ -+/*@-mustmod@*/ /* LCL: *buf is modified */ -+static ssize_t lzdRead(void * cookie, /*@out@*/ char * buf, size_t count) -+ /*@globals fileSystem, internalState @*/ -+ /*@modifies *buf, fileSystem, internalState @*/ -+{ -+ FD_t fd = c2f(cookie); -+ LZFILE *lzfile; -+ ssize_t rc = 0; -+ -+ if (fd->bytesRemain == 0) return 0; /* XXX simulate EOF */ -+ lzfile = lzdFileno(fd); -+ fdstat_enter(fd, FDSTAT_READ); -+ if (lzfile) -+ /*@-compdef@*/ -+ rc = lzread(lzfile, buf, count); -+ /*@=compdef@*/ -+ if (rc == -1) { -+ fd->errcookie = "Lzma: decoding error"; -+ } else if (rc >= 0) { -+ fdstat_exit(fd, FDSTAT_READ, rc); -+ /*@-compdef@*/ -+ if (fd->ndigests && rc > 0) fdUpdateDigests(fd, (void *)buf, rc); -+ /*@=compdef@*/ -+ } -+ return rc; -+} -+/*@=mustmod@*/ -+/*@=globuse@*/ -+ -+/*@-globuse@*/ -+static ssize_t lzdWrite(void * cookie, const char * buf, size_t count) -+/*@globals fileSystem, internalState @*/ -+/*@modifies fileSystem, internalState @*/ -+{ -+ FD_t fd = c2f(cookie); -+ LZFILE *lzfile; -+ ssize_t rc = 0; -+ -+ if (fd == NULL || fd->bytesRemain == 0) return 0; /* XXX simulate EOF */ -+ -+ if (fd->ndigests && count > 0) fdUpdateDigests(fd, (void *)buf, count); -+ -+ lzfile = lzdFileno(fd); -+ -+ fdstat_enter(fd, FDSTAT_WRITE); -+ rc = lzwrite(lzfile, (void *)buf, count); -+ if (rc < 0) { -+ fd->errcookie = "Lzma: encoding error"; -+ } else if (rc > 0) { -+ fdstat_exit(fd, FDSTAT_WRITE, rc); -+ } -+ return rc; -+} -+ -+static inline int lzdSeek(void * cookie, /*@unused@*/ _libio_pos_t pos, -+ /*@unused@*/ int whence) -+ /*@*/ -+{ -+ FD_t fd = c2f(cookie); -+ -+ LZDONLY(fd); -+ return -2; -+} -+ -+static int lzdClose( /*@only@*/ void * cookie) -+ /*@globals fileSystem, internalState @*/ -+ /*@modifies fileSystem, internalState @*/ -+{ -+ FD_t fd = c2f(cookie); -+ LZFILE *lzfile; -+ int rc; -+ -+ lzfile = lzdFileno(fd); -+ -+ if (lzfile == NULL) return -2; -+ fdstat_enter(fd, FDSTAT_CLOSE); -+ /*@-dependenttrans@*/ -+ rc = lzclose(lzfile); -+ /*@=dependenttrans@*/ -+ -+ /* XXX TODO: preserve fd if errors */ -+ -+ if (fd) { -+ if (rc == -1) { -+ fd->errcookie = strerror(ferror(lzfile->file)); -+ } else if (rc >= 0) { -+ fdstat_exit(fd, FDSTAT_CLOSE, rc); -+ } -+ } -+ -+DBGIO(fd, (stderr, "==>\tlzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, fdbg(fd))); -+ -+ if (_rpmio_debug || rpmIsDebug()) fdstat_print(fd, "LZDIO", stderr); -+ /*@-branchstate@*/ -+ if (rc == 0) -+ fd = fdFree(fd, "open (lzdClose)"); -+ /*@=branchstate@*/ -+ return rc; -+} -+ -+/*@-type@*/ /* LCL: function typedefs */ -+static struct FDIO_s lzdio_s = { -+ lzdRead, lzdWrite, lzdSeek, lzdClose, XfdLink, XfdFree, XfdNew, fdFileno, -+ NULL, lzdOpen, lzdFileno, lzdFlush, NULL, NULL, NULL, NULL, NULL -+}; -+/*@=type@*/ -+FDIO_t lzdio = /*@-compmempass@*/ &lzdio_s /*@=compmempass@*/ ; -+ - /* =============================================================== */ - /*@observer@*/ - static const char * getFdErrstr (FD_t fd) -@@ -2800,7 +3145,9 @@ static const char * getFdErrstr (FD_t fd - errstr = fd->errcookie; - } else - #endif /* HAVE_BZLIB_H */ -- -+ if (fdGetIo(fd) == lzdio) { -+ errstr = fd->errcookie; -+ } else - { - errstr = (fd->syserrno ? strerror(fd->syserrno) : ""); - } -@@ -3114,6 +3461,9 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n" - fd = bzdFdopen(fd, zstdio); - /*@=internalglobs@*/ - #endif -+ } else if (!strcmp(end, "lzdio")) { -+ iof = lzdio; -+ fd = lzdFdopen(fd, zstdio); - } else if (!strcmp(end, "ufdio")) { - iof = ufdio; - } else if (!strcmp(end, "fpio")) { -@@ -3301,6 +3651,9 @@ int Ferror(FD_t fd) - ec = (fd->syserrno || fd->errcookie != NULL) ? -1 : 0; - i--; /* XXX fdio under bzdio always has fdno == -1 */ - #endif -+ } else if (fps->io == lzdio) { -+ ec = (fd->syserrno || fd->errcookie != NULL) ? -1 : 0; -+ i--; /* XXX fdio under lzdio always has fdno == -1 */ - } else { - /* XXX need to check ufdio/gzdio/bzdio/fdio errors correctly. */ - ec = (fdFileno(fd) < 0 ? -1 : 0); ---- rpmio/rpmio.c 2009-02-11 10:48:50.000000000 +0100 -+++ rpmio.c 2009-02-11 12:32:05.000000000 +0100 -@@ -2834,11 +2834,12 @@ - lzfile->file = fp; - lzfile->encoding = encoding; - lzfile->eof = 0; -- lzfile->strm = LZMA_STREAM_INIT_VAR; -+ lzma_stream tmp = LZMA_STREAM_INIT; -+ lzfile->strm = tmp; -+ - if (encoding) { -- lzma_options_alone alone; -- alone.uncompressed_size = LZMA_VLI_VALUE_UNKNOWN; -- memcpy(&alone.lzma, &lzma_preset_lzma[level - 1], sizeof(alone.lzma)); -+ lzma_options_lzma alone; -+ lzma_lzma_preset(&alone, level - 1); - ret = lzma_alone_encoder(&lzfile->strm, &alone); - } else { - ret = lzma_auto_decoder(&lzfile->strm, 0, 0); ---- rpmio.orig/rpmio.c 2009-02-12 15:13:46.000000000 +0100 -+++ rpmio/rpmio.c 2009-02-12 15:58:36.000000000 +0100 -@@ -2842,7 +2842,7 @@ - lzma_lzma_preset(&alone, level - 1); - ret = lzma_alone_encoder(&lzfile->strm, &alone); - } else { -- ret = lzma_auto_decoder(&lzfile->strm, 0, 0); -+ ret = lzma_alone_decoder(&lzfile->strm, UINT64_C(1) << 24); - } - if (ret != LZMA_OK) { - fclose(fp); -@@ -2918,12 +2918,19 @@ - lzfile->eof = 1; - return len - lzfile->strm.avail_out; - } -- if (ret != LZMA_OK) -+ if (ret == LZMA_MEMLIMIT_ERROR) { -+ ret = lzma_memlimit_set(&lzfile->strm, 1 << 31); -+ continue; -+ } -+ if (ret != LZMA_OK) { - return -1; -- if (!lzfile->strm.avail_out) -+ } -+ if (!lzfile->strm.avail_out) { - return len; -- if (eof) -+ } -+ if (eof) { - return -1; -+ } - } - } - diff --git a/lzma-payload.diff b/lzma-payload.diff deleted file mode 100644 index 59a77c8..0000000 --- a/lzma-payload.diff +++ /dev/null @@ -1,116 +0,0 @@ -Index: build/pack.c -=================================================================== ---- build/pack.c.orig -+++ build/pack.c -@@ -479,6 +479,11 @@ int writeRPM(Header *hdrp, unsigned char - /* Add prereq on rpm version that understands bzip2 payloads */ - (void) rpmlibNeedsFeature(h, "PayloadIsBzip2", "3.0.5-1"); - } -+ if (s[1] == 'l' && s[2] == 'z') { -+ (void) headerAddEntry(h, RPMTAG_PAYLOADCOMPRESSOR, RPM_STRING_TYPE, -+ "lzma", 1); -+ (void) rpmlibNeedsFeature(h, "PayloadIsLzma", "4.4.2-1"); -+ } - strcpy(buf, rpmio_flags); - buf[s - rpmio_flags] = '\0'; - (void) headerAddEntry(h, RPMTAG_PAYLOADFLAGS, RPM_STRING_TYPE, buf+1, 1); -Index: lib/psm.c -=================================================================== ---- lib/psm.c.orig -+++ lib/psm.c -@@ -2097,6 +2097,8 @@ psm->te->h = headerFree(psm->te->h); - t = stpcpy(t, ".gzdio"); - if (!strcmp(payload_compressor, "bzip2")) - t = stpcpy(t, ".bzdio"); -+ if (!strcmp(payload_compressor, "lzma")) -+ t = stpcpy(t, ".lzdio"); - rc = RPMRC_OK; - } break; - -Index: lib/rpmlibprov.c -=================================================================== ---- lib/rpmlibprov.c.orig -+++ lib/rpmlibprov.c -@@ -59,6 +59,9 @@ static struct rpmlibProvides_s rpmlibPro - ( RPMSENSE_EQUAL), - N_("internal support for lua scripts.") }, - #endif -+ { "rpmlib(PayloadIsLzma)", "4.4.2-1", -+ (RPMSENSE_RPMLIB|RPMSENSE_EQUAL), -+ N_("package payload can be compressed using lzma.") }, - { NULL, NULL, 0, NULL } - }; - -Index: macros.in -=================================================================== ---- macros.in.orig -+++ macros.in -@@ -326,6 +326,7 @@ package or when debugging this package.\ - # Compression type and level for source/binary package payloads. - # "w9.gzdio" gzip level 9 (default). - # "w9.bzdio" bzip2 level 9. -+# "w5.lzdio" lzma level 5. (best compromise) - # - #%_source_payload w9.gzdio - %_binary_payload w2.lzdio -Index: rpm2cpio.c -=================================================================== ---- rpm2cpio.c.orig -+++ rpm2cpio.c -@@ -76,6 +76,8 @@ int main(int argc, char **argv) - t = stpcpy(t, ".gzdio"); - if (!strcmp(payload_compressor, "bzip2")) - t = stpcpy(t, ".bzdio"); -+ if (!strcmp(payload_compressor, "lzma")) -+ t = stpcpy(t, ".lzdio"); - } - - gzdi = Fdopen(fdi, rpmio_flags); /* XXX gzdi == fdi */ -Index: rpmio/rpmio.h -=================================================================== ---- rpmio/rpmio.h.orig -+++ rpmio/rpmio.h -@@ -669,6 +669,10 @@ int ufdGetFile( /*@killref@*/ FD_t sfd, - - /** - */ -+/*@observer@*/ /*@unchecked@*/ extern FDIO_t lzdio; -+ -+/** -+ */ - /*@observer@*/ /*@unchecked@*/ extern FDIO_t fadio; - /*@=exportlocal@*/ - /*@}*/ -Index: scripts/rpm2cpio.sh -=================================================================== ---- scripts/rpm2cpio.sh.orig -+++ scripts/rpm2cpio.sh -@@ -23,4 +23,14 @@ dl=`expr 256 \* \( 256 \* \( 256 \* $6 + - hdrsize=`expr 8 + 16 \* $il + $dl` - o=`expr $o + $hdrsize` - --dd if=$pkg ibs=$o skip=1 2>/dev/null | gunzip -+comp=`dd if="$pkg" ibs=$o skip=1 count=1 2>/dev/null \ -+ | dd bs=3 count=1 2>/dev/null` -+ -+gz="`echo . | awk '{ printf("%c%c", 0x1f, 0x8b); }'`" -+case "$comp" in -+ BZh) dd if="$pkg" ibs=$o skip=1 2>/dev/null | bunzip2 ;; -+ "$gz"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | gunzip ;; -+ # no magic in old lzma format, if unknown we assume that's lzma for now -+ *) dd if="$pkg" ibs=$o skip=1 2>/dev/null | unlzma ;; -+ #*) echo "Unrecognized rpm file: $pkg"; return 1 ;; -+esac -Index: rpmio/Makefile.am -=================================================================== ---- rpmio/Makefile.am.orig -+++ rpmio/Makefile.am -@@ -41,7 +41,7 @@ librpmio_la_LDFLAGS = -release 4.4 $(LDF - @WITH_MAGIC_LIB@ \ - @WITH_ZLIB_LIB@ \ - -lpthread --librpmio_la_LIBADD = $(BEECRYPTLOBJS) -+librpmio_la_LIBADD = $(BEECRYPTLOBJS) -llzma - librpmio_la_DEPENDENCIES = .created - - .created: diff --git a/macrosin.diff b/macrosin.diff index 0818b05..02b3480 100644 --- a/macrosin.diff +++ b/macrosin.diff @@ -4,7 +4,7 @@ Index: macros.in =================================================================== --- macros.in.orig +++ macros.in -@@ -171,22 +171,22 @@ +@@ -175,22 +175,22 @@ # Template for debug information sub-package. %debug_package \ @@ -27,31 +27,40 @@ Index: macros.in -%endif\ %{nil} --%_defaultdocdir %{_usr}/doc -+%_defaultdocdir %{_usr}/doc/packages -+%_docdir_fmt %%{NAME} +-%_defaultdocdir %{_datadir}/doc ++%_defaultdocdir %{_datadir}/doc/packages ++%_docdir_fmt %%{NAME} # The path to the gzip executable (legacy, use %{__gzip} instead). %_gzipbin %{__gzip} -@@ -223,7 +223,7 @@ package or when debugging this package.\ +@@ -233,7 +233,7 @@ package or when debugging this package.\ %_tmppath %{_var}/tmp # Path to top of build area. --%_topdir %{_usrsrc}/redhat +-%_topdir %{getenv:HOME}/rpmbuild +%_topdir %{_usrsrc}/packages # The path to the unzip executable (legacy, use %{__unzip} instead). %_unzipbin %{__unzip} -@@ -328,7 +328,7 @@ package or when debugging this package.\ - # "w9.bzdio" bzip2 level 9. +@@ -330,7 +330,7 @@ package or when debugging this package.\ + # "w7.lzdio" lzma-alone level 7, lzma's default # #%_source_payload w9.gzdio -#%_binary_payload w9.gzdio +%_binary_payload w2.lzdio - # The signature to use and the location of configuration files for - # signing packages with PGP. -@@ -383,7 +383,7 @@ package or when debugging this package.\ + # Algorithm to use for generating file checksum digests on build. + # If not specified or 0, MD5 is used. +@@ -357,7 +357,7 @@ package or when debugging this package.\ + #%vendor + + # Default fuzz level for %patch in spec file. +-%_default_patch_fuzz 0 ++%_default_patch_fuzz 2 + + # Default patch flags + %_default_patch_flags -s +@@ -420,7 +420,7 @@ package or when debugging this package.\ # # Use internal dependency generator rather than external helpers? @@ -60,7 +69,7 @@ Index: macros.in # # Filter GLIBC_PRIVATE Provides: and Requires: -@@ -426,16 +426,22 @@ print (t)\ +@@ -466,16 +466,22 @@ print (t)\ # Undefined, missing or %{nil} will use package content (if available). %_verify_file_context_path %{__file_context_path} @@ -72,12 +81,12 @@ Index: macros.in # Path to scripts to autogenerate package dependencies, # # Note: Used iff _use_internal_dependency_generator is zero. - #%__find_provides @RPMCONFIGDIR@/rpmdeps --provides - #%__find_requires @RPMCONFIGDIR@/rpmdeps --requires --%__find_provides @RPMCONFIGDIR@/find-provides --%__find_requires @RPMCONFIGDIR@/find-requires -+%__find_provides @RPMCONFIGDIR@/find-provides %name -+%__find_requires @RPMCONFIGDIR@/find-requires %name + #%__find_provides %{_rpmconfigdir}/rpmdeps --provides + #%__find_requires %{_rpmconfigdir}/rpmdeps --requires +-%__find_provides %{_rpmconfigdir}/find-provides +-%__find_requires %{_rpmconfigdir}/find-requires ++%__find_provides %{_rpmconfigdir}/find-provides %name ++%__find_requires %{_rpmconfigdir}/find-requires %name #%__find_conflicts ??? #%__find_obsoletes ??? +#%__find_supplements ??? @@ -85,7 +94,7 @@ Index: macros.in # # Path to scripts to autogenerate per-interpreter package dependencies, -@@ -606,15 +612,15 @@ print (t)\ +@@ -638,15 +644,15 @@ print (t)\ %_dbi_config_Packages %{_dbi_htconfig} lockdbfd # "Depends" is a per-transaction cache of known dependency resolutions. @@ -108,7 +117,7 @@ Index: macros.in # XXX legacy configuration. # Choose db interface: -@@ -1038,7 +1044,7 @@ print (t)\ +@@ -1008,7 +1014,7 @@ print (t)\ %_build_vendor %{_host_vendor} %_build_os %{_host_os} %_host @host@ @@ -117,7 +126,7 @@ Index: macros.in %_host_cpu @host_cpu@ %_host_vendor @host_vendor@ %_host_os @host_os@ -@@ -1194,6 +1200,181 @@ done \ +@@ -1168,6 +1174,181 @@ done \ %perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib) %perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib) @@ -299,19 +308,18 @@ Index: macros.in #------------------------------------------------------------------------------ # arch macro for all Intel i?86 compatibile processors # (Note: This macro (and it's analogues) will probably be obsoleted when -@@ -1204,8 +1385,9 @@ done \ +@@ -1178,7 +1359,9 @@ done \ #------------------------------------------------------------------------------ # arch macro for all supported ARM processors --%arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l -- -+%arm armv3l armv4b armv4l armv4tl armv5b armv5l armv5teb armv5tel armv5tejl armv6l -+%arml armv3l armv4l armv5l armv5tel armv6l -+%armb armv4b armv5b armv5teb +-%arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l ++%arm armv3l armv4b armv4l armv4tl armv5b armv5l armv5teb armv5tel armv5tejl armv6l armv7l ++%arml armv3l armv4l armv5l armv5tel armv6l armv7l ++%armb armv4b armv5b armv5teb #------------------------------------------------------------------------------ - # arch macro for all supported Alpha processors -@@ -1224,3 +1406,26 @@ done \ + # arch macro for all supported Sparc processors +@@ -1207,3 +1390,26 @@ done \ # \endverbatim #*/ diff --git a/mimetype.diff b/mimetype.diff index 5b4020d..886cf38 100644 --- a/mimetype.diff +++ b/mimetype.diff @@ -1,5 +1,7 @@ ---- ./autodeps/linux.prov.orig 2008-09-12 16:23:17.000000000 +0000 -+++ ./autodeps/linux.prov 2008-09-12 16:37:03.000000000 +0000 +Index: autodeps/linux.prov +=================================================================== +--- autodeps/linux.prov.orig ++++ autodeps/linux.prov @@ -11,6 +11,7 @@ solist=($(printf "%s\n" "${filelist[@]}" pythonlist= tcllist= diff --git a/missingok.diff b/missingok.diff index a4e1412..5eeac43 100644 --- a/missingok.diff +++ b/missingok.diff @@ -4,8 +4,8 @@ Index: lib/depends.c =================================================================== --- lib/depends.c.orig +++ lib/depends.c -@@ -593,8 +593,13 @@ retry: - /*@=boundsread@*/ +@@ -518,8 +518,13 @@ retry: + } unsatisfied: - rc = 1; /* dependency is unsatisfied */ @@ -20,7 +20,7 @@ Index: lib/depends.c exit: /* -@@ -963,6 +968,8 @@ static inline /*@observer@*/ const char +@@ -827,6 +832,8 @@ static inline const char * identifyDepen return "Requires(postun):"; if (f & RPMSENSE_SCRIPT_VERIFY) return "Requires(verify):"; @@ -29,11 +29,11 @@ Index: lib/depends.c if (f & RPMSENSE_FIND_REQUIRES) return "Requires(auto):"; return "Requires:"; -Index: lib/rpmlib.h +Index: lib/rpmds.h =================================================================== ---- lib/rpmlib.h.orig -+++ lib/rpmlib.h -@@ -548,6 +548,7 @@ typedef enum rpmsenseFlags_e { +--- lib/rpmds.h.orig ++++ lib/rpmds.h +@@ -73,6 +73,7 @@ typedef enum rpmsenseFlags_e { RPMSENSE_SCRIPT_POSTUN | \ RPMSENSE_SCRIPT_VERIFY | \ RPMSENSE_FIND_REQUIRES | \ diff --git a/modalias.diff b/modalias.diff index 88f2b35..b6dcff6 100644 --- a/modalias.diff +++ b/modalias.diff @@ -4,7 +4,7 @@ Index: macros.in =================================================================== --- macros.in.orig +++ macros.in -@@ -433,14 +433,18 @@ print (t)\ +@@ -473,14 +473,18 @@ print (t)\ # # Path to scripts to autogenerate package dependencies, # @@ -13,16 +13,16 @@ Index: macros.in +posix.setenv("RPMBUILD_SOURCEDIR",rpm.expand("%?_sourcedir")); +} # Note: Used iff _use_internal_dependency_generator is zero. - #%__find_provides @RPMCONFIGDIR@/rpmdeps --provides - #%__find_requires @RPMCONFIGDIR@/rpmdeps --requires --%__find_provides @RPMCONFIGDIR@/find-provides %name --%__find_requires @RPMCONFIGDIR@/find-requires %name -+%__find_provides %{__set_helper_env}@RPMCONFIGDIR@/find-provides %name -+%__find_requires %{__set_helper_env}@RPMCONFIGDIR@/find-requires %name + #%__find_provides %{_rpmconfigdir}/rpmdeps --provides + #%__find_requires %{_rpmconfigdir}/rpmdeps --requires +-%__find_provides %{_rpmconfigdir}/find-provides %name +-%__find_requires %{_rpmconfigdir}/find-requires %name ++%__find_provides %{__set_helper_env}%{_rpmconfigdir}/find-provides %name ++%__find_requires %{__set_helper_env}%{_rpmconfigdir}/find-requires %name #%__find_conflicts ??? #%__find_obsoletes ??? -#%__find_supplements ??? -+%__find_supplements %{__set_helper_env}@RPMCONFIGDIR@/find-supplements %name ++%__find_supplements %{__set_helper_env}%{_rpmconfigdir}/find-supplements %name #%__find_enhances ??? # diff --git a/nameversioncompare.diff b/nameversioncompare.diff index c02343d..bcf5ce7 100644 --- a/nameversioncompare.diff +++ b/nameversioncompare.diff @@ -5,7 +5,7 @@ Index: lib/depends.c =================================================================== --- lib/depends.c.orig +++ lib/depends.c -@@ -124,6 +124,24 @@ static int removePackage(rpmts ts, Heade +@@ -102,6 +102,24 @@ static int removePackage(rpmts ts, Heade return 0; } @@ -30,7 +30,7 @@ Index: lib/depends.c int rpmtsAddInstallElement(rpmts ts, Header h, fnpyKey key, int upgrade, rpmRelocation * relocs) { -@@ -315,7 +333,7 @@ addheader: +@@ -291,7 +309,7 @@ addheader: continue; /* Skip packages that contain identical NEVR. */ @@ -38,18 +38,18 @@ Index: lib/depends.c + if (rpmNameVersionCompare(h, oh) == 0) continue; - xx = removePackage(ts, oh, rpmdbGetIteratorOffset(mi), pkgKey); -@@ -366,11 +384,9 @@ addheader: + xx = removePackage(ts, oh, pkgKey); +@@ -342,11 +360,9 @@ addheader: * If no obsoletes version info is available, match all names. */ if (rpmdsEVR(obsoletes) == NULL - || rpmdsAnyMatchesDep(oh, obsoletes, _rpmds_nopromote)) { + || rpmdsNVRMatchesDep(oh, obsoletes, _rpmds_nopromote)) { - const char * ohNEVRA = hGetNEVRA(oh, NULL); + char * ohNEVRA = headerGetNEVRA(oh, NULL); -#ifdef DYING /* XXX see http://bugzilla.redhat.com #134497 */ - if (rpmVersionCompare(h, oh)) -#endif + if (rpmNameVersionCompare(h, oh)) - xx = removePackage(ts, oh, rpmdbGetIteratorOffset(mi), pkgKey); - /*@-nullptrarith@*/ - rpmMessage(RPMMESS_DEBUG, _(" Obsoletes: %s\t\terases %s\n"), + xx = removePackage(ts, oh, pkgKey); + rpmlog(RPMLOG_DEBUG, " Obsoletes: %s\t\terases %s\n", + rpmdsDNEVR(obsoletes)+2, ohNEVRA); diff --git a/nodefattr.diff b/nodefattr.diff index fb535db..d1fd124 100644 --- a/nodefattr.diff +++ b/nodefattr.diff @@ -5,7 +5,7 @@ Index: build/files.c =================================================================== --- build/files.c.orig +++ build/files.c -@@ -2014,7 +2014,9 @@ static int processPackageFiles(Spec spec +@@ -1793,7 +1793,9 @@ static rpmRC processPackageFiles(rpmSpec nullAttrRec(&fl.cur_ar); nullAttrRec(&fl.def_ar); diff --git a/patchrpms.diff b/patchrpms.diff deleted file mode 100644 index 5e17871..0000000 --- a/patchrpms.diff +++ /dev/null @@ -1,745 +0,0 @@ -Add support for patch rpms. Maybe not needed that much any more, -as delta rpms are more efficient and do not need so much evil -rpm patchery. -rh#103205 - -Index: lib/depends.c -=================================================================== ---- lib/depends.c.orig -+++ lib/depends.c -@@ -159,6 +159,7 @@ int rpmtsAddInstallElement(rpmts ts, Hea - const char * os; - rpmds oldChk, newChk; - rpmds obsoletes; -+ rpmds patches; - alKey pkgKey; /* addedPackages key */ - int xx; - int ec = 0; -@@ -399,6 +400,40 @@ addheader: - } - obsoletes = rpmdsFree(obsoletes); - -+ patches = rpmdsLink(rpmteDS(p, RPMTAG_PATCHESNAME), "Patches"); -+ patches = rpmdsInit(patches); -+ if (patches != NULL) -+ while (rpmdsNext(patches) >= 0) { -+ const char * Name; -+ -+ if ((Name = rpmdsN(patches)) == NULL) -+ continue; /* XXX can't happen */ -+ -+ /* Ignore colored patches not in our rainbow. */ -+ dscolor = rpmdsColor(patches); -+ if (tscolor && dscolor && !(tscolor & dscolor)) -+ continue; -+ -+ mi = rpmtsInitIterator(ts, RPMTAG_NAME, Name, 0); -+ -+ xx = rpmdbPruneIterator(mi, -+ ts->removedPackages, ts->numRemovedPackages, 1); -+ -+ while((oh = rpmdbNextIterator(mi)) != NULL) { -+ /* Ignore colored packages not in our rainbow. */ -+ ohcolor = hGetColor(oh); -+ if (tscolor && hcolor && ohcolor && !(hcolor & ohcolor)) -+ /*@innercontinue@*/ continue; -+ if (rpmdsEVR(patches) == NULL -+ || rpmdsNVRMatchesDep(oh, patches, _rpmds_nopromote)) { -+ if (rpmVersionCompare(h, oh)) -+ xx = removePackage(ts, oh, rpmdbGetIteratorOffset(mi), pkgKey); -+ } -+ } -+ mi = rpmdbFreeIterator(mi); -+ } -+ patches = rpmdsFree(patches); -+ - ec = 0; - - exit: -@@ -656,6 +691,57 @@ exit: - return rc; - } - -+static int checkPatchDeps(rpmts ts, rpmte p, int reportprobs) -+{ -+ const char * Name; -+ Header h; -+ rpmds patches; -+ rpmds this; -+ rpmdbMatchIterator mi; -+ -+ patches = rpmdsInit(rpmteDS(p, RPMTAG_PATCHESNAME)); -+ if (!patches) -+ return 0; -+ this = rpmteDS(p, RPMTAG_NAME); -+ -+ mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmdsN(this), 0); -+ while ((h = rpmdbNextIterator(mi)) != NULL) { -+ if (rpmdsNVRMatchesDep(h, this, _rpmds_nopromote)) { -+ rpmdsNotify(this, _("(patch refresh)"), 0); -+ p->hPatched = headerLink(h); -+ p->isPatchRefresh = 1; -+ mi = rpmdbFreeIterator(mi); -+ return 0; -+ } -+ } -+ mi = rpmdbFreeIterator(mi); -+ -+ while (rpmdsNext(patches) >= 0) { -+ if ((Name = rpmdsN(patches)) == NULL) -+ return 1; /* XXX can't happen */ -+ mi = rpmtsInitIterator(ts, RPMTAG_NAME, Name, 0); -+ while ((h = rpmdbNextIterator(mi)) != NULL) { -+ if (rpmdsNVRMatchesDep(h, patches, _rpmds_nopromote)) { -+ rpmdsNotify(patches, _("(db package)"), 0); -+ p->hPatched = headerLink(h); -+ p->isPatchRefresh = 0; -+ mi = rpmdbFreeIterator(mi); -+ return 0; -+ } -+ } -+ mi = rpmdbFreeIterator(mi); -+ } -+ -+ rpmdsNotify(patches, NULL, 1); -+ if (reportprobs) { -+ patches = rpmdsInit(patches); -+ rpmdsNext(patches); -+ rpmdsProblem(ts->probs, rpmteNEVR(p), patches, NULL, 1); -+ } -+ return 0; -+} -+ -+ - /** - * Check added requires/conflicts against against installed+added packages. - * @param ts transaction set -@@ -1730,6 +1816,7 @@ int rpmtsCheck(rpmts ts) - rpmteDS(p, RPMTAG_CONFLICTNAME), - NULL, - tscolor, 1); -+ rc |= checkPatchDeps(ts, p, 1); - if (rc) - goto exit; - -@@ -1827,3 +1914,22 @@ exit: - /*@=branchstate@*/ - return rc; - } -+ -+void rpmtsPatchCheck(rpmts ts) -+{ -+ int closeatexit = 0; -+ rpmtsi pi = NULL; rpmte p; -+ -+ if (rpmtsGetRdb(ts) == NULL && ts->dbmode != -1) { -+ if ((rpmtsOpenDB(ts, ts->dbmode)) != 0) -+ return; -+ closeatexit = 1; -+ } -+ pi = rpmtsiInit(ts); -+ while ((p = rpmtsiNext(pi, TR_ADDED)) != NULL) -+ if (p->key) /* key is filename for install, zero for verify */ -+ (void)checkPatchDeps(ts, p, 0); -+ pi = rpmtsiFree(pi); -+ if (closeatexit) -+ (void)rpmtsCloseDB(ts); -+} -Index: lib/formats.c -=================================================================== ---- lib/formats.c.orig -+++ lib/formats.c -@@ -232,6 +232,8 @@ static /*@only@*/ char * fflagsFormat(in - strcat(buf, "l"); - if (anint & RPMFILE_README) - strcat(buf, "r"); -+ if (anint & RPMFILE_UNPATCHED) -+ strcat(buf, "u"); - /*@=boundswrite@*/ - - val = xmalloc(5 + padding); -Index: lib/fsm.c -=================================================================== ---- lib/fsm.c.orig -+++ lib/fsm.c -@@ -707,7 +707,7 @@ assert(rpmteType(fi->te) == TR_ADDED); - break; - - case FA_BACKUP: -- if (!(fsm->fflags & RPMFILE_GHOST)) /* XXX Don't if %ghost file. */ -+ if (!(fsm->fflags & (RPMFILE_GHOST|RPMFILE_UNPATCHED))) /* XXX Don't if %ghost file. */ - switch (rpmteType(fi->te)) { - case TR_ADDED: - fsm->osuffix = SUFFIX_RPMORIG; -@@ -720,13 +720,13 @@ assert(rpmteType(fi->te) == TR_ADDED); - - case FA_ALTNAME: - assert(rpmteType(fi->te) == TR_ADDED); -- if (!(fsm->fflags & RPMFILE_GHOST)) /* XXX Don't if %ghost file. */ -+ if (!(fsm->fflags & (RPMFILE_GHOST|RPMFILE_UNPATCHED))) /* XXX Don't if %ghost file. */ - fsm->nsuffix = SUFFIX_RPMNEW; - break; - - case FA_SAVE: - assert(rpmteType(fi->te) == TR_ADDED); -- if (!(fsm->fflags & RPMFILE_GHOST)) /* XXX Don't if %ghost file. */ -+ if (!(fsm->fflags & (RPMFILE_GHOST|RPMFILE_UNPATCHED))) /* XXX Don't if %ghost file. */ - fsm->osuffix = SUFFIX_RPMSAVE; - break; - case FA_ERASE: -@@ -1740,7 +1740,7 @@ int fsmStage(FSM_t fsm, fileStage stage) - } - - if (fsm->goal == FSM_PKGBUILD) { -- if (fsm->fflags & RPMFILE_GHOST) /* XXX Don't if %ghost file. */ -+ if (fsm->fflags & (RPMFILE_GHOST|RPMFILE_UNPATCHED)) /* XXX Don't if %ghost file. */ - break; - if (!S_ISDIR(st->st_mode) && st->st_nlink > 1) { - struct hardLink_s * li, * prev; -Index: lib/poptQV.c -=================================================================== ---- lib/poptQV.c.orig -+++ lib/poptQV.c -@@ -171,6 +171,7 @@ static void queryArgCallback(poptContext - case 'l': qva->qva_flags |= QUERY_FOR_LIST; break; - case 's': qva->qva_flags |= QUERY_FOR_STATE | QUERY_FOR_LIST; - break; -+ case 'P': qva->qva_flags |= QUERY_FOR_PATCHES; break; - case POPT_DUMP: qva->qva_flags |= QUERY_FOR_DUMPFILES | QUERY_FOR_LIST; - break; - -@@ -278,6 +279,8 @@ struct poptOption rpmQueryPoptTable[] = - N_("skip %%readme files"), NULL }, - #endif - -+ { "patches", 'P', 0, 0, 'P', -+ N_("list patches or patched files "), NULL }, - { "qf", '\0', POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN, 0, - POPT_QUERYFORMAT, NULL, NULL }, - { "queryformat", '\0', POPT_ARG_STRING, 0, POPT_QUERYFORMAT, -Index: lib/query.c -=================================================================== ---- lib/query.c.orig -+++ lib/query.c -@@ -258,6 +258,10 @@ int showQueryPackage(QVA_t qva, rpmts ts - te = t + tx; - } - -+ /* If querying patches, skip unpatched files. */ -+ if ((qva->qva_flags & QUERY_FOR_PATCHES) && (fflags & RPMFILE_UNPATCHED)) -+ continue; -+ - /*@-boundswrite@*/ - if (!rpmIsVerbose() && prefix) - te = stpcpy(te, prefix); -@@ -377,6 +381,21 @@ void rpmDisplayQueryTags(FILE * fp) - } - } - -+static int isPatch(Header h) -+{ -+ int i, requiresCount = 0; -+ const char ** requires; -+ -+ if (!headerGetEntry(h, RPMTAG_REQUIRENAME, NULL, (void **) &requires, &requiresCount)) -+ return 0; -+ for (i = 0; i < requiresCount; i++) -+ if (!strcmp("rpmlib(PatchRPMs)", requires[i])) -+ break; -+ if (requiresCount) -+ free(requires); -+ return i < requiresCount; -+} -+ - static int rpmgiShowMatches(QVA_t qva, rpmts ts) - /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ - /*@modifies qva, rpmGlobalMacroContext, h_errno, internalState @*/ -@@ -391,6 +410,8 @@ static int rpmgiShowMatches(QVA_t qva, r - h = rpmgiHeader(gi); - if (h == NULL) /* XXX perhaps stricter break instead? */ - continue; -+ if ((qva->qva_flags & QUERY_FOR_PATCHES) != 0 && !isPatch(h)) -+ continue; - if ((rc = qva->qva_showPackage(qva, ts, h)) != 0) - ec = rc; - if (qva->qva_source == RPMQV_DBOFFSET) -@@ -406,6 +427,8 @@ int rpmcliShowMatches(QVA_t qva, rpmts t - - while ((h = rpmdbNextIterator(qva->qva_mi)) != NULL) { - int rc; -+ if ((qva->qva_flags & QUERY_FOR_PATCHES) != 0 && !isPatch(h)) -+ continue; - if ((rc = qva->qva_showPackage(qva, ts, h)) != 0) - ec = rc; - if (qva->qva_source == RPMQV_DBOFFSET) -@@ -703,7 +726,17 @@ int rpmcliArgIter(rpmts ts, QVA_t qva, A - - switch (qva->qva_source) { - case RPMQV_ALL: -- qva->qva_gi = rpmgiNew(ts, RPMDBI_PACKAGES, NULL, 0); -+ if ((!argv || !*argv) && (qva->qva_flags & QUERY_FOR_PATCHES) != 0) { -+ qva->qva_gi = rpmgiNew(ts, RPMTAG_REQUIRENAME, "rpmlib(PatchRPMs)", 0); -+ qva->qva_gi->mi = rpmtsInitIterator(qva->qva_gi->ts, qva->qva_gi->tag, qva->qva_gi->keyp, qva->qva_gi->keylen); -+ if (qva->qva_gi->mi == NULL) { -+ rpmError(RPMERR_QUERYINFO, _("no patch-rpm installed\n")); -+ break; -+ } -+ qva->qva_gi->mi = rpmdbFreeIterator(qva->qva_gi->mi); -+ } else { -+ qva->qva_gi = rpmgiNew(ts, RPMDBI_PACKAGES, NULL, 0); -+ } - qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, ftsOpts, RPMGI_NONE); - - if (qva->qva_gi != NULL && (qva->qva_gi->flags & RPMGI_TSADD)) /* Load the ts with headers. */ -Index: lib/rpmcli.h -=================================================================== ---- lib/rpmcli.h.orig -+++ lib/rpmcli.h -@@ -165,7 +165,7 @@ typedef enum rpmQueryFlags_e { - QUERY_SCRIPT = (1 << 18), /*!< verify: from --noscripts */ - QUERY_DIGEST = (1 << 19), /*!< verify: from --nodigest */ - QUERY_SIGNATURE = (1 << 20), /*!< verify: from --nosignature */ -- QUERY_PATCHES = (1 << 21), /*!< verify: from --nopatches */ -+ QUERY_FOR_PATCHES = (1 << 21), /*!< verify: from --patches */ - QUERY_HDRCHK = (1 << 22), /*!< verify: from --nohdrchk */ - /*@=enummemuse@*/ - QUERY_FOR_LIST = (1 << 23), /*!< query: from --list */ -Index: lib/rpmds.c -=================================================================== ---- lib/rpmds.c.orig -+++ lib/rpmds.c -@@ -87,6 +87,10 @@ fprintf(stderr, "*** ds %p\t%s[%d]\n", d - tagEVR = RPMTAG_TRIGGERVERSION; - tagF = RPMTAG_TRIGGERFLAGS; - } else -+ if (ds->tagN == RPMTAG_PATCHESNAME) { -+ tagEVR = RPMTAG_PATCHESVERSION; -+ tagF = RPMTAG_PATCHESFLAGS; -+ } else - return NULL; - - /*@-branchstate@*/ -@@ -325,6 +329,11 @@ rpmds rpmdsNew(Header h, rpmTag tagN, in - tagEVR = RPMTAG_ENHANCESVERSION; - tagF = RPMTAG_ENHANCESFLAGS; - } else -+ if (tagN == RPMTAG_PATCHESNAME) { -+ Type = "patches"; -+ tagEVR = RPMTAG_PATCHESVERSION; -+ tagF = RPMTAG_PATCHESFLAGS; -+ } else - goto exit; - - /*@-branchstate@*/ -@@ -1127,14 +1136,28 @@ void rpmdsProblem(rpmps ps, const char * - if (DNEVR == NULL) DNEVR = "? ?N? ?OP? ?EVR?"; - /*@=branchstate@*/ - -- rpmMessage(RPMMESS_DEBUG, _("package %s has unsatisfied %s: %s\n"), -- pkgNEVR, ds->Type, DNEVR+2); -- - switch ((unsigned)DNEVR[0]) { - case 'C': type = RPMPROB_CONFLICT; break; - default: - case 'R': type = RPMPROB_REQUIRES; break; - } -+ if (DNEVR[0] == 'p') { -+ const char *d; -+ char *dn; -+ rpmds pds = rpmdsInit(ds); -+ dn = xstrdup("p "); -+ while (rpmdsNext(pds) >= 0) { -+ d = rpmdsDNEVR(ds) + 2; -+ dn = xrealloc(dn, strlen(dn) + strlen(d) + 4); -+ if (dn[2]) -+ strcat(dn, " | "); -+ strcat(dn, d); -+ } -+ DNEVR = (const char *)dn; -+ } -+ -+ rpmMessage(RPMMESS_DEBUG, _("package %s has unsatisfied %s: %s\n"), -+ pkgNEVR, ds->Type, DNEVR+2); - - key = (suggestedKeys ? suggestedKeys[0] : NULL); - rpmpsAppend(ps, type, pkgNEVR, key, NULL, NULL, DNEVR, adding); -Index: lib/rpminstall.c -=================================================================== ---- lib/rpminstall.c.orig -+++ lib/rpminstall.c -@@ -683,6 +683,11 @@ maybe_manifest: - /*@=branchstate@*/ - } - ps = rpmpsFree(ps); -+ } else if (eiu->numRPMS) { -+ /* needed in rpmtsOrder */ -+ rpmalMakeIndex(ts->addedPackages); -+ /* need patch references */ -+ rpmtsPatchCheck(ts); - } - - if (eiu->numRPMS && !(ia->installInterfaceFlags & INSTALL_NOORDER)) { -@@ -789,7 +794,7 @@ int rpmErase(rpmts ts, struct rpmInstall - { int notifyFlags; - notifyFlags = ia->eraseInterfaceFlags | (rpmIsVerbose() ? INSTALL_LABEL : 0 ); - xx = rpmtsSetNotifyCallback(ts, -- rpmShowProgress, (void *) ((long)notifyFlags) -+ rpmShowProgress, (void *) ((long)notifyFlags)) - } - #endif - -Index: lib/rpmlibprov.c -=================================================================== ---- lib/rpmlibprov.c.orig -+++ lib/rpmlibprov.c -@@ -33,6 +33,9 @@ static struct rpmlibProvides_s rpmlibPro - { "rpmlib(PayloadIsBzip2)", "3.0.5-1", - (RPMSENSE_RPMLIB|RPMSENSE_EQUAL), - N_("package payload can be compressed using bzip2.") }, -+ { "rpmlib(PatchRPMs)", "3.0.6-1", -+ (RPMSENSE_RPMLIB|RPMSENSE_EQUAL), -+ N_("understand rpms that replace a subset of files.") }, - { "rpmlib(PayloadFilesHavePrefix)", "4.0-1", - (RPMSENSE_RPMLIB|RPMSENSE_EQUAL), - N_("package payload file(s) have \"./\" prefix.") }, -Index: lib/rpmte.c -=================================================================== ---- lib/rpmte.c.orig -+++ lib/rpmte.c -@@ -64,6 +64,7 @@ static void delTE(rpmte p) - p->NEVRA = _free(p->NEVRA); - - p->h = headerFree(p->h); -+ p->hPatched = headerFree(p->hPatched); - - /*@-boundswrite@*/ - memset(p, 0, sizeof(*p)); /* XXX trash and burn */ -@@ -183,6 +184,9 @@ static void addTE(rpmts ts, rpmte p, Hea - p->requires = rpmdsNew(h, RPMTAG_REQUIRENAME, scareMem); - p->conflicts = rpmdsNew(h, RPMTAG_CONFLICTNAME, scareMem); - p->obsoletes = rpmdsNew(h, RPMTAG_OBSOLETENAME, scareMem); -+ p->patches = rpmdsNew(h, RPMTAG_PATCHESNAME, scareMem | 2); -+ p->hPatched = NULL; -+ p->isPatchRefresh = 0; - - savep = rpmtsSetRelocateElement(ts, p); - p->fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem); -@@ -520,6 +524,9 @@ rpmds rpmteDS(rpmte te, rpmTag tag) - if (tag == RPMTAG_OBSOLETENAME) - return te->obsoletes; - else -+ if (tag == RPMTAG_PATCHESNAME) -+ return te->patches; -+ else - return NULL; - /*@=compdef =refcounttrans =retalias =retexpose =usereleased @*/ - } -Index: lib/rpmte.h -=================================================================== ---- lib/rpmte.h.orig -+++ lib/rpmte.h -@@ -115,6 +115,9 @@ struct rpmte_s { - int autorelocatex; /*!< (TR_ADDED) Auto relocation entry index. */ - /*@refcounted@*/ /*@null@*/ - FD_t fd; /*!< (TR_ADDED) Payload file descriptor. */ -+ rpmds patches; /*!< Patches: dependencies. */ -+ Header hPatched; /*!< (TR_ADDED) Header of package we patch */ -+ int isPatchRefresh; /*!< (TR_ADDED) is a patch refresh */ - - /*@-fielduse@*/ /* LCL: confused by union? */ - union { -Index: lib/transaction.c -=================================================================== ---- lib/transaction.c.orig -+++ lib/transaction.c -@@ -199,6 +199,11 @@ static int handleInstInstalledFiles(cons - int rConflicts; - - rConflicts = reportConflicts; -+ if (rConflicts && p->hPatched && p->isPatchRefresh) { -+ /* If same package (patch refresh) turn off conflicts */ -+ /* Handling of unpatched files not worth the trouble */ -+ rConflicts = 0; -+ } - /* Resolve file conflicts to prefer Elf64 (if not forced). */ - if (tscolor != 0 && FColor != 0 && FColor != oFColor) - { -@@ -975,6 +980,176 @@ rpmfi rpmtsiFi(const rpmtsi tsi) - /*@=compdef =refcounttrans =usereleased @*/ - } - -+static int_32 *dupint32(int_32 *old, int cnt) -+{ -+ int i; -+ int_32 *new = xmalloc(cnt * sizeof(int_32)); -+ for (i = 0; i < cnt; i++) -+ new[i] = old[i]; -+ return new; -+} -+ -+static void patchUnpatchedFiles(Header oldh, Header h, int isRefresh) -+{ -+ int fileCount, oldfileCount, i, j, oldidx, oldidxj; -+ const char ** baseNames, ** dirNames; -+ int_32 * dirIndexes; -+ int_32 * fileMtimes; -+ int_32 * fileSizes; -+ int_32 * fileFlags; -+ char ** fileMd5s; -+ const char ** oldbaseNames, ** olddirNames; -+ int_32 * olddirIndexes; -+ int_32 * oldfileMtimes; -+ int_32 * oldfileSizes; -+ int_32 * oldfileFlags; -+ char ** oldfileMd5s; -+ const char * name, * version, * release; -+ char * evr; -+ int_32 sense; -+ int_32 *epochp; -+ int save = 0; -+ char epoch[20]; -+ const char ** oldpatches, **oldpatchesEVR = NULL; -+ int_32 * oldpatchesFlags; -+ int oldpatchesCount; -+ -+ if (!oldh) { -+ headerRemoveEntry(h, RPMTAG_PATCHESNAME); -+ headerRemoveEntry(h, RPMTAG_PATCHESFLAGS); -+ headerRemoveEntry(h, RPMTAG_PATCHESVERSION); -+#if 1 -+ name = "(none)"; -+ sense = 0; -+ evr = ""; -+ headerAddEntry(h, RPMTAG_PATCHESNAME, RPM_STRING_ARRAY_TYPE, &name, 1); -+ headerAddEntry(h, RPMTAG_PATCHESFLAGS, RPM_INT32_TYPE, &sense, 1); -+ headerAddEntry(h, RPMTAG_PATCHESVERSION, RPM_STRING_ARRAY_TYPE, &evr, 1); -+#endif -+ return; -+ } -+ if (!headerGetEntry(h, RPMTAG_BASENAMES, NULL, -+ (void **) &baseNames, &fileCount)) -+ return; -+ headerGetEntry(h, RPMTAG_DIRNAMES, NULL, -+ (void **) &dirNames, NULL); -+ headerGetEntry(h, RPMTAG_DIRINDEXES, NULL, -+ (void **) &dirIndexes, NULL); -+ headerGetEntry(h, RPMTAG_FILESIZES, NULL, -+ (void **) &fileSizes, NULL); -+ headerGetEntry(h, RPMTAG_FILEMD5S, NULL, -+ (void **) &fileMd5s, NULL); -+ headerGetEntry(h, RPMTAG_FILEMTIMES, NULL, -+ (void **) &fileMtimes, NULL); -+ headerGetEntry(h, RPMTAG_FILEFLAGS, NULL, -+ (void **) &fileFlags, NULL); -+ -+ if (!headerGetEntry(oldh, RPMTAG_BASENAMES, NULL, -+ (void **) &oldbaseNames, &oldfileCount)) -+ return; -+ headerGetEntry(oldh, RPMTAG_DIRNAMES, NULL, -+ (void **) &olddirNames, NULL); -+ headerGetEntry(oldh, RPMTAG_DIRINDEXES, NULL, -+ (void **) &olddirIndexes, NULL); -+ headerGetEntry(oldh, RPMTAG_FILESIZES, NULL, -+ (void **) &oldfileSizes, NULL); -+ headerGetEntry(oldh, RPMTAG_FILEMD5S, NULL, -+ (void **) &oldfileMd5s, NULL); -+ headerGetEntry(oldh, RPMTAG_FILEMTIMES, NULL, -+ (void **) &oldfileMtimes, NULL); -+ headerGetEntry(oldh, RPMTAG_FILEFLAGS, NULL, -+ (void **) &oldfileFlags, NULL); -+ -+ oldidx = -1; -+ oldidxj = 0; -+ for (i = 0; i < fileCount; i++) { -+ if (!(fileFlags[i] & RPMFILE_UNPATCHED)) -+ continue; -+ if (dirIndexes[i] != oldidx) { -+ for (j = 0; j < oldfileCount; j++) -+ if (strcmp(dirNames[dirIndexes[i]], olddirNames[olddirIndexes[j]]) == 0) -+ break; -+ if (j == oldfileCount) { -+ while (i + 1 < fileCount && dirIndexes[i] == dirIndexes[i + 1]) -+ i++; -+ continue; -+ } -+ oldidx = olddirIndexes[j]; -+ oldidxj = j; -+ } -+ for (j = oldidxj; j < oldfileCount; j++) -+ if (olddirIndexes[j] == oldidx && !strcmp(baseNames[i], oldbaseNames[j])) { -+ if (!save) { -+ /* duplicate fileSizes, fileMtimes, fileFlags -+ * so we can modify them */ -+ fileSizes = dupint32(fileSizes, fileCount); -+ fileMtimes = dupint32(fileMtimes, fileCount); -+ fileFlags = dupint32(fileFlags, fileCount); -+ } -+ fileSizes[i] = oldfileSizes[j]; -+ fileMtimes[i] = oldfileMtimes[j]; -+ fileMd5s[i] = oldfileMd5s[j]; -+ fileFlags[i] = oldfileFlags[j] | RPMFILE_UNPATCHED; -+ save = 1; -+ break; -+ } -+ } -+ if (save) { -+ headerModifyEntry(h, RPMTAG_FILESIZES, RPM_INT32_TYPE, -+ (void *) fileSizes, fileCount); -+ headerModifyEntry(h, RPMTAG_FILEMD5S, RPM_STRING_ARRAY_TYPE, -+ (void *) fileMd5s, fileCount); -+ headerModifyEntry(h, RPMTAG_FILEMTIMES, RPM_INT32_TYPE, -+ (void *) fileMtimes, fileCount); -+ headerModifyEntry(h, RPMTAG_FILEFLAGS, RPM_INT32_TYPE, -+ (void *) fileFlags, fileCount); -+ free(fileSizes); -+ free(fileMtimes); -+ free(fileFlags); -+ } -+ free(baseNames); -+ free(dirNames); -+ free(fileMd5s); -+ free(oldbaseNames); -+ free(olddirNames); -+ free(oldfileMd5s); -+ -+ if (isRefresh) { -+ /* same patch installed, this is just a refresh operation */ -+ headerRemoveEntry(h, RPMTAG_PATCHESNAME); -+ headerRemoveEntry(h, RPMTAG_PATCHESFLAGS); -+ headerRemoveEntry(h, RPMTAG_PATCHESVERSION); -+ if (headerGetEntry(oldh, RPMTAG_PATCHESNAME, NULL, (void **) &oldpatches, &oldpatchesCount) && oldpatchesCount) { -+ headerGetEntry(oldh, RPMTAG_PATCHESFLAGS, NULL, (void **) &oldpatchesFlags, &oldpatchesCount); -+ headerGetEntry(oldh, RPMTAG_PATCHESVERSION, NULL, (void **) &oldpatchesEVR, &oldpatchesCount); -+ headerAddEntry(h, RPMTAG_PATCHESNAME, RPM_STRING_ARRAY_TYPE, oldpatches, oldpatchesCount); -+ headerAddEntry(h, RPMTAG_PATCHESFLAGS, RPM_INT32_TYPE, oldpatchesFlags, oldpatchesCount); -+ headerAddEntry(h, RPMTAG_PATCHESVERSION, RPM_STRING_ARRAY_TYPE, oldpatchesEVR, oldpatchesCount); -+ free(oldpatches); -+ free(oldpatchesEVR); -+ } -+ return; -+ } -+ headerNVR(oldh, &name, &version, &release); -+ *epoch = 0; -+ if (headerGetEntry(h, RPMTAG_EPOCH, NULL, (void **) &epochp, NULL)) -+ sprintf(epoch, "%d:", *epochp); -+ evr = xmalloc(strlen(epoch) + strlen(version) + strlen(release) + 2); -+ strcpy(evr, epoch); -+ strcat(evr, version); -+ strcat(evr, "-"); -+ strcat(evr, release); -+ sense = RPMSENSE_EQUAL; -+ headerRemoveEntry(h, RPMTAG_PATCHESNAME); -+ headerRemoveEntry(h, RPMTAG_PATCHESFLAGS); -+ headerRemoveEntry(h, RPMTAG_PATCHESVERSION); -+ headerAddEntry(h, RPMTAG_PATCHESNAME, RPM_STRING_ARRAY_TYPE, &name, 1); -+ headerAddEntry(h, RPMTAG_PATCHESFLAGS, RPM_INT32_TYPE, &sense, 1); -+ headerAddEntry(h, RPMTAG_PATCHESVERSION, RPM_STRING_ARRAY_TYPE, &evr, 1); -+ free(evr); -+} -+ -+ - /** - * This is not a generalized function to be called from outside - * librpm. It is called internally by rpmtsRun() to rollback -@@ -2154,6 +2329,8 @@ assert(psm != NULL); - } - psm->fi = rpmfiLink(p->fi, NULL); - -+ if (p->hPatched || rpmteDS(p, RPMTAG_PATCHESNAME)) -+ patchUnpatchedFiles(p->hPatched, p->fi->h, p->isPatchRefresh); - /*@-nullstate@*/ /* FIX: psm->fi may be NULL */ - if (rpmpsmStage(psm, PSM_PKGINSTALL)) { - ourrc++; -Index: doc/rpm.8 -=================================================================== ---- doc/rpm.8.orig -+++ doc/rpm.8 -@@ -68,7 +68,8 @@ rpm \- RPM Package Manager - - - [\fB\fIPACKAGE_NAME\fB\fR] [\fB-a,--all\fR] [\fB-f,--file \fIFILE\fB\fR] -- [\fB-g,--group \fIGROUP\fB\fR] {\fB-p,--package \fIPACKAGE_FILE\fB\fR] -+ [\fB-g,--group \fIGROUP\fB\fR] [\fB-p,--package \fIPACKAGE_FILE\fB\fR] -+ [\fB-P,--patches\fR] - [\fB--fileid \fIMD5\fB\fR] [\fB--hdrid \fISHA1\fB\fR] [\fB--pkgid \fIMD5\fB\fR] [\fB--tid \fITID\fB\fR] - [\fB--querybynumber \fIHDRNUM\fB\fR] [\fB--triggeredby \fIPACKAGE_NAME\fB\fR] - [\fB--whatprovides \fICAPABILITY\fB\fR] [\fB--whatrequires \fICAPABILITY\fB\fR] -@@ -77,7 +78,8 @@ rpm \- RPM Package Manager - .PP - - -- [\fB--changelog\fR] [\fB-c,--configfiles\fR] [\fB-d,--docfiles\fR] [\fB--dump\fR] -+ [\fB--basedon\fR] [\fB--changelog\fR] [\fB-c,--configfiles\fR] -+ [\fB-d,--docfiles\fR] [\fB--dump\fR] - [\fB--filesbypkg\fR] [\fB-i,--info\fR] [\fB--last\fR] [\fB-l,--list\fR] - [\fB--provides\fR] [\fB--qf,--queryformat \fIQUERYFMT\fB\fR] - [\fB-R,--requires\fR] [\fB--scripts\fR] [\fB-s,--state\fR] -@@ -547,6 +549,10 @@ that will be expanded to paths that are - the package manifest as additional \fIPACKAGE_FILE\fR - arguments to the query. - .TP -+\fB-P, --patches\fP -+Limit the selected packages to patch-rpms. As a side effect, limit -+the file list to patched files. -+.TP - \fB--pkgid \fIMD5\fB\fR - Query package that contains a given package identifier, i.e. the - \fIMD5\fR digest of the combined header and -@@ -581,6 +587,10 @@ Query all packages that requires \fICAPA - .SS "PACKAGE QUERY OPTIONS:" - .PP - .TP -+\fB--basedon\fR -+Show what packages a patch-rpm is based on. A patch-rpm can only be -+installed if one of the packages it is based on is installed. -+.TP - \fB--changelog\fR - Display change information for the package. - .TP -@@ -613,7 +623,8 @@ Orders the package listing by install ti - packages are at the top. - .TP - \fB-l, --list\fR --List files in package. -+List files in package. If the \fB\-P\fP option is also given, only -+patched files are shown. - .TP - \fB--provides\fR - List capabilities this package provides. -Index: rpmpopt.in -=================================================================== ---- rpmpopt.in.orig -+++ rpmpopt.in -@@ -84,6 +84,10 @@ rpm alias --supplements --qf \ - "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \ - --POPTdesc=$"list capabilities this package supplements" - -+rpm alias --basedon --qf \ -+ "[%{PATCHESNAME} %{PATCHESFLAGS:depflags} %{PATCHESVERSION}\n]" \ -+ --POPTdesc=$"list packages this patch-rpm is based on" -+ - rpm alias --info --qf 'Name : %-27{NAME} Relocations: %|PREFIXES?{[%{PREFIXES} ]}:{(not relocatable)}|\n\ - Version : %-27{VERSION} Vendor: %{VENDOR}\n\ - Release : %-27{RELEASE} Build Date: %{BUILDTIME:date}\n\ -@@ -378,6 +382,10 @@ rpmq alias --supplements --qf \ - "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \ - --POPTdesc=$"list capabilities this package supplements" - -+rpmq alias --basedon --qf \ -+ "[%{PATCHESNAME} %{PATCHESFLAGS:depflags} %{PATCHESVERSION}\n]" \ -+ --POPTdesc=$"list packages this patch-rpm is based on" -+ - rpmq alias --info --qf 'Name : %-27{NAME} Relocations: %|PREFIXES?{[%{PREFIXES} ]}:{(not relocatable)}|\n\ - Version : %-27{VERSION} Vendor: %{VENDOR}\n\ - Release : %-27{RELEASE} Build Date: %{BUILDTIME:date}\n\ -@@ -496,6 +504,10 @@ rpmquery alias --supplements --qf \ - "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \ - --POPTdesc=$"list capabilities this package supplements" - -+rpmquery alias --basedon --qf \ -+ "[%{PATCHESNAME} %{PATCHESFLAGS:depflags} %{PATCHESVERSION}\n]" \ -+ --POPTdesc=$"list packages this patch-rpm is based on" -+ - rpmquery alias --info --qf 'Name : %-27{NAME} Relocations: %|PREFIXES?{[%{PREFIXES} ]}:{(not relocatable)}|\n\ - Version : %-27{VERSION} Vendor: %{VENDOR}\n\ - Release : %-27{RELEASE} Build Date: %{BUILDTIME:date}\n\ diff --git a/platformin.diff b/platformin.diff index f9020ff..94bc710 100644 --- a/platformin.diff +++ b/platformin.diff @@ -1,30 +1,28 @@ SUSE specific platform changes. ---- ./platform.in.orig 2005-01-26 03:39:54.000000000 +0000 -+++ ./platform.in 2006-02-17 14:18:30.000000000 +0000 -@@ -17,18 +17,18 @@ +Index: platform.in +=================================================================== +--- platform.in.orig ++++ platform.in +@@ -21,7 +21,7 @@ %_exec_prefix @exec_prefix@ %_bindir @bindir@ %_sbindir @sbindir@ -%_libexecdir @libexecdir@ +%_libexecdir %{_exec_prefix}/lib + %_datarootdir @datarootdir@ %_datadir @datadir@ %_sysconfdir @sysconfdir@ - %_sharedstatedir @sharedstatedir@ - %_localstatedir @localstatedir@ - %_lib @LIB@ --%_libdir @LIBDIR@ -+%_libdir %{_exec_prefix}/%{_lib} - %_includedir @includedir@ +@@ -33,7 +33,7 @@ %_oldincludedir @oldincludedir@ %_infodir @infodir@ %_mandir @mandir@ --%_initrddir %{_sysconfdir}/rc.d/init.d -+%_initrddir %{_sysconfdir}/init.d +-%_initddir %{_sysconfdir}/rc.d/init.d ++%_initddir %{_sysconfdir}/init.d + # Deprecated misspelling, present for backwards compatibility. + %_initrddir %{_initddir} - %_defaultdocdir @DEFAULTDOCDIR@ - -@@ -148,3 +148,21 @@ +@@ -146,3 +146,21 @@ @mandrake@%_gamesdir games @mandrake@%_gamesbindir %{_prefix}/%{_gamesdir} @mandrake@%_gamesdatadir %{_datadir}/%{_gamesdir} @@ -35,7 +33,7 @@ SUSE specific platform changes. +@SuSE@%__chown_Rhf @__CHOWN_RHF@ +@SuSE@%__chgrp_Rhf @__CHGRP_RHF@ +@SuSE@%_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root -+@SuSE@%_fixgroup [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} @ROOT_GROUP@ ++@SuSE@%_fixgroup [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} root +@SuSE@%_fixperms %{__chmod} -Rf @FIXPERMS@ +@SuSE@ +@SuSE@#--------------------------------------------------------------------- diff --git a/popt-to-lib.diff b/popt-to-lib.diff deleted file mode 100644 index 65e6075..0000000 --- a/popt-to-lib.diff +++ /dev/null @@ -1,32 +0,0 @@ -Index: popt/Makefile.am -=================================================================== ---- popt/Makefile.am.orig -+++ popt/Makefile.am -@@ -17,13 +17,13 @@ noinst_HEADERS = findme.h poptint.h syst - noinst_PROGRAMS = test1 test2 test3 - test1_SOURCES = test1.c - test1_LDFLAGS = --test1_LDADD = $(usrlib_LTLIBRARIES) -+test1_LDADD = $(popt_LTLIBRARIES) - test2_SOURCES = test2.c - test2_LDFLAGS = --test2_LDADD = $(usrlib_LTLIBRARIES) -+test2_LDADD = $(popt_LTLIBRARIES) - test3_SOURCES = test3.c - test3_LDFLAGS = --test3_LDADD = $(usrlib_LTLIBRARIES) -+test3_LDADD = $(popt_LTLIBRARIES) - - noinst_SCRIPTS = testit.sh - -@@ -34,8 +34,8 @@ TESTS = testit.sh - - include_HEADERS = popt.h - --usrlibdir = $(libdir)@MARK64@ --usrlib_LTLIBRARIES = libpopt.la -+poptdir = /lib@MARK64@ -+popt_LTLIBRARIES = libpopt.la - - libpopt_la_SOURCES = popt.c findme.c poptparse.c poptconfig.c popthelp.c - libpopt_la_LDFLAGS = @INTLLIBS@ diff --git a/refreshtestarch.diff b/refreshtestarch.diff index ef0ef31..f429b2b 100644 --- a/refreshtestarch.diff +++ b/refreshtestarch.diff @@ -5,22 +5,23 @@ Index: lib/psm.c =================================================================== --- lib/psm.c.orig +++ lib/psm.c -@@ -1447,15 +1447,16 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage s +@@ -1202,6 +1202,7 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage s + + psm->scriptArg = psm->npkgs_installed + 1; - assert(psm->mi == NULL); - psm->mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmteN(psm->te), 0); + /* this must match rpmNameVersionCompare in depends.c */ - xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_EPOCH, RPMMIRE_STRCMP, + mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmteN(psm->te), 0); + xx = rpmdbSetIteratorRE(mi, RPMTAG_EPOCH, RPMMIRE_STRCMP, rpmteE(psm->te)); - xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_VERSION, RPMMIRE_STRCMP, +@@ -1209,9 +1210,9 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage s rpmteV(psm->te)); - xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_RELEASE, RPMMIRE_STRCMP, + xx = rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_STRCMP, rpmteR(psm->te)); -- if (tscolor) { -- xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_ARCH, RPMMIRE_STRCMP, -+ xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_ARCH, RPMMIRE_STRCMP, - rpmteA(psm->te)); -+ if (tscolor) { - xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_OS, RPMMIRE_STRCMP, ++ xx = rpmdbSetIteratorRE(mi, RPMTAG_ARCH, RPMMIRE_STRCMP, ++ rpmteA(psm->te)); + if (tscolor) { +- xx = rpmdbSetIteratorRE(mi, RPMTAG_ARCH, RPMMIRE_STRCMP, +- rpmteA(psm->te)); + xx = rpmdbSetIteratorRE(mi, RPMTAG_OS, RPMMIRE_STRCMP, rpmteO(psm->te)); } diff --git a/remove-brp-strips.diff b/remove-brp-strips.diff index 751f609..c0ef51a 100644 --- a/remove-brp-strips.diff +++ b/remove-brp-strips.diff @@ -3,14 +3,16 @@ Subject: remove references to removed brp scripts Some brp-scripts are not used in openSUSE, remove references to it ---- platform.in +Index: platform.in +=================================================================== +--- platform.in.orig +++ platform.in @@ -55,8 +55,6 @@ %__os_install_post \ - @RPMCONFIGDIR@/brp-compress \ - @RPMCONFIGDIR@/brp-strip \ -- @RPMCONFIGDIR@/brp-strip-static-archive \ -- @RPMCONFIGDIR@/brp-strip-comment-note \ + %{_rpmconfigdir}/brp-compress \ + %{_rpmconfigdir}/brp-strip \ +- %{_rpmconfigdir}/brp-strip-static-archive \ +- %{_rpmconfigdir}/brp-strip-comment-note \ %{nil} %__spec_install_post\ diff --git a/requires-ge-macro.diff b/requires-ge-macro.diff index 77464b4..0873add 100644 --- a/requires-ge-macro.diff +++ b/requires-ge-macro.diff @@ -2,7 +2,7 @@ Index: macros.in =================================================================== --- macros.in.orig +++ macros.in -@@ -1205,7 +1205,8 @@ done \ +@@ -1182,7 +1182,8 @@ done \ # %{perl_sitearch}/Image # %dir %{perl_sitearch}/auto/Image # diff --git a/rpm-4.4.2.3-db.tar.bz2 b/rpm-4.4.2.3-db.tar.bz2 new file mode 100644 index 0000000..1a2af71 --- /dev/null +++ b/rpm-4.4.2.3-db.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1226a5eeee069402b8dddfde652e2b0a44b64a193078b3c7276d97b1b5f756cb +size 5271325 diff --git a/rpm-4.4.2.3.tar.bz2 b/rpm-4.4.2.3.tar.bz2 deleted file mode 100644 index ff2cf1e..0000000 --- a/rpm-4.4.2.3.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1573a7d34c6a95abe3ad3d2ce310c7d5f8873e45955875f2e03647c756012fcd -size 8525878 diff --git a/rpm-4.7.1.tar.bz2 b/rpm-4.7.1.tar.bz2 new file mode 100644 index 0000000..13a628c --- /dev/null +++ b/rpm-4.7.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0af1f507b342eda33f9ef113b645048034fb7fef3b4ff3c084532af12b6f70d +size 3410587 diff --git a/rpm-beecrypt.diff b/rpm-beecrypt.diff new file mode 100644 index 0000000..0fff5e4 --- /dev/null +++ b/rpm-beecrypt.diff @@ -0,0 +1,1835 @@ +--- ./Makefile.am.orig 2009-06-23 11:40:57.000000000 +0000 ++++ ./Makefile.am 2009-08-20 13:47:03.000000000 +0000 +@@ -88,7 +88,8 @@ DISTCLEANFILES += find-requires + + rpm_SOURCES = rpmqv.c debug.h system.h + rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV +-rpm_LDADD = build/librpmbuild.la lib/librpm.la rpmio/librpmio.la ++rpm_LDADD = lib/librpm.la rpmio/librpmio.la ++rpm_LDADD += build/.libs/spec.o build/.libs/misc.o build/.libs/names.o build/.libs/expression.o build/.libs/reqprov.o build/.libs/poptBT.o build/.libs/parse*.o + rpm_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@ + + rpmbuild_SOURCES = build.c rpmqv.c build.h debug.h system.h +--- ./config.h.in.orig 2009-07-21 08:21:37.000000000 +0000 ++++ ./config.h.in 2009-08-20 13:47:03.000000000 +0000 +@@ -13,6 +13,9 @@ + /* Define to 1 if you have the `basename' function. */ + #undef HAVE_BASENAME + ++/* Define to 1 if you have the header file. */ ++#undef HAVE_BEECRYPT_API_H ++ + /* Define as 1 if you bzip2 1.0 */ + #undef HAVE_BZ2_1_0 + +@@ -110,7 +113,7 @@ + /* Define as 1 if defines h_errno */ + #undef HAVE_HERRNO + +-/* Define if you have the iconv() function. */ ++/* Define if you have the iconv() function and it works. */ + #undef HAVE_ICONV + + /* Define to 1 if you have the `inet_aton' function. */ +@@ -359,6 +362,10 @@ + */ + #undef LT_OBJDIR + ++/* Define to the sub-directory in which libtool stores uninstalled libraries. ++ */ ++#undef LT_OBJDIR ++ + /* Define to 1 if `major', `minor', and `makedev' are declared in . + */ + #undef MAJOR_IN_MKDEV +@@ -456,6 +463,9 @@ + /* Build with acl support? */ + #undef WITH_ACL + ++/* Build with beecrypt instead of nss3 support? */ ++#undef WITH_BEECRYPT ++ + /* Build with capability support? */ + #undef WITH_CAP + +--- ./configure.ac.orig 2009-07-21 08:20:46.000000000 +0000 ++++ ./configure.ac 2009-08-20 13:47:03.000000000 +0000 +@@ -300,12 +300,43 @@ AC_CHECK_HEADERS([dwarf.h], [ + AM_CONDITIONAL(LIBDWARF,[test "$WITH_LIBDWARF" = yes]) + + #================= ++# Check for beecrypt library if requested. ++AC_ARG_WITH(beecrypt, [ --with-beecrypt build with beecrypt support ],,[with_beecrypt=yes]) ++AC_ARG_WITH(internal_beecrypt, [ --with-internal-beecrypt build with internal beecrypt library ],,[with_internal_beecrypt=yes]) ++AM_CONDITIONAL([WITH_INTERNAL_BEECRYPT],[test "$with_internal_beecrypt" = yes]) ++if test "$with_internal_beecrypt" = yes ; then ++ with_beecrypt=yes ++fi ++AM_CONDITIONAL([WITH_BEECRYPT],[test "$with_beecrypt" = yes]) ++ ++WITH_BEECRYPT_INCLUDE= ++WITH_BEECRYPT_LIB= ++if test "$with_beecrypt" = yes ; then ++ AC_DEFINE(WITH_BEECRYPT, 1, [Build with beecrypt instead of nss3 support?]) ++ if test "$with_internal_beecrypt" = yes ; then ++ WITH_BEECRYPT_INCLUDE="-I\$(top_srcdir)/beecrypt" ++ AC_DEFINE(HAVE_BEECRYPT_API_H, 1, [Define to 1 if you have the header file.]) ++ else ++ AC_CHECK_LIB(beecrypt, mpfprintln, [ ++ WITH_BEECRYPT_LIB="-lbeecrypt" ++ ],[ ++ AC_MSG_ERROR([missing required library 'beecrypt']) ++ ]) ++ AC_CHECK_HEADER([beecrypt/api.h], [AC_DEFINE(HAVE_BEECRYPT_API_H, 1, [Define to 1 if you have the header file.]) ++ ]) ++ fi ++fi ++AC_SUBST(WITH_BEECRYPT_LIB) ++AC_SUBST(WITH_BEECRYPT_INCLUDE) ++ ++#================= + # Check for NSS library. + # We need nss.h from NSS which needs nspr.h. Unfortunately both glibc and NSS + # have a header named nss.h... so make extra check for NSS's sechash.h + # which we use too and hopefully is slightly more unique to NSS. + WITH_NSS_INCLUDE= + WITH_NSS_LIB= ++if test "$with_beecrypt" != yes ; then + AC_CHECK_HEADERS([nspr.h nss.h sechash.h], [], [ + AC_MSG_ERROR([missing required NSPR / NSS header]) + ]) +@@ -314,6 +345,7 @@ AC_CHECK_LIB(nss3, NSS_NoDB_Init, [ + ], [ + AC_MSG_ERROR([missing required NSS library 'nss3']) + ]) ++fi + AC_SUBST(WITH_NSS_INCLUDE) + AC_SUBST(WITH_NSS_LIB) + +--- ./lib/signature.c.orig 2009-06-23 11:40:58.000000000 +0000 ++++ ./lib/signature.c 2009-08-20 13:47:03.000000000 +0000 +@@ -1118,10 +1118,8 @@ verifyRSASignature(rpmKeyring keyring, r + DIGEST_CTX md5ctx) + { + pgpDigParams sigp = dig ? &dig->signature : NULL; +- SECOidTag sigalg; + rpmRC res = RPMRC_OK; + int xx; +- SECItem digest; + const char *hdr, *signame = _("Unknown");; + const char *sig = sigtd->data; + int sigver; +@@ -1153,27 +1151,21 @@ verifyRSASignature(rpmKeyring keyring, r + switch (sigp->hash_algo) { + case PGPHASHALGO_MD5: + signame = "RSA/MD5"; +- sigalg = SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION; + break; + case PGPHASHALGO_SHA1: + signame = "RSA/SHA1"; +- sigalg = SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION; + break; + case PGPHASHALGO_MD2: + signame = "RSA/MD2"; +- sigalg = SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION; + break; + case PGPHASHALGO_SHA256: + signame = "RSA/SHA256"; +- sigalg = SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION; + break; + case PGPHASHALGO_SHA384: + signame = "RSA/SHA384"; +- sigalg = SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION; + break; + case PGPHASHALGO_SHA512: + signame = "RSA/SHA512"; +- sigalg = SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION; + break; + /* fallthrough for unsupported / unknown types */ + case PGPHASHALGO_TIGER192: +@@ -1181,7 +1173,6 @@ verifyRSASignature(rpmKeyring keyring, r + case PGPHASHALGO_RIPEMD160: + default: + res = RPMRC_NOKEY; +- sigalg = SEC_OID_UNKNOWN; + break; + } + +@@ -1212,9 +1203,6 @@ verifyRSASignature(rpmKeyring keyring, r + res = RPMRC_FAIL; + goto exit; + } +- digest.type = siBuffer; +- digest.data = dig->md5; +- digest.len = dig->md5len; + } + + /* Retrieve the matching public key. */ +@@ -1222,29 +1210,8 @@ verifyRSASignature(rpmKeyring keyring, r + if (res != RPMRC_OK) + goto exit; + +- { SECItem *sig = dig->rsasig; +- size_t siglen = SECKEY_SignatureLen(dig->rsa); +- +- /* Zero-pad signature data up to expected size if necessary */ +- if (siglen > sig->len) { +- size_t pad = siglen - sig->len; +- if ((sig = SECITEM_AllocItem(NULL, NULL, siglen)) == NULL) { +- res = RPMRC_FAIL; +- goto exit; +- } +- memset(sig->data, 0, pad); +- memcpy(sig->data+pad, dig->rsasig->data, dig->rsasig->len); +- } +- +- if (VFY_VerifyDigest(&digest, dig->rsa, sig, sigalg, NULL) == SECSuccess) +- res = RPMRC_OK; +- else +- res = RPMRC_FAIL; +- +- if (sig != dig->rsasig) { +- SECITEM_ZfreeItem(sig, 1); +- } +- } ++ if (pgpVerifyRSA(dig)) ++ res = RPMRC_FAIL; + + exit: + if (sigp != NULL) { +@@ -1273,7 +1240,6 @@ verifyDSASignature(rpmKeyring keyring, r + pgpDigParams sigp = dig ? &dig->signature : NULL; + rpmRC res; + int xx; +- SECItem digest; + const char *hdr; + int sigver; + const char *sig = sigtd->data; +@@ -1320,9 +1286,6 @@ verifyDSASignature(rpmKeyring keyring, r + res = RPMRC_FAIL; + goto exit; + } +- digest.type = siBuffer; +- digest.data = dig->sha1; +- digest.len = dig->sha1len; + } + + /* Retrieve the matching public key. */ +@@ -1330,10 +1293,7 @@ verifyDSASignature(rpmKeyring keyring, r + if (res != RPMRC_OK) + goto exit; + +- if (VFY_VerifyDigest(&digest, dig->dsa, dig->dsasig, +- SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST, NULL) == SECSuccess) +- res = RPMRC_OK; +- else ++ if (pgpVerifyDSA(dig)) + res = RPMRC_FAIL; + + exit: +--- ./rpmio/Makefile.am.orig 2009-06-23 11:40:59.000000000 +0000 ++++ ./rpmio/Makefile.am 2009-08-20 13:47:03.000000000 +0000 +@@ -2,6 +2,7 @@ + + AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/ + AM_CPPFLAGS += @WITH_NSS_INCLUDE@ ++AM_CPPFLAGS += @WITH_BEECRYPT_INCLUDE@ + AM_CPPFLAGS += @WITH_LUA_INCLUDE@ + AM_CPPFLAGS += @WITH_POPT_INCLUDE@ + AM_CPPFLAGS += -I$(top_srcdir)/misc +@@ -19,10 +20,17 @@ librpmio_la_SOURCES = \ + rpmstring.c rpmfileutil.c \ + rpmkeyring.c + ++if WITH_BEECRYPT ++librpmio_la_SOURCES += digest_beecrypt.c ++else ++librpmio_la_SOURCES += digest_nss.c ++endif ++ + librpmio_la_LDFLAGS = -version-info 0:0:0 + librpmio_la_LIBADD = \ + ../misc/libmisc.la \ + @WITH_NSS_LIB@ \ ++ @WITH_BEECRYPT_LIB@ \ + @WITH_LUA_LIB@ \ + @WITH_BZ2_LIB@ \ + @WITH_ZLIB_LIB@ \ +@@ -31,6 +39,17 @@ librpmio_la_LIBADD = \ + @WITH_LZMA_LIB@ \ + -lpthread + ++if WITH_INTERNAL_BEECRYPT ++librpmio_la_LIBADD += $(libbeecrypt_la) ++ ++libbeecrypt_la = $(top_builddir)/beecrypt/libbeecrypt_nolibdir.la ++ ++$(top_builddir)/beecrypt/libbeecrypt_nolibdir.la: $(top_builddir)/beecrypt/libbeecrypt.la ++ sed -e 's/libdir=.*/libdir=/' < $(top_builddir)/beecrypt/libbeecrypt.la > $(top_builddir)/beecrypt/libbeecrypt_nolibdir.la ++endif ++ ++ ++ + if WITH_LUAEXT + AM_CPPFLAGS += -I$(top_builddir)/luaext/ + librpmio_la_LIBADD += $(top_builddir)/luaext/libluaext.la +--- ./rpmio/base64.c.orig 2009-06-23 11:40:59.000000000 +0000 ++++ ./rpmio/base64.c 2009-08-20 13:47:03.000000000 +0000 +@@ -4,8 +4,11 @@ + #include + #include + ++#include "system.h" ++ + #include "rpmio/base64.h" + ++#ifndef WITH_BEECRYPT + + static char base64_encode_value(char value_in) + { +@@ -253,3 +256,4 @@ int main(int argc, char *argv[]) + } + #endif + ++#endif /* WITH_BEECRYPT */ +--- ./rpmio/digest.c.orig 2009-06-23 11:40:59.000000000 +0000 ++++ ./rpmio/digest.c 2009-08-20 13:47:03.000000000 +0000 +@@ -4,165 +4,12 @@ + + #include "system.h" + ++#include + #include "rpmio/digest.h" ++#include "rpmio/rpmio_internal.h" + + #include "debug.h" + +-#ifdef SHA_DEBUG +-#define DPRINTF(_a) fprintf _a +-#else +-#define DPRINTF(_a) +-#endif +- +- +-/** +- * MD5/SHA1 digest private data. +- */ +-struct DIGEST_CTX_s { +- rpmDigestFlags flags; /*!< Bit(s) to control digest operation. */ +- HASHContext *hashctx; /*!< Internal NSS hash context. */ +-}; +- +-DIGEST_CTX +-rpmDigestDup(DIGEST_CTX octx) +-{ +- DIGEST_CTX nctx; +- nctx = memcpy(xcalloc(1, sizeof(*nctx)), octx, sizeof(*nctx)); +- nctx->hashctx = HASH_Clone(octx->hashctx); +- if (nctx->hashctx == NULL) { +- fprintf(stderr, "HASH_Clone failed\n"); +- exit(EXIT_FAILURE); /* FIX: callers do not bother checking error return */ +- } +- return nctx; +-} +- +-RPM_GNUC_PURE +-static HASH_HashType getHashType(pgpHashAlgo hashalgo) +-{ +- switch (hashalgo) { +- case PGPHASHALGO_MD5: +- return HASH_AlgMD5; +- break; +- case PGPHASHALGO_MD2: +- return HASH_AlgMD2; +- break; +- case PGPHASHALGO_SHA1: +- return HASH_AlgSHA1; +- break; +- case PGPHASHALGO_SHA256: +- return HASH_AlgSHA256; +- break; +- case PGPHASHALGO_SHA384: +- return HASH_AlgSHA384; +- break; +- case PGPHASHALGO_SHA512: +- return HASH_AlgSHA512; +- break; +- case PGPHASHALGO_RIPEMD160: +- case PGPHASHALGO_TIGER192: +- case PGPHASHALGO_HAVAL_5_160: +- default: +- return HASH_AlgNULL; +- break; +- } +-} +- +-size_t +-rpmDigestLength(pgpHashAlgo hashalgo) +-{ +- return HASH_ResultLen(getHashType(hashalgo)); +-} +- +-DIGEST_CTX +-rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags) +-{ +- HASH_HashType type; +- DIGEST_CTX ctx; +- +- if (rpmInitCrypto() < 0) +- return NULL; +- +- ctx = xcalloc(1, sizeof(*ctx)); +- ctx->flags = flags; +- +- type = getHashType(hashalgo); +- if (type == HASH_AlgNULL) { +- free(ctx); +- return NULL; +- } +- +- ctx->hashctx = HASH_Create(type); +- if (ctx->hashctx == NULL) { +- free(ctx); +- return NULL; +- } +- +- HASH_Begin(ctx->hashctx); +- +-DPRINTF((stderr, "*** Init(%x) ctx %p hashctx %p\n", flags, ctx, ctx->hashctx)); +- return ctx; +-} +- +-int +-rpmDigestUpdate(DIGEST_CTX ctx, const void * data, size_t len) +-{ +- size_t partlen; +- const unsigned char *ptr = data; +- +- if (ctx == NULL) +- return -1; +- +-DPRINTF((stderr, "*** Update(%p,%p,%zd) hashctx %p \"%s\"\n", ctx, data, len, ctx->hashctx, ((char *)data))); +- partlen = ~(unsigned int)0xFF; +- while (len > 0) { +- if (len < partlen) { +- partlen = len; +- } +- HASH_Update(ctx->hashctx, ptr, partlen); +- ptr += partlen; +- len -= partlen; +- } +- return 0; +-} +- +-int +-rpmDigestFinal(DIGEST_CTX ctx, void ** datap, size_t *lenp, int asAscii) +-{ +- unsigned char * digest; +- unsigned int digestlen; +- +- if (ctx == NULL) +- return -1; +- digestlen = HASH_ResultLenContext(ctx->hashctx); +- digest = xmalloc(digestlen); +- +-DPRINTF((stderr, "*** Final(%p,%p,%p,%zd) hashctx %p digest %p\n", ctx, datap, lenp, asAscii, ctx->hashctx, digest)); +-/* FIX: check rc */ +- HASH_End(ctx->hashctx, digest, (unsigned int *) &digestlen, digestlen); +- +- /* Return final digest. */ +- if (!asAscii) { +- if (lenp) *lenp = digestlen; +- if (datap) { +- *datap = digest; +- digest = NULL; +- } +- } else { +- if (lenp) *lenp = (2*digestlen) + 1; +- if (datap) { +- const uint8_t * s = (const uint8_t *) digest; +- *datap = pgpHexStr(s, digestlen); +- } +- } +- if (digest) { +- memset(digest, 0, digestlen); /* In case it's sensitive */ +- free(digest); +- } +- HASH_Destroy(ctx->hashctx); +- memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ +- free(ctx); +- return 0; +-} + + void fdInitDigest(FD_t fd, pgpHashAlgo hashalgo, int flags) + { +--- ./rpmio/digest.h.orig 2009-06-23 11:40:59.000000000 +0000 ++++ ./rpmio/digest.h 2009-08-20 13:47:03.000000000 +0000 +@@ -1,11 +1,6 @@ + #ifndef _RPMDIGEST_H + #define _RPMDIGEST_H + +-#include +-#include +-#include +-#include +- + #include + #include "rpmio/base64.h" + #include "rpmio/rpmio_internal.h" +@@ -55,12 +50,22 @@ struct pgpDig_s { + size_t md5len; /*!< (rsa) V3 signature hash length. */ + + /* DSA parameters */ +- SECKEYPublicKey *dsa; +- SECItem *dsasig; ++ void *dsa; ++ void *dsasig; + + /* RSA parameters */ +- SECKEYPublicKey *rsa; +- SECItem *rsasig; ++ void *rsa; ++ void *rsasig; + }; + ++int pgpSetSigMpiRSA(pgpDig dig, int num, const uint8_t *p); ++int pgpSetPubMpiRSA(pgpDig dig, int num, const uint8_t *p); ++void pgpCleanRSA(pgpDig dig); ++int pgpVerifyRSA(pgpDig dig); ++ ++int pgpSetSigMpiDSA(pgpDig dig, int num, const uint8_t *p); ++int pgpSetPubMpiDSA(pgpDig dig, int num, const uint8_t *p); ++void pgpCleanDSA(pgpDig dig); ++int pgpVerifyDSA(pgpDig dig); ++ + #endif /* _RPMDIGEST_H */ +--- ./rpmio/digest_beecrypt.c.orig 2009-08-20 13:47:03.000000000 +0000 ++++ ./rpmio/digest_beecrypt.c 2009-08-20 13:47:03.000000000 +0000 +@@ -0,0 +1,503 @@ ++#include "system.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#if HAVE_BEECRYPT_API_H ++#include ++#include ++#include ++#endif ++ ++#include ++#include "rpmio/digest.h" ++#include "rpmio/rpmio_internal.h" ++ ++#include "debug.h" ++ ++/* interface to beecrpyt crypto framework */ ++ ++/**************************** init ************************************/ ++ ++int rpmInitCrypto(void) { ++ return 0; ++} ++ ++int rpmFreeCrypto(void) { ++ return 0; ++} ++ ++/**************************** helpers ************************************/ ++ ++static inline unsigned int pgpMpiBits(const uint8_t *p) ++{ ++ return ((p[0] << 8) | p[1]); ++} ++ ++static inline size_t pgpMpiLen(const uint8_t *p) ++{ ++ return (2 + ((pgpMpiBits(p)+7)>>3)); ++} ++ ++static inline char * pgpHexCvt(char *t, const byte *s, int nbytes) ++ /*@modifies *t @*/ ++{ ++ static char hex[] = "0123456789abcdef"; ++ while (nbytes-- > 0) { ++ unsigned int i; ++ i = *s++; ++ *t++ = hex[ (i >> 4) & 0xf ]; ++ *t++ = hex[ (i ) & 0xf ]; ++ } ++ *t = '\0'; ++ return t; ++} ++ ++static const char * pgpMpiHex(const byte *p) ++{ ++ static char prbuf[2048]; ++ char *t = prbuf; ++ t = pgpHexCvt(t, p+2, pgpMpiLen(p)-2); ++ return prbuf; ++} ++ ++static int pgpHexSet(int lbits, mpnumber * mpn, const byte * p) ++{ ++ unsigned int mbits = pgpMpiBits(p); ++ unsigned int nbits; ++ unsigned int nbytes; ++ char *t; ++ unsigned int ix; ++ ++ nbits = (lbits > mbits ? lbits : mbits); ++ nbytes = ((nbits + 7) >> 3); ++ t = xmalloc(2*nbytes+1); ++ ix = 2 * ((nbits - mbits) >> 3); ++ ++ if (ix > 0) memset(t, (int)'0', ix); ++ strcpy(t+ix, pgpMpiHex(p)); ++ (void) mpnsethex(mpn, t); ++ t = _free(t); ++ return 0; ++} ++ ++ ++/****************************** RSA **************************************/ ++ ++struct pgpDigSigRSA_s { ++ mpnumber c; ++}; ++ ++struct pgpDigPubRSA_s { ++ rsapk rsa_pk; ++}; ++ ++int ++pgpSetSigMpiRSA(pgpDig dig, int num, const uint8_t *p) ++{ ++ struct pgpDigSigRSA_s *sig; ++ if (num != 0) ++ return 1; ++ if (!dig->rsasig) ++ dig->rsasig = xcalloc(1, sizeof(*sig)); ++ sig = dig->rsasig; ++ if (!sig) ++ return 1; ++ (void) mpnsethex(&sig->c, pgpMpiHex(p)); ++ return 0; ++} ++ ++int ++pgpSetPubMpiRSA(pgpDig dig, int num, const uint8_t *p) ++{ ++ struct pgpDigPubRSA_s *pub; ++ ++ if (!dig->rsa) ++ dig->rsa = xcalloc(1, sizeof(*pub)); ++ pub = dig->rsa; ++ if (!pub) ++ return 1; ++ switch(num) { ++ case 0: ++ (void) mpbsethex(&pub->rsa_pk.n, pgpMpiHex(p)); ++ return 0; ++ case 1: ++ (void) mpnsethex(&pub->rsa_pk.e, pgpMpiHex(p)); ++ return 0; ++ default: ++ return 1; ++ } ++} ++ ++void pgpCleanRSA(pgpDig dig) ++{ ++ if (!dig) ++ return; ++ if (dig->rsa) { ++ dig->rsa = _free(dig->rsa); ++ } ++ if (dig->rsasig) { ++ dig->rsasig = _free(dig->rsasig); ++ } ++} ++ ++static inline unsigned char nibble(char c) ++{ ++ if (c >= '0' && c <= '9') ++ return (c - '0'); ++ if (c >= 'A' && c <= 'F') ++ return (c - 'A') + 10; ++ if (c >= 'a' && c <= 'f') ++ return (c - 'a') + 10; ++ return 0; ++} ++ ++int pgpVerifyRSA(pgpDig dig) ++{ ++ const char * prefix = NULL; ++ int res; ++ mpnumber rsahm; ++ struct pgpDigSigRSA_s *sig; ++ struct pgpDigPubRSA_s *pub; ++ ++ sig = dig->rsasig; ++ pub = dig->rsa; ++ if (!sig || !pub) ++ return 1; ++ ++ switch (dig->signature.hash_algo) { ++ case PGPHASHALGO_MD5: ++ prefix = "3020300c06082a864886f70d020505000410"; ++ break; ++ case PGPHASHALGO_SHA1: ++ prefix = "3021300906052b0e03021a05000414"; ++ break; ++ case PGPHASHALGO_MD2: ++ prefix = "3020300c06082a864886f70d020205000410"; ++ break; ++ case PGPHASHALGO_SHA256: ++ prefix = "3031300d060960864801650304020105000420"; ++ break; ++ case PGPHASHALGO_SHA384: ++ prefix = "3041300d060960864801650304020205000430"; ++ break; ++ case PGPHASHALGO_SHA512: ++ prefix = "3051300d060960864801650304020305000440"; ++ break; ++ /* fallthrough for unsupported / unknown types */ ++ default: ++ return 1; ++ } ++ ++ /* Generate RSA modulus parameter. */ ++ { unsigned int nbits = MP_WORDS_TO_BITS(sig->c.size); ++ unsigned int nb = (nbits + 7) >> 3; ++ byte *buf, *bp; ++ ++ if (nb < 3) ++ return 1; ++ buf = xmalloc(nb); ++ memset(buf, 0xff, nb); ++ buf[0] = 0x00; ++ buf[1] = 0x01; ++ bp = buf + nb - strlen(prefix)/2 - dig->md5len - 1; ++ if (bp < buf) ++ return 1; ++ *bp++ = 0; ++ for (; *prefix; prefix += 2) ++ *bp++ = (nibble(prefix[0]) << 4) | nibble(prefix[1]); ++ memcpy(bp, dig->md5, dig->md5len); ++ mpnzero(&rsahm); ++ (void) mpnsetbin(&rsahm, buf, nb); ++ buf = _free(buf); ++ } ++#if HAVE_BEECRYPT_API_H ++ res = rsavrfy(&pub->rsa_pk.n, &pub->rsa_pk.e, &sig->c, &rsahm) == 1 ? 0 : 1; ++#else ++ res = rsavrfy(&pub->rsa_pk, &rsahm, &sig->c) == 1 ? 0 : 1; ++#endif ++ mpnfree(&rsahm); ++ return res; ++} ++ ++ ++/****************************** DSA **************************************/ ++ ++struct pgpDigSigDSA_s { ++ mpnumber r; ++ mpnumber s; ++}; ++ ++struct pgpDigPubDSA_s { ++ mpbarrett p; ++ mpbarrett q; ++ mpnumber g; ++ mpnumber y; ++}; ++ ++int ++pgpSetSigMpiDSA(pgpDig dig, int num, const uint8_t *p) ++{ ++ struct pgpDigSigDSA_s *sig; ++ ++ if (!dig->dsasig) ++ dig->dsasig = xcalloc(1, sizeof(*sig)); ++ sig = dig->dsasig; ++ if (!sig) ++ return 1; ++ switch(num) { ++ case 0: ++ return pgpHexSet(160, &sig->r, p); ++ case 1: ++ return pgpHexSet(160, &sig->s, p); ++ default: ++ return 1; ++ } ++} ++ ++int ++pgpSetPubMpiDSA(pgpDig dig, int num, const uint8_t *p) ++{ ++ struct pgpDigPubDSA_s *pub; ++ ++ if (!dig->dsa) ++ dig->dsa = xcalloc(1, sizeof(*pub)); ++ pub = dig->dsa; ++ if (!pub) ++ return 1; ++ switch(num) { ++ case 0: ++ mpbsethex(&pub->p, pgpMpiHex(p)); ++ return 0; ++ case 1: ++ mpbsethex(&pub->q, pgpMpiHex(p)); ++ return 0; ++ case 2: ++ mpnsethex(&pub->g, pgpMpiHex(p)); ++ return 0; ++ case 3: ++ mpnsethex(&pub->y, pgpMpiHex(p)); ++ return 0; ++ default: ++ return 1; ++ } ++} ++ ++void pgpCleanDSA(pgpDig dig) ++{ ++ if (!dig) ++ return; ++ if (dig->dsa) { ++ dig->dsa = _free(dig->dsa); ++ } ++ if (dig->dsasig) { ++ dig->dsasig = _free(dig->dsasig); ++ } ++} ++ ++int pgpVerifyDSA(pgpDig dig) ++{ ++ struct pgpDigSigDSA_s *sig; ++ struct pgpDigPubDSA_s *pub; ++ mpnumber hm; ++ int res; ++ ++ sig = dig->dsasig; ++ pub = dig->dsa; ++ if (!sig || !pub) ++ return 1; ++ mpnzero(&hm); ++ mpnsetbin(&hm, dig->sha1, dig->sha1len); ++ res = dsavrfy(&pub->p, &pub->q, &pub->g, &hm, &pub->y, &sig->r, &sig->s) == 1 ? 0 : 1; ++ mpnfree(&hm); ++ return res; ++} ++ ++/**************************** digest ************************************/ ++ ++#ifdef SHA_DEBUG ++#define DPRINTF(_a) fprintf _a ++#else ++#define DPRINTF(_a) ++#endif ++ ++/** ++ * MD5/SHA1 digest private data. ++ */ ++struct DIGEST_CTX_s { ++ rpmDigestFlags flags; /*!< Bit(s) to control digest operation. */ ++ uint32_t datalen; /*!< No. bytes in block of plaintext data. */ ++ uint32_t paramlen; /*!< No. bytes of digest parameters. */ ++ uint32_t digestlen; /*!< No. bytes of digest. */ ++ void * param; /*!< Digest parameters. */ ++ int (*Reset) (void * param) ++ /*@modifies param @*/; /*!< Digest initialize. */ ++ int (*Update) (void * param, const byte * data, size_t size) ++ /*@modifies param @*/; /*!< Digest transform. */ ++ int (*Digest) (void * param, /*@out@*/ byte * digest) ++ /*@modifies param, digest @*/; /*!< Digest finish. */ ++}; ++ ++DIGEST_CTX ++rpmDigestDup(DIGEST_CTX octx) ++{ ++ DIGEST_CTX nctx; ++ nctx = memcpy(xcalloc(1, sizeof(*nctx)), octx, sizeof(*nctx)); ++ nctx->param = memcpy(xcalloc(1, nctx->paramlen), octx->param, nctx->paramlen); ++ return nctx; ++} ++ ++size_t ++rpmDigestLength(pgpHashAlgo hashalgo) ++{ ++ switch (hashalgo) { ++ case PGPHASHALGO_MD5: ++ return 16; ++ case PGPHASHALGO_SHA1: ++ return 20; ++#if HAVE_BEECRYPT_API_H ++ case PGPHASHALGO_SHA256: ++ return 32; ++ case PGPHASHALGO_SHA384: ++ return 48; ++ case PGPHASHALGO_SHA512: ++ return 64; ++#endif ++ default: ++ return 0; ++ } ++} ++ ++DIGEST_CTX ++rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags) ++{ ++ DIGEST_CTX ctx = xcalloc(1, sizeof(*ctx)); ++ int xx; ++ ++ ctx->flags = flags; ++ ++ switch (hashalgo) { ++ case PGPHASHALGO_MD5: ++ ctx->digestlen = 16; ++ ctx->datalen = 64; ++ ctx->paramlen = sizeof(md5Param); ++ ctx->param = xcalloc(1, ctx->paramlen); ++ ctx->Reset = (void *) md5Reset; ++ ctx->Update = (void *) md5Update; ++ ctx->Digest = (void *) md5Digest; ++ break; ++ case PGPHASHALGO_SHA1: ++ ctx->digestlen = 20; ++ ctx->datalen = 64; ++ ctx->paramlen = sizeof(sha1Param); ++ ctx->param = xcalloc(1, ctx->paramlen); ++ ctx->Reset = (void *) sha1Reset; ++ ctx->Update = (void *) sha1Update; ++ ctx->Digest = (void *) sha1Digest; ++ break; ++#if HAVE_BEECRYPT_API_H ++ case PGPHASHALGO_SHA256: ++ ctx->digestlen = 32; ++ ctx->datalen = 64; ++ ctx->paramlen = sizeof(sha256Param); ++ ctx->param = xcalloc(1, ctx->paramlen); ++ ctx->Reset = (void *) sha256Reset; ++ ctx->Update = (void *) sha256Update; ++ ctx->Digest = (void *) sha256Digest; ++ break; ++ case PGPHASHALGO_SHA384: ++ ctx->digestlen = 48; ++ ctx->datalen = 128; ++ ctx->paramlen = sizeof(sha384Param); ++ ctx->param = xcalloc(1, ctx->paramlen); ++ ctx->Reset = (void *) sha384Reset; ++ ctx->Update = (void *) sha384Update; ++ ctx->Digest = (void *) sha384Digest; ++ break; ++ case PGPHASHALGO_SHA512: ++ ctx->digestlen = 64; ++ ctx->datalen = 128; ++ ctx->paramlen = sizeof(sha512Param); ++ ctx->param = xcalloc(1, ctx->paramlen); ++ ctx->Reset = (void *) sha512Reset; ++ ctx->Update = (void *) sha512Update; ++ ctx->Digest = (void *) sha512Digest; ++ break; ++#endif ++ case PGPHASHALGO_RIPEMD160: ++ case PGPHASHALGO_MD2: ++ case PGPHASHALGO_TIGER192: ++ case PGPHASHALGO_HAVAL_5_160: ++ default: ++ free(ctx); ++ return NULL; ++ } ++ ++ xx = (*ctx->Reset) (ctx->param); ++ ++DPRINTF((stderr, "*** Init(%x) ctx %p param %p\n", flags, ctx, ctx->param)); ++ return ctx; ++} ++ ++/* LCL: ctx->param may be modified, but ctx is abstract @*/ ++int ++rpmDigestUpdate(DIGEST_CTX ctx, const void * data, size_t len) ++{ ++ if (ctx == NULL) ++ return -1; ++ ++DPRINTF((stderr, "*** Update(%p,%p,%d) param %p \"%s\"\n", ctx, data, len, ctx->param, ((char *)data))); ++ return (*ctx->Update) (ctx->param, data, len); ++} ++ ++int ++rpmDigestFinal(DIGEST_CTX ctx, void ** datap, size_t *lenp, int asAscii) ++{ ++ byte * digest; ++ char * t; ++ int i; ++ ++ if (ctx == NULL) ++ return -1; ++ digest = xmalloc(ctx->digestlen); ++ ++DPRINTF((stderr, "*** Final(%p,%p,%p,%d) param %p digest %p\n", ctx, datap, lenp, asAscii, ctx->param, digest)); ++ /* FIX: check rc */ ++ (void) (*ctx->Digest) (ctx->param, digest); ++ ++ /* Return final digest. */ ++ if (!asAscii) { ++ if (lenp) *lenp = ctx->digestlen; ++ if (datap) { ++ *datap = digest; ++ digest = NULL; ++ } ++ } else { ++ if (lenp) *lenp = (2*ctx->digestlen) + 1; ++ if (datap) { ++ const byte * s = (const byte *) digest; ++ static const char hex[] = "0123456789abcdef"; ++ ++ *datap = t = xmalloc((2*ctx->digestlen) + 1); ++ for (i = 0 ; i < ctx->digestlen; i++) { ++ *t++ = hex[ (unsigned)((*s >> 4) & 0x0f) ]; ++ *t++ = hex[ (unsigned)((*s++ ) & 0x0f) ]; ++ } ++ *t = '\0'; ++ } ++ } ++ if (digest) { ++ memset(digest, 0, ctx->digestlen); /* In case it's sensitive */ ++ free(digest); ++ } ++ memset(ctx->param, 0, ctx->paramlen); /* In case it's sensitive */ ++ free(ctx->param); ++ memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ ++ free(ctx); ++ return 0; ++} +--- ./rpmio/digest_nss.c.orig 2009-08-20 13:47:03.000000000 +0000 ++++ ./rpmio/digest_nss.c 2009-08-20 13:49:53.000000000 +0000 +@@ -0,0 +1,513 @@ ++#include ++#include ++#include ++#include ++ ++#include "system.h" ++ ++#include ++#include "rpmio/rpmio_internal.h" ++#include "rpmio/digest.h" ++ ++#include "debug.h" ++ ++/* interface to nss crypto framework */ ++ ++/**************************** init ************************************/ ++ ++static int _crypto_initialized = 0; ++static int _new_process = 1; ++ ++/* ++ * Only flag for re-initialization here, in the common case the child ++ * exec()'s something else shutting down NSS here would be waste of time. ++ */ ++static void at_forkchild(void) { ++ _new_process = 1; ++} ++ ++int rpmInitCrypto(void) { ++ int rc = 0; ++ ++ /* Lazy NSS shutdown for re-initialization after fork() */ ++ if (_new_process && _crypto_initialized) { ++ rpmFreeCrypto(); ++ } ++ ++ /* Initialize NSS if not already done */ ++ if (!_crypto_initialized) { ++ if (NSS_NoDB_Init(NULL) != SECSuccess) { ++ rc = -1; ++ } else { ++ _crypto_initialized = 1; ++ } ++ } ++ ++ /* Register one post-fork handler per process */ ++ if (_new_process) { ++ if (pthread_atfork(NULL, NULL, at_forkchild) != 0) { ++ rpmlog(RPMLOG_WARNING, _("Failed to register fork handler: %m\n")); ++ } ++ _new_process = 0; ++ } ++ return rc; ++} ++ ++int rpmInitCrypto(void) { ++ int rc = 0; ++ ++ if (!_crypto_initialized) { ++ if (NSS_NoDB_Init(NULL) != SECSuccess) { ++ rc = -1; ++ } else { ++ _crypto_initialized = 1; ++ } ++ } ++ return rc; ++} ++ ++int rpmFreeCrypto(void) ++{ ++ int rc = 0; ++ if (_crypto_initialized) { ++ rc = (NSS_Shutdown() != SECSuccess); ++ _crypto_initialized = 0; ++ } ++ return rc; ++} ++ ++/**************************** helpers ************************************/ ++ ++static SECKEYPublicKey *pgpNewPublicKey(KeyType type) ++{ ++ PRArenaPool *arena; ++ SECKEYPublicKey *key; ++ ++ arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); ++ if (arena == NULL) ++ return NULL; ++ ++ key = PORT_ArenaZAlloc(arena, sizeof(SECKEYPublicKey)); ++ ++ if (key == NULL) { ++ PORT_FreeArena(arena, PR_FALSE); ++ return NULL; ++ } ++ ++ key->keyType = type; ++ key->pkcs11ID = CK_INVALID_HANDLE; ++ key->pkcs11Slot = NULL; ++ key->arena = arena; ++ return key; ++} ++ ++static SECItem *pgpMpiItem(PRArenaPool *arena, SECItem *item, const uint8_t *p) ++{ ++ size_t nbytes = pgpMpiLen(p)-2; ++ ++ if (item == NULL) { ++ if ((item=SECITEM_AllocItem(arena, item, nbytes)) == NULL) ++ return item; ++ } else { ++ if (arena != NULL) ++ item->data = PORT_ArenaGrow(arena, item->data, item->len, nbytes); ++ else ++ item->data = PORT_Realloc(item->data, nbytes); ++ ++ if (item->data == NULL) { ++ if (arena == NULL) ++ SECITEM_FreeItem(item, PR_TRUE); ++ return NULL; ++ } ++ } ++ ++ memcpy(item->data, p+2, nbytes); ++ item->len = nbytes; ++ return item; ++} ++ ++static int pgpMpiSet(unsigned int lbits, ++ void *dest, const uint8_t * p, const uint8_t * pend) ++{ ++ unsigned int mbits = pgpMpiBits(p); ++ unsigned int nbits; ++ size_t nbytes; ++ char *t = dest; ++ unsigned int ix; ++ ++ if ((p + ((mbits+7) >> 3)) > pend) ++ return 1; ++ ++ if (mbits > lbits) ++ return 1; ++ ++ nbits = (lbits > mbits ? lbits : mbits); ++ nbytes = ((nbits + 7) >> 3); ++ ix = (nbits - mbits) >> 3; ++ ++ if (ix > 0) memset(t, '\0', ix); ++ memcpy(t+ix, p+2, nbytes-ix); ++ ++ return 0; ++} ++ ++/****************************** RSA **************************************/ ++ ++int ++pgpSetSigMpiRSA(struct pgpDig_s *dig, int num, const uint8_t *p, const uint8_t *pend) ++{ ++ SECItem *sig; ++ ++ if (num != 0) ++ return 1; ++ sig = dig->rsasig; ++ sig = pgpMpiItem(NULL, sig, p); ++ dig->rsasig = sig; ++ if (sig == NULL) ++ return 1; ++ return 0; ++} ++ ++int ++pgpSetPubMpiRSA(struct pgpDig_s *dig, int num, const uint8_t *p, const uint8_t *pend) ++{ ++ SECKEYPublicKey *pub; ++ ++ if (!dig->rsa) ++ dig->rsa = pgpNewPublicKey(rsaKey); ++ pub = dig->rsa; ++ if (!pub) ++ return 1; ++ switch(num) { ++ case 0: ++ pgpMpiItem(dig->rsa->arena, &pub->u.rsa.modulus, p); ++ return 0; ++ case 1: ++ pgpMpiItem(dig->rsa->arena, &pub->u.rsa.publicExponent, p); ++ return 0; ++ default: ++ return 1; ++ } ++} ++ ++void pgpCleanRSA(pgpDig dig) ++{ ++ if (!dig) ++ return; ++ if (dig->rsa) { ++ SECKEY_DestroyPublicKey(dig->rsa); ++ dig->rsa = NULL; ++ } ++ if (dig->rsasig) { ++ SECITEM_ZfreeItem(dig->rsasig, PR_TRUE); ++ dig->rsasig = NULL; ++ } ++} ++ ++int pgpVerifyRSA(pgpDig dig) ++{ ++ SECOidTag sigalg; ++ SECItem digest; ++ SECItem *sig; ++ size_t siglen; ++ int res; ++ ++ switch (dig->hash_algo) { ++ case PGPHASHALGO_MD5: ++ sigalg = SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION; ++ break; ++ case PGPHASHALGO_SHA1: ++ sigalg = SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION; ++ break; ++ case PGPHASHALGO_MD2: ++ sigalg = SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION; ++ break; ++ case PGPHASHALGO_SHA256: ++ sigalg = SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION; ++ break; ++ case PGPHASHALGO_SHA384: ++ sigalg = SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION; ++ break; ++ case PGPHASHALGO_SHA512: ++ sigalg = SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION; ++ break; ++ /* fallthrough for unsupported / unknown types */ ++ default: ++ sigalg = SEC_OID_UNKNOWN; ++ break; ++ } ++ digest.type = siBuffer; ++ digest.data = dig->md5; ++ digest.len = dig->md5len; ++ ++ sig = dig->rsasig; ++ siglen = SECKEY_SignatureLen(dig->rsa); ++ ++ /* Zero-pad signature data up to expected size if necessary */ ++ if (siglen > sig->len) { ++ size_t pad = siglen - sig->len; ++ if ((sig = SECITEM_AllocItem(NULL, NULL, siglen)) == NULL) { ++ return 1; ++ } ++ memset(sig->data, 0, pad); ++ memcpy(sig->data+pad, dig->rsasig->data, dig->rsasig->len); ++ } ++ ++ if (VFY_VerifyDigest(&digest, dig->rsa, sig, sigalg, NULL) == SECSuccess) ++ res = 0; ++ else ++ res = 1; ++ ++ if (sig != dig->rsasig) { ++ SECITEM_ZfreeItem(sig, 1); ++ } ++ return res; ++} ++ ++ ++/****************************** DSA **************************************/ ++ ++int ++pgpSetSigMpiDSA(struct pgpDig_s *dig, int num, const uint8_t *p, const uint8_t *pend) ++{ ++ SECItem *sig, *new; ++ ++ switch(num) { ++ case 0: ++ sig = SECITEM_AllocItem(NULL, NULL, 2*DSA_SUBPRIME_LEN); ++ dig->dsasig = sig; ++ memset(sig->data, 0, 2*DSA_SUBPRIME_LEN); ++ pgpMpiSet(DSA_SUBPRIME_LEN*8, sig->data, p, pend); ++ return 0; ++ case 1: ++ sig = dig->dsasig; ++ if (!sig) ++ return 1; ++ pgpMpiSet(DSA_SUBPRIME_LEN*8, sig->data + DSA_SUBPRIME_LEN, p, pend); ++ new = SECITEM_AllocItem(NULL, NULL, 0); ++ if (!new) ++ return 1; ++ if (DSAU_EncodeDerSig(new, sig) != SECSuccess) ++ return 1; ++ SECITEM_FreeItem(sig, PR_TRUE); ++ dig->dsasig = new; ++ return 0; ++ default: ++ return 1; ++ } ++} ++ ++int ++pgpSetPubMpiDSA(struct pgpDig_s *dig, int num, const uint8_t *p, const uint8_t *pend) ++{ ++ SECKEYPublicKey *pub; ++ ++ if (!dig->dsa) ++ dig->dsa = pgpNewPublicKey(dsaKey); ++ pub = dig->dsa; ++ if (!pub) ++ return 1; ++ switch(num) { ++ case 0: ++ pgpMpiItem(pub->arena, &pub->u.dsa.params.prime, p); ++ return 0; ++ case 1: ++ pgpMpiItem(pub->arena, &pub->u.dsa.params.subPrime, p); ++ return 0; ++ case 2: ++ pgpMpiItem(pub->arena, &pub->u.dsa.params.base, p); ++ return 0; ++ case 3: ++ pgpMpiItem(pub->arena, &pub->u.dsa.publicValue, p); ++ return 0; ++ default: ++ return 1; ++ } ++} ++ ++void pgpCleanDSA(pgpDig dig) ++{ ++ if (!dig) ++ return; ++ if (dig->dsa) { ++ SECKEY_DestroyPublicKey(dig->dsa); ++ dig->dsa = NULL; ++ } ++ if (dig->dsasig) { ++ SECITEM_ZfreeItem(dig->dsasig, PR_TRUE); ++ dig->dsasig = NULL; ++ } ++} ++ ++int pgpVerifyDSA(pgpDig dig) ++{ ++ SECItem digest; ++ ++ digest.type = siBuffer; ++ digest.data = dig->sha1; ++ digest.len = dig->sha1len; ++ if (VFY_VerifyDigest(&digest, dig->dsa, dig->dsasig, SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST, NULL) == SECSuccess) ++ return 0; ++ else ++ return 1; ++} ++ ++ ++/**************************** digest ************************************/ ++ ++ ++#ifdef SHA_DEBUG ++#define DPRINTF(_a) fprintf _a ++#else ++#define DPRINTF(_a) ++#endif ++ ++ ++/** ++ * MD5/SHA1 digest private data. ++ */ ++struct DIGEST_CTX_s { ++ rpmDigestFlags flags; /*!< Bit(s) to control digest operation. */ ++ HASHContext *hashctx; /*!< Internal NSS hash context. */ ++}; ++ ++DIGEST_CTX ++rpmDigestDup(DIGEST_CTX octx) ++{ ++ DIGEST_CTX nctx; ++ nctx = memcpy(xcalloc(1, sizeof(*nctx)), octx, sizeof(*nctx)); ++ nctx->hashctx = HASH_Clone(octx->hashctx); ++ if (nctx->hashctx == NULL) { ++ fprintf(stderr, "HASH_Clone failed\n"); ++ exit(EXIT_FAILURE); /* FIX: callers do not bother checking error return */ ++ } ++ return nctx; ++} ++ ++RPM_GNUC_PURE ++static HASH_HashType getHashType(pgpHashAlgo hashalgo) ++{ ++ switch (hashalgo) { ++ case PGPHASHALGO_MD5: ++ return HASH_AlgMD5; ++ break; ++ case PGPHASHALGO_MD2: ++ return HASH_AlgMD2; ++ break; ++ case PGPHASHALGO_SHA1: ++ return HASH_AlgSHA1; ++ break; ++ case PGPHASHALGO_SHA256: ++ return HASH_AlgSHA256; ++ break; ++ case PGPHASHALGO_SHA384: ++ return HASH_AlgSHA384; ++ break; ++ case PGPHASHALGO_SHA512: ++ return HASH_AlgSHA512; ++ break; ++ case PGPHASHALGO_RIPEMD160: ++ case PGPHASHALGO_TIGER192: ++ case PGPHASHALGO_HAVAL_5_160: ++ default: ++ return HASH_AlgNULL; ++ break; ++ } ++} ++ ++size_t ++rpmDigestLength(pgpHashAlgo hashalgo) ++{ ++ return HASH_ResultLen(getHashType(hashalgo)); ++} ++ ++DIGEST_CTX ++rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags) ++{ ++ HASH_HashType type; ++ DIGEST_CTX ctx; ++ ++ if (rpmInitCrypto() < 0) ++ return NULL; ++ ++ ctx = xcalloc(1, sizeof(*ctx)); ++ ctx->flags = flags; ++ ++ type = getHashType(hashalgo); ++ if (type == HASH_AlgNULL) { ++ free(ctx); ++ return NULL; ++ } ++ ++ ctx->hashctx = HASH_Create(type); ++ if (ctx->hashctx == NULL) { ++ free(ctx); ++ return NULL; ++ } ++ ++ HASH_Begin(ctx->hashctx); ++ ++DPRINTF((stderr, "*** Init(%x) ctx %p hashctx %p\n", flags, ctx, ctx->hashctx)); ++ return ctx; ++} ++ ++int ++rpmDigestUpdate(DIGEST_CTX ctx, const void * data, size_t len) ++{ ++ size_t partlen; ++ const unsigned char *ptr = data; ++ ++ if (ctx == NULL) ++ return -1; ++ ++DPRINTF((stderr, "*** Update(%p,%p,%zd) hashctx %p \"%s\"\n", ctx, data, len, ctx->hashctx, ((char *)data))); ++ partlen = ~(unsigned int)0xFF; ++ while (len > 0) { ++ if (len < partlen) { ++ partlen = len; ++ } ++ HASH_Update(ctx->hashctx, ptr, partlen); ++ ptr += partlen; ++ len -= partlen; ++ } ++ return 0; ++} ++ ++int ++rpmDigestFinal(DIGEST_CTX ctx, void ** datap, size_t *lenp, int asAscii) ++{ ++ unsigned char * digest; ++ unsigned int digestlen; ++ ++ if (ctx == NULL) ++ return -1; ++ digestlen = HASH_ResultLenContext(ctx->hashctx); ++ digest = xmalloc(digestlen); ++ ++DPRINTF((stderr, "*** Final(%p,%p,%p,%zd) hashctx %p digest %p\n", ctx, datap, lenp, asAscii, ctx->hashctx, digest)); ++/* FIX: check rc */ ++ HASH_End(ctx->hashctx, digest, (unsigned int *) &digestlen, digestlen); ++ ++ /* Return final digest. */ ++ if (!asAscii) { ++ if (lenp) *lenp = digestlen; ++ if (datap) { ++ *datap = digest; ++ digest = NULL; ++ } ++ } else { ++ if (lenp) *lenp = (2*digestlen) + 1; ++ if (datap) { ++ const uint8_t * s = (const uint8_t *) digest; ++ *datap = pgpHexStr(s, digestlen); ++ } ++ } ++ if (digest) { ++ memset(digest, 0, digestlen); /* In case it's sensitive */ ++ free(digest); ++ } ++ HASH_Destroy(ctx->hashctx); ++ memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ ++ free(ctx); ++ return 0; ++} +--- ./rpmio/rpmpgp.c.orig 2009-06-23 11:40:59.000000000 +0000 ++++ ./rpmio/rpmpgp.c 2009-08-20 13:50:14.000000000 +0000 +@@ -20,9 +20,6 @@ static int _debug = 0; + + static int _print = 0; + +-static int _crypto_initialized = 0; +-static int _new_process = 1; +- + static struct pgpValTbl_s const pgpSigTypeTbl[] = { + { PGPSIGTYPE_BINARY, "Binary document signature" }, + { PGPSIGTYPE_TEXT, "Text document signature" }, +@@ -291,99 +288,6 @@ int pgpValTok(pgpValTbl vs, const char * + } while ((++vs)->val != -1); + return vs->val; + } +-/** +- * @return 0 on success +- */ +-static int pgpMpiSet(const char * pre, unsigned int lbits, +- void *dest, const uint8_t * p, const uint8_t * pend) +-{ +- unsigned int mbits = pgpMpiBits(p); +- unsigned int nbits; +- size_t nbytes; +- char *t = dest; +- unsigned int ix; +- +- if ((p + ((mbits+7) >> 3)) > pend) +- return 1; +- +- if (mbits > lbits) +- return 1; +- +- nbits = (lbits > mbits ? lbits : mbits); +- nbytes = ((nbits + 7) >> 3); +- ix = (nbits - mbits) >> 3; +- +-if (_debug) +-fprintf(stderr, "*** mbits %u nbits %u nbytes %zu ix %u\n", mbits, nbits, nbytes, ix); +- if (ix > 0) memset(t, '\0', ix); +- memcpy(t+ix, p+2, nbytes-ix); +-if (_debug) +-fprintf(stderr, "*** %s %s\n", pre, pgpHexStr(dest, nbytes)); +- +- return 0; +-} +- +-/** +- * @return NULL on error +- */ +-static SECItem *pgpMpiItem(PRArenaPool *arena, SECItem *item, const uint8_t *p) +-{ +- size_t nbytes = pgpMpiLen(p)-2; +- +- if (item == NULL) { +- if ((item=SECITEM_AllocItem(arena, item, nbytes)) == NULL) +- return item; +- } else { +- if (arena != NULL) +- item->data = PORT_ArenaGrow(arena, item->data, item->len, nbytes); +- else +- item->data = PORT_Realloc(item->data, nbytes); +- +- if (item->data == NULL) { +- if (arena == NULL) +- SECITEM_FreeItem(item, PR_TRUE); +- return NULL; +- } +- } +- +- memcpy(item->data, p+2, nbytes); +- item->len = nbytes; +- return item; +-} +-/*@=boundswrite@*/ +- +-static SECKEYPublicKey *pgpNewPublicKey(KeyType type) +-{ +- PRArenaPool *arena; +- SECKEYPublicKey *key; +- +- arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); +- if (arena == NULL) +- return NULL; +- +- key = PORT_ArenaZAlloc(arena, sizeof(SECKEYPublicKey)); +- +- if (key == NULL) { +- PORT_FreeArena(arena, PR_FALSE); +- return NULL; +- } +- +- key->keyType = type; +- key->pkcs11ID = CK_INVALID_HANDLE; +- key->pkcs11Slot = NULL; +- key->arena = arena; +- return key; +-} +- +-static SECKEYPublicKey *pgpNewRSAKey(void) +-{ +- return pgpNewPublicKey(rsaKey); +-} +- +-static SECKEYPublicKey *pgpNewDSAKey(void) +-{ +- return pgpNewPublicKey(dsaKey); +-} + + /** \ingroup rpmpgp + * Is buffer at beginning of an OpenPGP packet? +@@ -579,29 +483,16 @@ static int pgpPrtSigParams(pgpTag tag, u + { + const uint8_t * pend = h + hlen; + size_t i; +- SECItem dsaraw; +- unsigned char dsabuf[2*DSA_SUBPRIME_LEN]; + char *mpi; + +- dsaraw.type = 0; +- dsaraw.data = dsabuf; +- dsaraw.len = sizeof(dsabuf); +- + for (i = 0; p < pend; i++, p += pgpMpiLen(p)) { + if (pubkey_algo == PGPPUBKEYALGO_RSA) { + if (i >= 1) break; + if (_dig && + (sigtype == PGPSIGTYPE_BINARY || sigtype == PGPSIGTYPE_TEXT)) + { +- switch (i) { +- case 0: /* m**d */ +- _dig->rsasig = pgpMpiItem(NULL, _dig->rsasig, p); +- if (_dig->rsasig == NULL) +- return 1; +- break; +- default: +- break; +- } ++ if (pgpSetSigMpiRSA(_dig, i, p)) ++ return 1; + } + pgpPrtStr("", pgpSigRSA[i]); + } else if (pubkey_algo == PGPPUBKEYALGO_DSA) { +@@ -609,30 +500,8 @@ static int pgpPrtSigParams(pgpTag tag, u + if (_dig && + (sigtype == PGPSIGTYPE_BINARY || sigtype == PGPSIGTYPE_TEXT)) + { +- int xx; +- xx = 0; +- switch (i) { +- case 0: +- memset(dsaraw.data, '\0', 2*DSA_SUBPRIME_LEN); +- /* r */ +- xx = pgpMpiSet(pgpSigDSA[i], DSA_SUBPRIME_LEN*8, dsaraw.data, p, pend); +- break; +- case 1: /* s */ +- xx = pgpMpiSet(pgpSigDSA[i], DSA_SUBPRIME_LEN*8, dsaraw.data + DSA_SUBPRIME_LEN, p, pend); +- if (_dig->dsasig != NULL) +- SECITEM_FreeItem(_dig->dsasig, PR_FALSE); +- else if ((_dig->dsasig=SECITEM_AllocItem(NULL, NULL, 0)) == NULL) { +- xx = 1; +- break; +- } +- if (DSAU_EncodeDerSig(_dig->dsasig, &dsaraw) != SECSuccess) +- xx = 1; +- break; +- default: +- xx = 1; +- break; +- } +- if (xx) return xx; ++ if (pgpSetSigMpiDSA(_dig, i, p)) ++ return 1; + } + pgpPrtStr("", pgpSigDSA[i]); + } else { +@@ -824,49 +693,11 @@ static const uint8_t * pgpPrtPubkeyParam + char * mpi; + if (pubkey_algo == PGPPUBKEYALGO_RSA) { + if (i >= 2) break; +- if (_dig) { +- if (_dig->rsa == NULL) { +- _dig->rsa = pgpNewRSAKey(); +- if (_dig->rsa == NULL) +- break; /* error abort? */ +- } +- switch (i) { +- case 0: /* n */ +- pgpMpiItem(_dig->rsa->arena, &_dig->rsa->u.rsa.modulus, p); +- break; +- case 1: /* e */ +- pgpMpiItem(_dig->rsa->arena, &_dig->rsa->u.rsa.publicExponent, p); +- break; +- default: +- break; +- } +- } ++ pgpSetPubMpiRSA(_dig, i, p); + pgpPrtStr("", pgpPublicRSA[i]); + } else if (pubkey_algo == PGPPUBKEYALGO_DSA) { + if (i >= 4) break; +- if (_dig) { +- if (_dig->dsa == NULL) { +- _dig->dsa = pgpNewDSAKey(); +- if (_dig->dsa == NULL) +- break; /* error abort? */ +- } +- switch (i) { +- case 0: /* p */ +- pgpMpiItem(_dig->dsa->arena, &_dig->dsa->u.dsa.params.prime, p); +- break; +- case 1: /* q */ +- pgpMpiItem(_dig->dsa->arena, &_dig->dsa->u.dsa.params.subPrime, p); +- break; +- case 2: /* g */ +- pgpMpiItem(_dig->dsa->arena, &_dig->dsa->u.dsa.params.base, p); +- break; +- case 3: /* y */ +- pgpMpiItem(_dig->dsa->arena, &_dig->dsa->u.dsa.publicValue, p); +- break; +- default: +- break; +- } +- } ++ pgpSetPubMpiDSA(_dig, i, p); + pgpPrtStr("", pgpPublicDSA[i]); + } else if (pubkey_algo == PGPPUBKEYALGO_ELGAMAL_ENCRYPT) { + if (i >= 3) break; +@@ -1256,25 +1087,8 @@ void pgpCleanDig(pgpDig dig) + dig->md5 = _free(dig->md5); + dig->sha1 = _free(dig->sha1); + +- if (dig->dsa != NULL) { +- SECKEY_DestroyPublicKey(dig->dsa); +- dig->dsa = NULL; +- } +- +- if (dig->dsasig != NULL) { +- SECITEM_ZfreeItem(dig->dsasig, PR_TRUE); +- dig->dsasig = NULL; +- } +- +- if (dig->rsa != NULL) { +- SECKEY_DestroyPublicKey(dig->rsa); +- dig->rsa = NULL; +- } +- +- if (dig->rsasig != NULL) { +- SECITEM_ZfreeItem(dig->rsasig, PR_TRUE); +- dig->rsasig = NULL; +- } ++ pgpCleanRSA(dig); ++ pgpCleanDSA(dig); + + } + return; +@@ -1501,50 +1315,3 @@ char * pgpArmorWrap(int atype, const uns + return val; + } + +-/* +- * Only flag for re-initialization here, in the common case the child +- * exec()'s something else shutting down NSS here would be waste of time. +- */ +-static void at_forkchild(void) +-{ +- _new_process = 1; +-} +- +-int rpmInitCrypto(void) { +- int rc = 0; +- +- /* Lazy NSS shutdown for re-initialization after fork() */ +- if (_new_process && _crypto_initialized) { +- rpmFreeCrypto(); +- } +- +- /* Initialize NSS if not already done */ +- if (!_crypto_initialized) { +- if (NSS_NoDB_Init(NULL) != SECSuccess) { +- rc = -1; +- } else { +- _crypto_initialized = 1; +- } +- } +- +- /* Register one post-fork handler per process */ +- if (_new_process) { +- if (pthread_atfork(NULL, NULL, at_forkchild) != 0) { +- rpmlog(RPMLOG_WARNING, _("Failed to register fork handler: %m\n")); +- } +- _new_process = 0; +- } +- return rc; +-} +- +-int rpmFreeCrypto(void) +-{ +- int rc = 0; +- if (_crypto_initialized) { +- rc = (NSS_Shutdown() != SECSuccess); +- _crypto_initialized = 0; +- } +- return rc; +-} +- +- diff --git a/rpm-filelist-bufferoverflow.diff b/rpm-filelist-bufferoverflow.diff deleted file mode 100644 index 47397c3..0000000 --- a/rpm-filelist-bufferoverflow.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- build/files.c -+++ build/files.c -@@ -2053,7 +2053,8 @@ static int processPackageFiles(Spec spec, Package pkg, - continue; - fileName = NULL; - /*@-nullpass@*/ /* LCL: buf is NULL ?!? */ -- strcpy(buf, s); -+ strncpy(buf, s, sizeof(buf)-1); -+ buf[sizeof(buf)-1] = '\0'; - /*@=nullpass@*/ - - /* Reset for a new line in %files */ diff --git a/rpm-python.spec b/rpm-python.spec index 964a2e9..7ce4675 100644 --- a/rpm-python.spec +++ b/rpm-python.spec @@ -1,5 +1,5 @@ # -# spec file for package rpm-python (Version 4.4.2.3) +# spec file for package rpm-python (Version 4.7.1) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -19,16 +19,18 @@ Name: rpm-python -BuildRequires: libbz2-devel libelf-devel libselinux-devel ncurses-devel python-devel xz-devel zlib-devel +BuildRequires: file-devel libbz2-devel libelf-devel libselinux-devel lua-devel ncurses-devel popt-devel python-devel xz-devel zlib-devel +#!BuildIgnore: rpmlint-Factory License: GPL v2 or later Group: System/Packages Summary: Python Bindings for Manipulating RPM Packages -Version: 4.4.2.3 -Release: 45 +Version: 4.7.1 +Release: 1 Requires: rpm = %{version} %py_requires Source99: rpm.spec %{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%_sourcedir/rpm.spec)} +%global with_python 1 %description The rpm-python package contains a module that permits applications diff --git a/rpm-shorten-changelog.diff b/rpm-shorten-changelog.diff index 9dacc09..434eaa8 100644 --- a/rpm-shorten-changelog.diff +++ b/rpm-shorten-changelog.diff @@ -2,8 +2,8 @@ Index: build/parseChangelog.c =================================================================== --- build/parseChangelog.c.orig +++ build/parseChangelog.c -@@ -167,6 +167,11 @@ static int addChangelog(Header h, String - return RPMERR_BADSPEC; +@@ -167,6 +167,11 @@ static rpmRC addChangelog(Header h, Stri + return RPMRC_FAIL; } + /* workaround old suse oddity */ @@ -18,9 +18,9 @@ Index: build/pack.c =================================================================== --- build/pack.c.orig +++ build/pack.c -@@ -751,6 +751,65 @@ static int_32 copyTags[] = { - 0 - }; +@@ -707,6 +707,64 @@ rpmRC checkPackages(char *pkgcheck) + return RPMRC_OK; + } +static void +trimChangelog(Header h) @@ -34,19 +34,19 @@ Index: build/pack.c + if (!oneshot) { + char *binarychangelogtrim = rpmExpand("%{?_binarychangelogtrim}", NULL); + oneshot = 1; -+ if (binarychangelogtrim && *binarychangelogtrim) { ++ if (binarychangelogtrim && *binarychangelogtrim) { + maxnum = atoi(binarychangelogtrim); + binarychangelogtrim = strchr(binarychangelogtrim, ','); + if (binarychangelogtrim) + binarychangelogtrim++; + } -+ if (binarychangelogtrim && *binarychangelogtrim) { ++ if (binarychangelogtrim && *binarychangelogtrim) { + cuttime = atoi(binarychangelogtrim); + binarychangelogtrim = strchr(binarychangelogtrim, ','); + if (binarychangelogtrim) + binarychangelogtrim++; + } -+ if (binarychangelogtrim && *binarychangelogtrim) { ++ if (binarychangelogtrim && *binarychangelogtrim) { + minnum = atoi(binarychangelogtrim); + binarychangelogtrim = strchr(binarychangelogtrim, ','); + } @@ -55,13 +55,13 @@ Index: build/pack.c + return; + } + if (!headerGetEntry(h, RPMTAG_CHANGELOGTIME, NULL, (void **) ×, &count)) -+ return; ++ return; + if ((!cuttime || count <= minnum) && (!maxnum || count <= maxnum)) { + return; + } + keep = count; + if (maxnum && keep > maxnum) -+ keep = maxnum; ++ keep = maxnum; + if (cuttime) { + for (i = 0; i < keep; i++) { + if (i >= minnum && times[i] < cuttime) @@ -80,15 +80,14 @@ Index: build/pack.c + free(texts); +} + -+ - /*@-boundswrite@*/ - int packageBinaries(Spec spec) + rpmRC packageBinaries(rpmSpec spec) { -@@ -760,6 +819,7 @@ int packageBinaries(Spec spec) - const char *errorString; + struct cpioSourceArchive_s csabuf; +@@ -716,6 +774,7 @@ rpmRC packageBinaries(rpmSpec spec) Package pkg; + char *pkglist = NULL; + trimChangelog(spec->packages->header); for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { - const char *fn; + char *fn; diff --git a/rpm.changes b/rpm.changes index 017efe1..a5089c8 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Wed Aug 26 14:39:44 CEST 2009 - mls@suse.de + +- set fuzz factor back to 2 for now + +------------------------------------------------------------------- +Mon Aug 24 15:06:57 CEST 2009 - mls@suse.de + +- update to rpm-4.7.1 + ------------------------------------------------------------------- Mon Jul 27 18:02:37 CEST 2009 - rguenther@suse.de diff --git a/rpm.spec b/rpm.spec index 09cecd5..7b2f6fd 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,5 +1,5 @@ # -# spec file for package rpm (Version 4.4.2.3) +# spec file for package rpm (Version 4.7.1) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -20,14 +20,15 @@ Name: rpm License: GPL v2 or later Group: System/Packages -BuildRequires: libbz2-devel libelf-devel libselinux-devel ncurses-devel xz-devel zlib-devel +BuildRequires: file-devel libbz2-devel libelf-devel libselinux-devel lua-devel ncurses-devel xz-devel zlib-devel +BuildRequires: popt-devel +#!BuildIgnore: rpmlint-Factory Provides: rpminst -%define popt_version 1.7 PreReq: %insserv_prereq %fillup_prereq permissions AutoReqProv: on Summary: The RPM Package Manager -Version: 4.4.2.3 -Release: 45 +Version: 4.7.1 +Release: 1 Source: rpm-%{version}.tar.bz2 Source1: RPM-HOWTO.tar.bz2 Source2: RPM-Tips.html.tar.bz2 @@ -37,11 +38,12 @@ Source6: symset-table Source8: rpmconfigcheck Source9: sysconfig.services-rpm Source10: beecrypt-4.1.2.tar.bz2 +Source11: rpm-4.4.2.3-db.tar.bz2 Patch1: beecrypt-4.1.2.diff Patch2: db.diff # quilt patches start here -Patch10: debugedit.diff -Patch11: findfplistexclude.diff +Patch10: rpm-beecrypt.diff +Patch11: debugedit.diff Patch12: localetag.diff Patch13: missingok.diff Patch14: nameversioncompare.diff @@ -50,60 +52,49 @@ Patch16: dbfsync.diff Patch17: dbrointerruptable.diff Patch18: diskspace.diff Patch19: extcond.diff -Patch20: globlstat.diff -Patch21: nodefattr.diff -Patch22: luaroot.diff -Patch23: refreshtestarch.diff -Patch24: rpmrctests.diff -Patch25: suspendlock.diff -Patch26: tagsbackport.diff -Patch27: waitlock.diff -Patch28: dbprivate.diff -Patch29: legacyprereq.diff -Patch30: weakdeps.diff -Patch31: autodeps.diff -Patch32: brp.diff -Patch33: brpcombress.diff -Patch34: checkfilesnoinfodir.diff -Patch35: finddebuginfo.diff -Patch36: findksyms.diff -Patch37: findlang.diff -Patch38: macrosin.diff -Patch39: modalias.diff -Patch40: platformin.diff -Patch41: rpmpopt.diff -Patch42: rpmrc.diff -Patch43: patchrpms.diff -Patch44: taggedfileindex.diff -Patch45: rpmqpack.diff -Patch46: convertdb1static.diff -Patch47: build.diff -Patch48: modalias-kernel_module.diff -Patch49: files.diff -Patch50: popt-to-lib.diff -Patch51: debugedit-comp-dir.diff -Patch52: perlprov.diff -Patch53: rpm-shorten-changelog.diff -Patch54: lzma-payload.diff -Patch55: lzma-payload-2.diff -Patch56: debugsource-package.diff -Patch57: whatrequires-doc.diff -Patch58: remove-brp-strips.diff -Patch59: requires-ge-macro.diff -Patch60: mimetype.diff -Patch61: debugedit-canon-fix.diff -Patch62: fingerprint.diff -Patch63: finddebuginfo-absolute-links.diff -Patch64: firmware.diff -Patch65: specfilemacro.diff -Patch66: rpm-filelist-bufferoverflow.diff -Patch67: modalias-encode.diff -Patch68: disttag-macro.diff -Patch69: buildidprov.diff -Patch70: xz.diff -Patch71: debugsubpkg.diff -Patch72: debuglink.diff -Patch73: elfflagreqprov.diff +Patch20: nodefattr.diff +Patch21: luaroot.diff +Patch22: refreshtestarch.diff +Patch23: rpmrctests.diff +Patch24: suspendlock.diff +Patch25: waitlock.diff +Patch26: dbprivate.diff +Patch27: weakdeps.diff +Patch28: autodeps.diff +Patch29: brp.diff +Patch30: brpcombress.diff +Patch31: checkfilesnoinfodir.diff +Patch32: finddebuginfo.diff +Patch33: findksyms.diff +Patch34: findlang.diff +Patch35: macrosin.diff +Patch36: modalias.diff +Patch37: platformin.diff +Patch38: rpmpopt.diff +Patch39: rpmrc.diff +Patch40: taggedfileindex.diff +Patch41: rpmqpack.diff +Patch42: convertdb1static.diff +Patch43: build.diff +Patch44: modalias-kernel_module.diff +Patch45: files.diff +Patch46: debugedit-comp-dir.diff +Patch47: perlprov.diff +Patch48: rpm-shorten-changelog.diff +Patch49: debugsource-package.diff +Patch50: whatrequires-doc.diff +Patch51: remove-brp-strips.diff +Patch52: requires-ge-macro.diff +Patch53: mimetype.diff +Patch54: debugedit-canon-fix.diff +Patch55: finddebuginfo-absolute-links.diff +Patch56: firmware.diff +Patch57: specfilemacro.diff +Patch58: modalias-encode.diff +Patch59: disttag-macro.diff +Patch60: buildidprov.diff +Patch61: debugsubpkg.diff +Patch62: debuglink.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # # avoid bootstrapping problem @@ -141,27 +132,6 @@ need an intimate knowledge of RPM packages in order to function. -Authors: --------- - Erik Troan - Marc Ewing - -%package devel-static -Summary: Include Files and Libraries mandatory for Development -License: GPL v2 or later -Group: System/Packages -Requires: rpm-devel = %{version} -Requires: zlib-devel bzip2 libbz2-devel xz-devel libselinux-devel libebl-devel - -%description devel-static -This package contains the RPM C library and header files. These -development files will simplify the process of writing programs which -manipulate RPM packages and databases and are intended to make it -easier to create graphical package managers or any other tools that -need an intimate knowledge of RPM packages in order to function. - - - Authors: -------- Erik Troan @@ -172,30 +142,23 @@ Authors: rm -rf sqlite rm -rf beecrypt tar xjf %{SOURCE10} +tar xjf %{SOURCE11} ln -s beecrypt-4.1.2 beecrypt #tar xjf %{SOURCE12} #ln -s neon-0.24.7 neon # will get linked from db3 rm -f rpmdb/db.h -# separate popt source -# %setup -q -D -T -a 9 -# mv popt popt.orig -# ln -s popt-%{popt_version} popt %patch -P 1 -P 2 %patch -P 10 -P 11 -P 12 -P 13 -P 14 -P 15 -P 16 -P 17 -P 18 -P 19 %patch -P 20 -P 21 -P 22 -P 23 -P 24 -P 25 -P 26 -P 27 -P 28 -P 29 %patch -P 30 -P 31 -P 32 -P 33 -P 34 -P 35 -P 36 -P 37 -P 38 -P 39 %patch -P 40 -P 41 -P 42 -P 43 -P 44 -P 45 -P 46 -P 47 -P 48 -P 49 %patch -P 50 -P 51 -P 52 -P 53 -P 54 -P 55 -P 56 -P 57 -P 58 -P 59 -%patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69 -%patch -P 70 -%patch71 -p1 -%patch72 -p1 -%patch73 -p1 -chmod 755 scripts/find-supplements{,.ksyms} -chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms -chmod 755 scripts/firmware.prov -chmod 755 scripts/debuginfo.prov +%patch -P 60 -P 61 -P 62 +#chmod 755 scripts/find-supplements{,.ksyms} +#chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms +#chmod 755 scripts/firmware.prov +#chmod 755 scripts/debuginfo.prov tar -xjvf %{SOURCE1} tar -xjvf %{SOURCE2} if [ -s /etc/rpm/suse_macros ]; then @@ -204,30 +167,30 @@ fi cp -a %{SOURCE4} suse_macros %build -%{?suse_update_config:%{suse_update_config -f popt}} export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -ffunction-sections" export LDFLAGS="-Wl,-Bsymbolic-functions -ffunction-sections" %ifarch alpha export CFLAGS="-g -O0 -fno-strict-aliasing" %endif -#cp popt/autogen.sh zlib -rm -rf zlib cp /usr/share/gettext/config.rpath . -cp popt/autogen.sh beecrypt -cp popt/autogen.sh file -# cp popt/autogen.sh neon -./autogen.sh --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} --libdir=/usr/lib --sysconfdir=/etc --localstatedir=/var --with-lua --with-selinux --enable-shared +cp autogen.sh beecrypt +pushd beecrypt +./autogen.sh --with-pic +make %{?jobs:-j%jobs} +popd +./autogen.sh --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} --libdir=%{_libdir} --sysconfdir=/etc --localstatedir=/var --with-lua --with-selinux --with-internal-beecrypt --enable-shared %{?with_python: --enable-python} rm po/de.gmo make %{?jobs:-j%jobs} +make convertdb1 %install mkdir -p $RPM_BUILD_ROOT/usr/lib mkdir -p $RPM_BUILD_ROOT/usr/share/locale ln -s ../share/locale $RPM_BUILD_ROOT/usr/lib/locale make DESTDIR="$RPM_BUILD_ROOT" install +install -m 755 convertdb1 $RPM_BUILD_ROOT/usr/lib/rpm # remove .la file and the static variant of libpopt # have to remove the dependency from other .la files as well -rm -f $RPM_BUILD_ROOT/%_lib/libpopt.a $RPM_BUILD_ROOT/%_lib/libpopt.la for f in $RPM_BUILD_ROOT/%{_libdir}/*.la; do sed -i -e "s,/%_lib/libpopt.la,-lpopt,g" $f done @@ -236,10 +199,19 @@ install -m 755 %{SOURCE8} $RPM_BUILD_ROOT/etc/init.d mkdir -p $RPM_BUILD_ROOT/usr/sbin ln -sf ../../etc/init.d/rpmconfigcheck $RPM_BUILD_ROOT/usr/sbin/rcrpmconfigcheck cp -a suse_macros $RPM_BUILD_ROOT/usr/lib/rpm -mv $RPM_BUILD_ROOT/usr/src/* $RPM_BUILD_ROOT/usr/src/packages +mkdir -p $RPM_BUILD_ROOT/usr/lib/rpm/suse +ln -s ../suse_macros $RPM_BUILD_ROOT/usr/lib/rpm/suse/macros +for d in BUILD RPMS SOURCES SPECS SRPMS BUILDROOT ; do + mkdir -p $RPM_BUILD_ROOT/usr/src/packages/$d + chmod 1777 $RPM_BUILD_ROOT/usr/src/packages/$d +done +for d in $RPM_BUILD_ROOT/usr/lib/rpm/platform/*-linux/macros ; do + dd=${d%%-linux/macros} + dd=${dd##*/} + mkdir $RPM_BUILD_ROOT/usr/src/packages/RPMS/$dd + chmod 1777 $RPM_BUILD_ROOT/usr/src/packages/RPMS/$dd +done mkdir -p $RPM_BUILD_ROOT/var/lib/rpm -mkdir -p $RPM_BUILD_ROOT/var/spool/repackage -rm -rf $RPM_BUILD_ROOT/usr/include/beecrypt $RPM_BUILD_ROOT/%{_libdir}/libbeecrypt* gzip -9 $RPM_BUILD_ROOT/%{_mandir}/man[18]/*.[18] export RPM_BUILD_ROOT %ifarch s390x @@ -269,7 +241,7 @@ for f in rpm2cpio.sh rpm.daily rpmdiff* rpm.log rpm.xinetd freshen.sh u_pkg.sh \ brp-strip-static-archive vpkg-provides*.sh http.req sql.req tcl.req \ rpmdb_* brp-sparc64-linux brp-strip-comment-note brp-java-gcjcompile do - rm $f + rm -f $f done for i in /usr/share/automake-*/*; do if test -f "$i" && test -f "${i##*/}"; then @@ -279,8 +251,7 @@ done popd gzip -9 CHANGES rm -rf $RPM_BUILD_ROOT/%{_libdir}/python%{py_ver} -#rm $RPM_BUILD_ROOT%{_libdir}/*.la -#rm $RPM_BUILD_ROOT%{_libdir}/*.a +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la %clean rm -rf $RPM_BUILD_ROOT @@ -312,16 +283,18 @@ fi /etc/init.d/rpmconfigcheck /usr/sbin/rcrpmconfigcheck /usr/lib/rpm - %{_libdir}/librpm*-*.so + %{_libdir}/librpm.so.* + %{_libdir}/librpmbuild.so.* + %{_libdir}/librpmio.so.* %doc %{_mandir}/man[18]/*.[18]* /usr/share/locale/*/LC_MESSAGES/rpm.mo %dir /var/lib/rpm -%dir /var/spool/repackage %verify(not mode) %dir %attr(755,root,root) /usr/src/packages/BUILD %verify(not mode) %dir %attr(755,root,root) /usr/src/packages/SPECS %verify(not mode) %dir %attr(755,root,root) /usr/src/packages/SOURCES %verify(not mode) %dir %attr(755,root,root) /usr/src/packages/SRPMS %verify(not mode) %dir %attr(755,root,root) /usr/src/packages/RPMS +%verify(not mode) %dir %attr(755,root,root) /usr/src/packages/BUILDROOT %verify(not mode) %dir %attr(755,root,root) /usr/src/packages/RPMS/* /var/adm/fillup-templates/sysconfig.services-rpm @@ -330,84 +303,7 @@ fi /usr/include/rpm %{_libdir}/librpm.so %{_libdir}/librpmbuild.so - %{_libdir}/librpmdb.so %{_libdir}/librpmio.so - -%files devel-static -%defattr(644,root,root,755) - %{_libdir}/librpm*.a - %{_libdir}/librpm*.la - -%package -n popt -Summary: A C library for parsing command line parameters -License: LGPL v2.1 or later -Group: System/Libraries -Version: 1.7 -Release: 493 -# bug437293 -%ifarch ppc64 -Obsoletes: popt-64bit -%endif -# -# - -%description -n popt -Popt is a C library for parsing command line parameters. Popt was -heavily influenced by the getopt() and getopt_long() functions. It -improves on them by allowing more powerful argument expansion. Popt can -parse arbitrary argv[] style arrays and automatically set variables -based on command line arguments. Popt allows command line arguments to -be aliased via configuration files and includes utility functions for -parsing arbitrary strings into argv[] arrays using shell-like rules. - - - -Authors: --------- - Erik Troan - -%package -n popt-devel -Summary: C Library for Parsing Command Line Parameters -License: LGPL v2.1 or later -Group: System/Libraries -Version: 1.7 -Release: 493 -Requires: popt = 1.7 -Requires: glibc-devel -# bug437293 -%ifarch ppc64 -Obsoletes: popt-devel-64bit -%endif -# - -%description -n popt-devel -Popt is a C library for parsing command line parameters. Popt was -heavily influenced by the getopt() and getopt_long() functions, but it -improves on them by allowing more powerful argument expansion. Popt can -parse arbitrary argv[] style arrays and automatically set variables -based on command line arguments. Popt allows command line arguments to -be aliased via configuration files and includes utility functions for -parsing arbitrary strings into argv[] arrays using shell-like rules. - - - -Authors: --------- - Erik Troan - -%post -n popt -p /sbin/ldconfig - -%postun -n popt -p /sbin/ldconfig - -%files -n popt -%defattr(-,root,root) - /%{_lib}/libpopt.so.* - /usr/share/locale/*/LC_MESSAGES/popt.mo - -%files -n popt-devel -%defattr(644,root,root,755) - /usr/include/popt.h - /%{_lib}/libpopt.so -%doc %{_mandir}/man3/popt.3* + %{_libdir}/pkgconfig/rpm.pc %changelog diff --git a/rpmpopt.diff b/rpmpopt.diff index 9573bad..7809a60 100644 --- a/rpmpopt.diff +++ b/rpmpopt.diff @@ -6,7 +6,7 @@ Index: rpmpopt.in =================================================================== --- rpmpopt.in.orig +++ rpmpopt.in -@@ -94,7 +94,8 @@ Signature : %|DSAHEADER?{%{DSAHEADER:p +@@ -91,7 +91,8 @@ Signature : %|DSAHEADER?{%{DSAHEADER:p %|PACKAGER?{Packager : %{PACKAGER}\n}|\ %|URL?{URL : %{URL}\n}|\ Summary : %{SUMMARY}\n\ @@ -16,75 +16,3 @@ Index: rpmpopt.in --POPTdesc=$"list descriptive information from package(s)" rpm alias --changelog --qf '[* %{CHANGELOGTIME:day} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]' \ -@@ -140,12 +141,6 @@ rpm alias --fileprovide --qf '[%{FILENAM - rpm alias --filerequire --qf '[%{FILENAMES}\t%{FILEREQUIRE}\n]' \ - --POPTdesc=$"list file names with requires" - --rpm alias --redhatprovides -q --define '_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat' --whatprovides \ -- --POPTdesc=$"find package name that contains a provided capability (needs rpmdb-redhat package installed)" -- --rpm alias --redhatrequires -q --define '_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat' --whatrequires \ -- --POPTdesc=$"find package name that contains a required capability (needs rpmdb-redhat package installed)" -- - # colon separated i18n domains to use as PO catalogue lookaside for - * retrieving header group/description/summary. - # -@@ -212,22 +207,22 @@ rpm alias --timecheck --define '_timeche - #rpm exec --target rpmb --target - #rpm exec --short-circuit rpmb --short-circuit - --rpm exec --initdb rpmd --initdb --rpm exec --rebuilddb rpmd --rebuilddb --rpm exec --verifydb rpmd --verifydb -- --rpm exec --addsign rpmk --addsign --rpm exec -K rpmk -K --rpm exec --checksig rpmk --checksig --rpm exec --import rpmk --import --rpm exec --resign rpmk --resign -- --rpm exec -q rpmq -q --rpm exec --query rpmq --query --rpm exec --querytags rpmq --querytags --rpm exec -V rpmv -V --rpm exec -y rpmv -y --rpm exec --verify rpmv --verify -+#rpm exec --initdb rpmd --initdb -+#rpm exec --rebuilddb rpmd --rebuilddb -+#rpm exec --verifydb rpmd --verifydb -+ -+#rpm exec --addsign rpmk --addsign -+#rpm exec -K rpmk -K -+#rpm exec --checksig rpmk --checksig -+#rpm exec --import rpmk --import -+#rpm exec --resign rpmk --resign -+ -+#rpm exec -q rpmq -q -+#rpm exec --query rpmq --query -+#rpm exec --querytags rpmq --querytags -+#rpm exec -V rpmv -V -+#rpm exec -y rpmv -y -+#rpm exec --verify rpmv --verify - - #rpm exec -i rpmi -i - #rpm exec --install rpmi --install -@@ -393,7 +388,8 @@ Signature : %|DSAHEADER?{%{DSAHEADER:p - %|PACKAGER?{Packager : %{PACKAGER}\n}|\ - %|URL?{URL : %{URL}\n}|\ - Summary : %{SUMMARY}\n\ --Description :\n%{DESCRIPTION}\n' \ -+Description :\n%{DESCRIPTION}\n\ -+Distribution: %{DISTRIBUTION}\n' \ - --POPTdesc=$"list descriptive information from package(s)" - - rpmq alias --changelog --qf '[* %{CHANGELOGTIME:day} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]' \ -@@ -509,7 +505,8 @@ Size : %-27{SIZE}%|LICENSE?{ - %|PACKAGER?{Packager : %{PACKAGER}\n}|\ - %|URL?{URL : %{URL}\n}|\ - Summary : %{SUMMARY}\n\ --Description :\n%{DESCRIPTION}\n' \ -+Description :\n%{DESCRIPTION}\n\ -+Distribution: %{DISTRIBUTION}\n' \ - --POPTdesc=$"list descriptive information from package(s)" - - rpmquery alias --changelog --qf '[* %{CHANGELOGTIME:day} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]' \ diff --git a/rpmqpack.diff b/rpmqpack.diff index c7ed796..ff79989 100644 --- a/rpmqpack.diff +++ b/rpmqpack.diff @@ -5,49 +5,30 @@ Index: Makefile.am =================================================================== --- Makefile.am.orig +++ Makefile.am -@@ -41,7 +41,7 @@ rpmbin_PROGRAMS = rpm - bin_PROGRAMS = rpm2cpio +@@ -139,6 +139,10 @@ check_PROGRAMS += rpmsort + rpmsort_SOURCES = tools/rpmsort.c + rpmsort_LDADD = lib/librpm.la - pkglibdir = @RPMCONFIGDIR@ --pkglib_PROGRAMS = rpmb rpmd rpmi rpmk rpmq -+pkglib_PROGRAMS = rpmb rpmd rpmi rpmk rpmq rpmqpack - pkglib_DATA = rpmrc rpmpopt-$(VERSION) macros - pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \ - config.guess config.sub config.site -@@ -93,6 +93,12 @@ rpm2cpio_SOURCES = $(top_srcdir)/rpm2cpi - rpm2cpio_LDFLAGS = $(myLDFLAGS) - rpm2cpio_LDADD = $(myLDADD) @LIBMISC@ - -+rpmqpack_SOURCES = rpmqpack.c -+rpmqpack_LDFLAGS = $(myLDFLAGS) -+rpmqpack_LDADD = $(top_builddir)/rpmdb/librpmdb.la \ -+ $(top_builddir)/rpmio/librpmio.la \ -+ $(top_builddir)/popt/libpopt.la ++bin_PROGRAMS += rpmqpack ++rpmqpack_SOURCES = rpmqpack.c ++rpmqpack_LDADD = lib/librpm.la + - $(PROGRAMS): $(myLDADD) @WITH_APIDOCS_TARGET@ - - .PHONY: splint -@@ -138,6 +144,8 @@ install-data-local: - @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify - rm -f $(DESTDIR)$(bindir)/rpmsign - @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign -+ rm -f $(DESTDIR)$(bindir)/rpmqpack -+ @LN_S@ ../lib/rpm/rpmqpack $(DESTDIR)$(bindir)/rpmqpack - rm -f $(DESTDIR)$(bindir)/rpmdb ; \ - @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \ - for bf in e i u ; do \ + rpmconfig_DATA = rpmrc + rpmrc: $(top_srcdir)/rpmrc.in + @$(SED) \ Index: doc/Makefile.am =================================================================== --- doc/Makefile.am.orig +++ doc/Makefile.am -@@ -2,6 +2,6 @@ +@@ -7,7 +7,7 @@ man_man1_DATA = gendiff.1 + EXTRA_DIST += $(man_man1_DATA) - SUBDIRS = manual fr ja ko pl ru sk + man_man8dir = $(mandir)/man8 +-man_man8_DATA = rpm.8 rpmbuild.8 rpmdeps.8 rpmgraph.8 rpm2cpio.8 ++man_man8_DATA = rpm.8 rpmbuild.8 rpmdeps.8 rpmgraph.8 rpm2cpio.8 rpmqpack.8 + EXTRA_DIST += $(man_man8_DATA) --man_MANS = gendiff.1 rpm.8 rpmbuild.8 rpmcache.8 rpmdeps.8 rpmgraph.8 rpm2cpio.8 -+man_MANS = gendiff.1 rpm.8 rpmbuild.8 rpmcache.8 rpmdeps.8 rpmgraph.8 rpm2cpio.8 rpmqpack.8 - - EXTRA_DIST = $(man_MANS) + man_fr_man8dir = $(mandir)/fr/man8 Index: doc/rpmqpack.8 =================================================================== --- /dev/null diff --git a/rpmrc.diff b/rpmrc.diff index 4b6dedc..f2d5b84 100644 --- a/rpmrc.diff +++ b/rpmrc.diff @@ -4,17 +4,17 @@ Index: rpmrc.in =================================================================== --- rpmrc.in.orig +++ rpmrc.in -@@ -15,16 +15,16 @@ +@@ -12,16 +12,16 @@ # "fat" binary with both archs, for Darwin optflags: fat -O2 -g -arch i386 -arch ppc --optflags: i386 -O2 -g -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables --optflags: i486 -O2 -g -m32 -march=i486 -fasynchronous-unwind-tables --optflags: i586 -O2 -g -m32 -march=i586 -fasynchronous-unwind-tables --optflags: i686 -O2 -g -m32 -march=i686 -mtune=generic -fasynchronous-unwind-tables --optflags: pentium3 -O2 -g -m32 -march=pentium3 -mtune=generic -fasynchronous-unwind-tables --optflags: pentium4 -O2 -g -m32 -march=pentium4 -mtune=generic -fasynchronous-unwind-tables --optflags: athlon -O2 -g -m32 -march=athlon -fasynchronous-unwind-tables +-optflags: i386 -O2 -g -march=i386 -mtune=i686 +-optflags: i486 -O2 -g -march=i486 +-optflags: i586 -O2 -g -march=i586 +-optflags: i686 -O2 -g -march=i686 +-optflags: pentium3 -O2 -g -march=pentium3 +-optflags: pentium4 -O2 -g -march=pentium4 +-optflags: athlon -O2 -g -march=athlon +optflags: i386 -O2 -g -m32 -march=i486 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables +optflags: i486 -O2 -g -m32 -march=i486 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables +optflags: i586 -O2 -g -m32 -march=i586 -mtune=i686 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables @@ -22,25 +22,25 @@ Index: rpmrc.in +optflags: pentium3 -O2 -g -m32 -march=pentium3 +optflags: pentium4 -O2 -g -m32 -march=pentium4 +optflags: athlon -O2 -g -m32 -march=athlon - optflags: geode -Os -g -m32 -march=geode --optflags: ia64 -O2 -g -m64 -mtune=generic --optflags: x86_64 -O2 -g -m64 -mtune=generic + optflags: geode -Os -g -m32 -march=geode +-optflags: ia64 -O2 -g +-optflags: x86_64 -O2 -g +optflags: ia64 -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables +optflags: x86_64 -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables - optflags: amd64 -O2 -g -mtune=generic - optflags: ia32e -O2 -g -m64 -mtune=generic + optflags: amd64 -O2 -g + optflags: ia32e -O2 -g -@@ -44,15 +44,16 @@ optflags: sparc64v -O2 -g -m64 -march=ni +@@ -41,15 +41,16 @@ optflags: sparc64v -O2 -g -m64 -mtune=ni optflags: m68k -O2 -g -fomit-frame-pointer --optflags: ppc -O2 -g -m32 -fsigned-char --optflags: ppc8260 -O2 -g -m32 -fsigned-char --optflags: ppc8560 -O2 -g -m32 -fsigned-char --optflags: ppc32dy4 -O2 -g -m32 -fsigned-char --optflags: ppciseries -O2 -g -m32 -fsigned-char --optflags: ppcpseries -O2 -g -m32 -fsigned-char --optflags: ppc64 -O2 -g -m64 -fsigned-char +-optflags: ppc -O2 -g -fsigned-char +-optflags: ppc8260 -O2 -g -fsigned-char +-optflags: ppc8560 -O2 -g -fsigned-char +-optflags: ppc32dy4 -O2 -g -fsigned-char +-optflags: ppciseries -O2 -g -fsigned-char +-optflags: ppcpseries -O2 -g -fsigned-char +-optflags: ppc64 -O2 -g -fsigned-char +optflags: ppc -O2 -g -m32 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables +optflags: ppc8260 -O2 -g -m32 +optflags: ppc8560 -O2 -g -m32 @@ -54,18 +54,18 @@ Index: rpmrc.in optflags: hppa1.0 -O2 -g -mpa-risc-1-0 optflags: hppa1.1 -O2 -g -mpa-risc-1-0 optflags: hppa1.2 -O2 -g -mpa-risc-1-0 -@@ -77,8 +78,8 @@ optflags: atariclone -O2 -g -fomit-frame +@@ -75,8 +76,8 @@ optflags: atariclone -O2 -g -fomit-frame optflags: milan -O2 -g -fomit-frame-pointer optflags: hades -O2 -g -fomit-frame-pointer --optflags: s390 -O2 -g -m31 --optflags: s390x -O2 -g -m64 +-optflags: s390 -O2 -g +-optflags: s390x -O2 -g +optflags: s390 -O2 -g -m31 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables +optflags: s390x -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables optflags: sh3 -O2 -g - optflags: sh4 -O2 -g -@@ -201,17 +202,17 @@ os_canon: MacOSX: macosx 21 + optflags: sh4 -O2 -g -mieee +@@ -200,17 +201,17 @@ os_canon: MacOSX: macosx 21 ############################################################# # For a given uname().machine, the default build arch @@ -91,7 +91,7 @@ Index: rpmrc.in buildarchtranslate: i486: i386 buildarchtranslate: i386: i386 -@@ -240,6 +241,7 @@ buildarchtranslate: ppciseries: ppc +@@ -239,6 +240,7 @@ buildarchtranslate: ppciseries: ppc buildarchtranslate: ppcpseries: ppc buildarchtranslate: ppc64iseries: ppc64 buildarchtranslate: ppc64pseries: ppc64 @@ -115,17 +115,19 @@ Index: rpmrc.in ############################################################# # Architecture compatibility -@@ -326,12 +337,16 @@ arch_compat: hppa2.0: hppa1.2 +@@ -325,14 +336,18 @@ arch_compat: mipsel: noarch + arch_compat: hppa2.0: hppa1.2 arch_compat: hppa1.2: hppa1.1 arch_compat: hppa1.1: hppa1.0 - arch_compat: hppa1.0: parisc --arch_compat: parisc: noarch +-arch_compat: hppa1.0: parisc +arch_compat: hppa1.0: hppa -+arch_compat: hppa: noarch ++arch_compat: hppa: parisc + arch_compat: parisc: noarch +arch_compat: armv5teb: armv5b +arch_compat: armv5b: armv4b arch_compat: armv4b: noarch + arch_compat: armv7l: armv6l arch_compat: armv6l: armv5tejl arch_compat: armv5tejl: armv5tel -arch_compat: armv5tel: armv4tl @@ -134,7 +136,7 @@ Index: rpmrc.in arch_compat: armv4tl: armv4l arch_compat: armv4l: armv3l arch_compat: armv3l: noarch -@@ -348,9 +363,9 @@ arch_compat: i370: noarch +@@ -349,9 +364,9 @@ arch_compat: i370: noarch arch_compat: s390: noarch arch_compat: s390x: s390 noarch @@ -146,21 +148,7 @@ Index: rpmrc.in arch_compat: amd64: x86_64 athlon noarch arch_compat: ia32e: x86_64 athlon noarch -@@ -431,10 +446,12 @@ buildarch_compat: ppc64iseries: ppc64 - buildarch_compat: mips: noarch - buildarch_compat: mipsel: noarch - -+buildarch_compat: armv5b: noarch - buildarch_compat: armv4b: noarch - buildarch_compat: armv6l: armv5tejl - buildarch_compat: armv5tejl: armv5tel --buildarch_compat: armv5tel: armv4tl -+buildarch_compat: armv5tel: armv5l -+buildarch_compat: armv5l: armv4tl - buildarch_compat: armv4tl: armv4l - buildarch_compat: armv4l: armv3l - buildarch_compat: armv3l: noarch -@@ -442,7 +459,8 @@ buildarch_compat: armv3l: noarch +@@ -444,7 +459,8 @@ buildarch_compat: armv3l: noarch buildarch_compat: hppa2.0: hppa1.2 buildarch_compat: hppa1.2: hppa1.1 buildarch_compat: hppa1.1: hppa1.0 @@ -170,12 +158,3 @@ Index: rpmrc.in buildarch_compat: parisc: noarch buildarch_compat: atarist: m68kmint noarch -@@ -466,7 +484,7 @@ buildarch_compat: sh3: noarch - buildarch_compat: sh4: noarch - buildarch_compat: sh4a: sh4 - --macrofiles: @RPMCONFIGDIR@/macros:@RPMCONFIGDIR@/%{_target}/macros:@SYSCONFIGDIR@/macros.*:@SYSCONFIGDIR@/macros:@SYSCONFIGDIR@/%{_target}/macros:~/.rpmmacros -+macrofiles: @RPMCONFIGDIR@/macros:@RPMCONFIGDIR@/%{_target}/macros:@RPMCONFIGDIR@/suse_macros:@SYSCONFIGDIR@/macros.*:@SYSCONFIGDIR@/macros:@SYSCONFIGDIR@/%{_target}/macros:~/.rpmmacros - - # \endverbatim - #*/ diff --git a/rpmrctests.diff b/rpmrctests.diff index 9566317..4045e56 100644 --- a/rpmrctests.diff +++ b/rpmrctests.diff @@ -4,7 +4,7 @@ Index: lib/rpmrc.c =================================================================== --- lib/rpmrc.c.orig +++ lib/rpmrc.c -@@ -2,9 +2,6 @@ +@@ -1,9 +1,6 @@ #include "system.h" #include @@ -14,7 +14,7 @@ Index: lib/rpmrc.c #include /* XXX for /etc/rpm/platform contents */ -@@ -975,6 +972,14 @@ static inline int RPMClass(void) +@@ -784,6 +781,14 @@ static inline int RPMClass(void) cpu = (tfms>>8)&15; @@ -29,7 +29,7 @@ Index: lib/rpmrc.c sigaction(SIGILL, &oldsa, NULL); if (cpu < 6) -@@ -1112,15 +1117,6 @@ static int is_geode() +@@ -920,15 +925,6 @@ static int is_geode() } #endif @@ -44,8 +44,8 @@ Index: lib/rpmrc.c - /** */ - static void defaultMachine(/*@out@*/ const char ** arch, -@@ -1255,6 +1251,11 @@ static void defaultMachine(/*@out@*/ con + static void defaultMachine(const char ** arch, +@@ -1055,6 +1051,11 @@ static void defaultMachine(const char ** /* big endian */ strcpy(un.machine, "mips"); # endif diff --git a/specfilemacro.diff b/specfilemacro.diff index cac5b0a..739e3cb 100644 --- a/specfilemacro.diff +++ b/specfilemacro.diff @@ -1,10 +1,12 @@ ---- build/parseSpec.c.orig 2008-11-27 11:41:51.000000000 +0100 -+++ build/parseSpec.c 2008-11-27 11:43:00.000000000 +0100 -@@ -475,6 +475,7 @@ - * /.././../usr/../bin//./sh (XXX FIXME: dots not handled yet) - */ +Index: build/parseSpec.c +=================================================================== +--- build/parseSpec.c.orig ++++ build/parseSpec.c +@@ -425,6 +425,7 @@ int parseSpec(rpmts ts, const char *spec + spec = newSpec(); + spec->specFile = rpmGetPath(specFile, NULL); + addMacro(spec->macros, "_specfile", NULL, spec->specFile, RMIL_SPEC); spec->fileStack = newOpenFileInfo(); spec->fileStack->fileName = xstrdup(spec->specFile); - if (buildRootURL) { + /* If buildRoot not specified, use default %{buildroot} */ diff --git a/suspendlock.diff b/suspendlock.diff index 06a5eac..5b5f015 100644 --- a/suspendlock.diff +++ b/suspendlock.diff @@ -9,29 +9,29 @@ Index: lib/psm.c =================================================================== --- lib/psm.c.orig +++ lib/psm.c -@@ -813,6 +813,8 @@ static rpmRC runScript(rpmpsm psm, Heade +@@ -756,6 +756,8 @@ static rpmRC runScript(rpmpsm psm, Heade + goto exit; } - if (out == NULL) return RPMRC_FAIL; /* XXX can't happen */ + rpmtsSuspendResumeDBLock(psm->ts, 0); + - /*@-branchstate@*/ xx = rpmsqFork(&psm->sq); if (psm->sq.child == 0) { -@@ -933,6 +935,8 @@ static rpmRC runScript(rpmpsm psm, Heade + rpmlog(RPMLOG_DEBUG, "%s: %s\texecv(%s) pid %d\n", +@@ -770,6 +772,8 @@ static rpmRC runScript(rpmpsm psm, Heade (void) psmWait(psm); + rpmtsSuspendResumeDBLock(psm->ts, 1); + - /* XXX filter order dependent multilib "other" arch helper error. */ - if (!(psm->sq.reaped >= 0 && !strcmp(argv[0], "/usr/sbin/glibc_post_upgrade") && WEXITSTATUS(psm->sq.status) == 110)) { if (psm->sq.reaped < 0) { + rpmlog(RPMLOG_ERR, _("%s scriptlet failed, waitpid(%d) rc %d: %s\n"), + sname, psm->sq.child, psm->sq.reaped, strerror(errno)); Index: lib/rpmts.c =================================================================== --- lib/rpmts.c.orig +++ lib/rpmts.c -@@ -190,6 +190,11 @@ int rpmtsOpenDB(rpmts ts, int dbmode) +@@ -108,6 +108,11 @@ int rpmtsOpenDB(rpmts ts, int dbmode) return rc; } @@ -47,31 +47,30 @@ Index: lib/rpmts.h =================================================================== --- lib/rpmts.h.orig +++ lib/rpmts.h -@@ -476,6 +476,10 @@ int rpmtsRebuildDB(rpmts ts) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; +@@ -472,6 +472,10 @@ rpmdb rpmtsGetRdb(rpmts ts); + */ + int rpmtsInitDSI(const rpmts ts); +int rpmtsSuspendResumeDBLock(rpmts ts, int mode) + /*@globals fileSystem @*/ + /*@modifies fileSystem @*/; + /** \ingroup rpmts - * Verify the database used by the transaction. + * Update disk space info for a file. * @param ts transaction set -Index: rpmdb/db3.c +Index: lib/backend/db3.c =================================================================== ---- rpmdb/db3.c.orig -+++ rpmdb/db3.c -@@ -458,6 +458,8 @@ errxit: +--- lib/backend/db3.c.orig ++++ lib/backend/db3.c +@@ -398,12 +398,18 @@ errxit: + return rc; } - /*@=moduncon@*/ +static int db3SuspendResumeLock(dbiIndex dbi, int mode); + static int db3sync(dbiIndex dbi, unsigned int flags) - /*@globals fileSystem @*/ - /*@modifies fileSystem @*/ -@@ -466,6 +468,10 @@ static int db3sync(dbiIndex dbi, unsigne + { + DB * db = dbi->dbi_db; int rc = 0; int _printit; @@ -82,8 +81,8 @@ Index: rpmdb/db3.c if (db != NULL) rc = db->sync(db, flags); /* XXX DB_INCOMPLETE is returned occaisionally with multiple access. */ -@@ -1412,6 +1418,50 @@ static int db3open(rpmdb rpmdb, rpmTag r - /*@=nullstate =compmempass@*/ +@@ -1122,6 +1128,50 @@ static int db3open(rpmdb rpmdb, rpmTag r + return rc; } +static int @@ -112,7 +111,7 @@ Index: rpmdb/db3.c + l.l_type = F_RDLCK; + rc = fcntl(fdno, F_SETLK, (void *) &l); + if (rc) -+ rpmMessage(RPMMESS_WARNING, _("could not suspend database lock\n")); ++ rpmlog(RPMLOG_WARNING, _("could not suspend database lock\n")); + } else { + for (tries = 0; tries < 2; tries++) { + memset(&l, 0, sizeof(l)); @@ -124,7 +123,7 @@ Index: rpmdb/db3.c + if (!rc) + break; + if (tries == 0) -+ rpmMessage(RPMMESS_WARNING, _("waiting to reestablish exclusive database lock\n")); ++ rpmlog(RPMLOG_WARNING, _("waiting to reestablish exclusive database lock\n")); + } + } + return rc; @@ -132,12 +131,12 @@ Index: rpmdb/db3.c + /** \ingroup db3 */ - /*@-exportheadervar@*/ -Index: rpmdb/rpmdb.c + RPM_GNUC_INTERNAL +Index: lib/rpmdb.c =================================================================== ---- rpmdb/rpmdb.c.orig -+++ rpmdb/rpmdb.c -@@ -945,6 +945,21 @@ int rpmdbSync(rpmdb db) +--- lib/rpmdb.c.orig ++++ lib/rpmdb.c +@@ -886,6 +886,21 @@ int rpmdbSync(rpmdb db) return rc; } @@ -156,6 +155,6 @@ Index: rpmdb/rpmdb.c + return rc; +} + - /*@-mods@*/ /* FIX: dbTemplate structure assignment */ - static /*@only@*/ /*@null@*/ - rpmdb newRpmdb(/*@kept@*/ /*@null@*/ const char * root, + /* FIX: dbTemplate structure assignment */ + static + rpmdb newRpmdb(const char * root, diff --git a/taggedfileindex.diff b/taggedfileindex.diff index 7c0fc20..b158377 100644 --- a/taggedfileindex.diff +++ b/taggedfileindex.diff @@ -1,12 +1,12 @@ The taggedfileindex patch. Speeds up database searches, but breaks -fingerprint semantics. Needs findfplistexclude.diff. +fingerprint semantics. rh#103204 -Index: rpmdb/rpmdb.c +Index: lib/rpmdb.c =================================================================== ---- rpmdb/rpmdb.c.orig -+++ rpmdb/rpmdb.c -@@ -1215,6 +1215,16 @@ int rpmdbVerify(const char * prefix) +--- lib/rpmdb.c.orig ++++ lib/rpmdb.c +@@ -1107,6 +1107,16 @@ int rpmdbVerify(const char * prefix) return rc; } @@ -23,9 +23,9 @@ Index: rpmdb/rpmdb.c /** * Find file matches in database. * @param db rpm database -@@ -1294,6 +1304,11 @@ if (key->size == 0) key->size++; /* XXX - if (rc == 0) - (void) dbt2set(dbi, data, &allMatches); +@@ -1169,6 +1179,11 @@ static int rpmdbFindByFile(rpmdb db, con + if (rc == 0) + (void) dbt2set(dbi, data, &allMatches); + /* strip off directory tags */ + if (allMatches != NULL) @@ -35,85 +35,153 @@ Index: rpmdb/rpmdb.c xx = dbiCclose(dbi, dbcursor, 0); dbcursor = NULL; } else -@@ -2411,7 +2426,7 @@ static void rpmdbSortIterator(/*@null@*/ +@@ -2172,7 +2187,7 @@ void rpmdbSortIterator(rpmdbMatchIterato } - /*@-bounds@*/ /* LCL: segfault */ --static int rpmdbGrowIterator(/*@null@*/ rpmdbMatchIterator mi, int fpNum, unsigned int exclude) -+static int rpmdbGrowIterator(/*@null@*/ rpmdbMatchIterator mi, int fpNum, unsigned int exclude, unsigned int tag) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/ + /* LCL: segfault */ +-static int rpmdbGrowIterator(rpmdbMatchIterator mi) ++static int rpmdbGrowIterator(rpmdbMatchIterator mi, unsigned int tag) { -@@ -2459,10 +2474,16 @@ static int rpmdbGrowIterator(/*@null@*/ - set = NULL; - (void) dbt2set(dbi, data, &set); + DBC * dbcursor; + DBT * key; +@@ -2222,6 +2237,27 @@ static int rpmdbGrowIterator(rpmdbMatchI + dbcursor = NULL; + #endif -- /* prune the set against exclude */ -+ /* prune the set against exclude and tag */ - for (i = j = 0; i < set->count; i++) { - if (exclude && set->recs[i].hdrNum == exclude) - continue; -+ if (set->recs[i].tagNum & 0x80000000) { -+ /* tagged entry */ -+ if ((set->recs[i].tagNum & 0xffff0000) != tag) -+ continue; -+ set->recs[i].tagNum &= 0x0000ffff; ++ if (tag) { ++ int i, j; ++ /* prune the set against the tag */ ++ for (i = j = 0; i < set->count; i++) { ++ if (set->recs[i].tagNum & 0x80000000) { ++ /* tagged entry */ ++ if ((set->recs[i].tagNum & 0xffff0000) != tag) ++ continue; ++ set->recs[i].tagNum &= 0x0000ffff; ++ } ++ if (i != j) ++ set->recs[j] = set->recs[i]; ++ j++; + } - if (i != j) - set->recs[j] = set->recs[i]; - j++; -@@ -2987,7 +3008,9 @@ DBT * data = alloca(sizeof(*data)); - HFD_t hfd = headerFreeData; - sigset_t signalMask; - const char ** baseNames; -- rpmTagType bnt; -+ const char ** dirNames; -+ int_32 * dirIndexes, *dirs; -+ rpmTagType bnt, dit, dnt; - int count = 0; - dbiIndex dbi; - int dbix; -@@ -3027,6 +3050,13 @@ memset(data, 0, sizeof(*data)); - */ - - xx = hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, &count); -+ xx = hge(h, RPMTAG_DIRINDEXES, &dit, (void **) &dirIndexes, NULL); -+ xx = hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); ++ set->count = j; ++ if (j == 0) { ++ set = dbiFreeIndexSet(set); ++ return DB_NOTFOUND; ++ } ++ } + -+ /* save dirIndexes, because expandFilelist may free it */ -+ dirs = alloca(count * sizeof(*dirs)); -+ for (xx = 0; xx < count; xx++) -+ dirs[xx] = dirIndexes[xx]; + if (mi->mi_set == NULL) { + mi->mi_set = set; + } else { +@@ -2403,7 +2439,15 @@ int rpmdbExtendIterator(rpmdbMatchIterat + { + mi->mi_key.data = (void *) keyp; + mi->mi_key.size = keylen ? keylen : strlen(keyp); +- return rpmdbGrowIterator(mi); ++ return rpmdbGrowIterator(mi, 0); ++} ++ ++int rpmdbExtendIteratorDirtag(rpmdbMatchIterator mi, ++ const void * keyp, size_t keylen, const char *dirname) ++{ ++ mi->mi_key.data = (void *) keyp; ++ mi->mi_key.size = keylen ? keylen : strlen(keyp); ++ return rpmdbGrowIterator(mi, dirname ? taghash(dirname) : 0); + } - if (_noDirTokens) - expandFilelist(h); -@@ -3240,6 +3270,11 @@ data->size = 0; + /* +@@ -2798,8 +2842,16 @@ int rpmdbAdd(rpmdb db, int iid, Header h + + if (hdrNum) + { ++ struct rpmtd_s dn, di; ++ const char ** dirNames; ++ uint32_t * dirIndexes; + dbiIndexItem rec = dbiIndexNewItem(hdrNum, 0); + ++ headerGet(h, RPMTAG_DIRNAMES, &dn, HEADERGET_MINMEM); ++ headerGet(h, RPMTAG_DIRINDEXES, &di, HEADERGET_MINMEM); ++ dirNames = dn.data; ++ dirIndexes = di.data; ++ + if (dbiTags.tags != NULL) + for (dbix = 0; dbix < dbiTags.max; dbix++) { + rpmTag rpmtag; +@@ -2891,6 +2943,10 @@ int rpmdbAdd(rpmdb db, int iid, Header h */ - rec->tagNum = i; - switch (dbi->dbi_rpmtag) { + i = rec->tagNum = rpmtdGetIndex(&tagdata); + switch (rpmtag) { + case RPMTAG_BASENAMES: -+ /* tag index entry with directory hash */ + if (i < 0x010000) -+ rec->tagNum |= taghash(dirNames[dirs[i]]); -+ /*@switchbreak@*/ break; - case RPMTAG_PUBKEYS: - /*@switchbreak@*/ break; - case RPMTAG_FILEMD5S: -@@ -3414,6 +3449,8 @@ if (key->size == 0) key->size++; /* XXX ++ rec->tagNum |= taghash(dirNames[dirIndexes[i]]); ++ break; + case RPMTAG_REQUIRENAME: { + /* Filter out install prerequisites. */ + rpm_flag_t *rflag = rpmtdNextUint32(&reqflags); +@@ -2976,6 +3032,9 @@ cont: + if (ret == 0) { + headerSetInstance(h, hdrNum); + } ++ ++ rpmtdFreeData(&dn); ++ rpmtdFreeData(&di); } exit: -+ dirIndexes = hfd(dirIndexes, dit); -+ dirNames = hfd(dirNames, dnt); - (void) unblockSignals(db, &signalMask); +Index: lib/rpmdb_internal.h +=================================================================== +--- lib/rpmdb_internal.h.orig ++++ lib/rpmdb_internal.h +@@ -540,6 +540,9 @@ unsigned int dbiIndexRecordFileNumber(db + int rpmdbExtendIterator(rpmdbMatchIterator mi, + const void * keyp, size_t keylen); - return ret; -@@ -3495,7 +3532,7 @@ if (key->size == 0) key->size++; /* XXX - if (!exclude && skipDir(fpList[i].entry->dirName)) - continue; ++int rpmdbExtendIteratorDirtag(rpmdbMatchIterator mi, ++ const void * keyp, size_t keylen, const char *); ++ + /** \ingroup rpmdb + * sort the iterator by (recnum, filenum) + * Return database iterator. +Index: lib/transaction.c +=================================================================== +--- lib/transaction.c.orig ++++ lib/transaction.c +@@ -609,9 +609,12 @@ rpmdbMatchIterator rpmFindBaseNamesInDB( + rpmdbMatchIterator mi; + int i, xx; + const char * baseName; ++ const char * dirName; -- xx = rpmdbGrowIterator(mi, i, exclude); -+ xx = rpmdbGrowIterator(mi, i, exclude, taghash(fpList[i].entry->dirName)); ++#if 0 + rpmStringSet baseNames = rpmStringSetCreate(fileCount, + hashFunctionString, strcmp, NULL); ++#endif + mi = rpmdbInitIterator(rpmtsGetRdb(ts), RPMTAG_BASENAMES, NULL, 0); + +@@ -629,18 +632,25 @@ rpmdbMatchIterator rpmFindBaseNamesInDB( + while ((i = rpmfiNext(fi)) >= 0) { + size_t keylen; + baseName = rpmfiBN(fi); ++ dirName = rpmfiDN(fi); ++#if 0 + if (rpmStringSetHasEntry(baseNames, baseName)) + continue; ++#endif + + keylen = strlen(baseName); + if (keylen == 0) + keylen++; /* XXX "/" fixup. */ +- xx = rpmdbExtendIterator(mi, baseName, keylen); ++ xx = rpmdbExtendIteratorDirtag(mi, baseName, keylen, dirName); ++#if 0 + rpmStringSetAddEntry(baseNames, baseName); ++#endif + } } + pi = rpmtsiFree(pi); ++#if 0 + rpmStringSetFree(baseNames); ++#endif + rpmdbSortIterator(mi); + /* iterator is now sorted by (recnum, filenum) */ diff --git a/tagsbackport.diff b/tagsbackport.diff deleted file mode 100644 index 6f95695..0000000 --- a/tagsbackport.diff +++ /dev/null @@ -1,37 +0,0 @@ -Backported some new tags and sense values. - -Index: lib/rpmlib.h -=================================================================== ---- lib/rpmlib.h.orig -+++ lib/rpmlib.h -@@ -447,7 +447,19 @@ typedef enum rpmTag_e { - RPMTAG_PRIORITY = 1162, /* i extension placeholder */ - RPMTAG_CVSID = 1163, /* s */ - #define RPMTAG_SVNID RPMTAG_CVSID /* s */ -+ RPMTAG_BLINKPKGID = 1164, /* s[] */ -+ RPMTAG_BLINKHDRID = 1165, /* s[] */ -+ RPMTAG_BLINKNEVRA = 1166, /* s[] */ -+ RPMTAG_FLINKPKGID = 1167, /* s[] */ -+ RPMTAG_FLINKHDRID = 1168, /* s[] */ -+ RPMTAG_FLINKNEVRA = 1169, /* s[] */ -+ RPMTAG_PACKAGEORIGIN = 1170, /* s */ - RPMTAG_TRIGGERPREIN = 1171, /*!< internal */ -+ RPMTAG_BUILDSUGGESTS = 1172, /*!< internal */ -+ RPMTAG_BUILDENHANCES = 1173, /*!< internal */ -+ RPMTAG_SCRIPTSTATES = 1174, /*!< i scriptlet exit codes */ -+ RPMTAG_SCRIPTMETRICS = 1175, /*!< i scriptlet execution times */ -+ RPMTAG_BUILDCPUCLOCK = 1176, /*!< i */ - - /*@-enummemuse@*/ - RPMTAG_FIRSTFREE_TAG /*!< internal */ -@@ -531,7 +543,9 @@ typedef enum rpmsenseFlags_e { - /*@=enummemuse@*/ - RPMSENSE_KEYRING = (1 << 26), - RPMSENSE_PATCHES = (1 << 27), -- RPMSENSE_CONFIG = (1 << 28) -+ RPMSENSE_CONFIG = (1 << 28), -+ RPMSENSE_PROBE = (1 << 29), -+ RPMSENSE_PACKAGE = (1 << 30) - } rpmsenseFlags; - - #define RPMSENSE_SENSEMASK 15 /* Mask to get senses, ie serial, */ diff --git a/waitlock.diff b/waitlock.diff index 0d3e932..d60a798 100644 --- a/waitlock.diff +++ b/waitlock.diff @@ -1,78 +1,75 @@ Fix global (DB_PRIVATE) lock code: fix recursion counter, retry failed lock operations for up to 3 minutes. -Index: rpmdb/db3.c +Index: lib/backend/db3.c =================================================================== ---- rpmdb/db3.c.orig -+++ rpmdb/db3.c -@@ -769,6 +769,8 @@ assert(db != NULL); +--- lib/backend/db3.c.orig ++++ lib/backend/db3.c +@@ -586,6 +586,8 @@ static int db3stat(dbiIndex dbi, unsigne + return rc; } - /*@=mustmod@*/ +static int _lockdbfd = 0; + - /*@-moduncon@*/ /* FIX: annotate db3 methods */ - static int db3close(/*@only@*/ dbiIndex dbi, /*@unused@*/ unsigned int flags) - /*@globals rpmGlobalMacroContext, h_errno, -@@ -828,6 +830,10 @@ static int db3close(/*@only@*/ dbiIndex + static int db3close(dbiIndex dbi, unsigned int flags) + { + rpmdb rpmdb = dbi->dbi_rpmdb; +@@ -632,6 +634,10 @@ static int db3close(dbiIndex dbi, unsign + rpmlog(RPMLOG_DEBUG, "closed db index %s/%s\n", + dbhome, (dbfile ? dbfile : rpmTagGetName(dbi->dbi_rpmtag))); - rpmMessage(RPMMESS_DEBUG, _("closed db index %s/%s\n"), - dbhome, (dbfile ? dbfile : tagName(dbi->dbi_rpmtag))); + if (dbi->dbi_lockdbfd && + !((dbi->dbi_ecflags & DB_CLIENT) && dbi->dbi_host) && + _lockdbfd) + _lockdbfd--; - } -@@ -1148,8 +1154,6 @@ static int db3open(rpmdb rpmdb, rpmTag r - prDbiOpenFlags(oflags, 0), dbi->dbi_mode); + if (rpmdb->db_dbenv != NULL && dbi->dbi_use_dbenv) { +@@ -899,8 +905,6 @@ static int db3open(rpmdb rpmdb, rpmTag r + } if (rc == 0) { - static int _lockdbfd = 0; - - /*@-moduncon@*/ /* FIX: annotate db3 methods */ rc = db_create(&db, dbenv, dbi->dbi_cflags); - /*@=moduncon@*/ -@@ -1366,6 +1370,7 @@ static int db3open(rpmdb rpmdb, rpmTag r + rc = cvtdberr(dbi, "db_create", rc, _debug); + if (rc == 0 && db != NULL) { +@@ -1082,6 +1086,7 @@ static int db3open(rpmdb rpmdb, rpmTag r if (!(db->fd(db, &fdno) == 0 && fdno >= 0)) { rc = 1; } else { + int tries; struct flock l; - /*@-boundswrite@*/ memset(&l, 0, sizeof(l)); -@@ -1377,24 +1382,40 @@ static int db3open(rpmdb rpmdb, rpmTag r - ? F_WRLCK : F_RDLCK; + l.l_whence = 0; +@@ -1091,24 +1096,40 @@ static int db3open(rpmdb rpmdb, rpmTag r + ? F_RDLCK : F_WRLCK; l.l_pid = 0; - rc = fcntl(fdno, F_SETLK, (void *) &l); - if (rc) { - /* Warning iff using non-private CDB locking. */ - rc = ((dbi->dbi_use_dbenv && -- (dbi->dbi_eflags & DB_INIT_CDB) && -- !(dbi->dbi_eflags & DB_PRIVATE)) -- ? 0 : 1); -- rpmError( (rc ? RPMERR_FLOCK : RPMWARN_FLOCK), -- _("cannot get %s lock on %s/%s\n"), -- ((dbi->dbi_mode & (O_RDWR|O_WRONLY)) -- ? _("exclusive") : _("shared")), -- dbhome, (dbfile ? dbfile : "")); -- } else if (dbfile) { -- rpmMessage(RPMMESS_DEBUG, -- _("locked db index %s/%s\n"), -- dbhome, dbfile); + for (tries = 0; ; tries++) { + rc = fcntl(fdno, F_SETLK, (void *) &l); + if (rc) { -+ /* Warning iff using non-private CDB locking. */ + rc = ((dbi->dbi_use_dbenv && -+ (dbi->dbi_eflags & DB_INIT_CDB) && -+ !(dbi->dbi_eflags & DB_PRIVATE)) + (dbi->dbi_eflags & DB_INIT_CDB) && + !(dbi->dbi_eflags & DB_PRIVATE)) +- ? 0 : 1); +- rpmlog( (rc ? RPMLOG_ERR : RPMLOG_WARNING), +- _("cannot get %s lock on %s/%s\n"), +- ((dbi->dbi_mode & O_ACCMODE) == O_RDONLY) +- ? _("shared") : _("exclusive"), +- dbhome, (dbfile ? dbfile : "")); +- } else if (dbfile) { +- rpmlog(RPMLOG_DEBUG, +- "locked db index %s/%s\n", +- dbhome, dbfile); + ? 0 : 1); + if (errno == EAGAIN && rc) { + struct timespec ts; + if (tries == 0) -+ rpmMessage(RPMMESS_WARNING, _("waiting for %s lock on %s/%s\n"), ((dbi->dbi_mode & (O_RDWR|O_WRONLY)) ? _("exclusive") : _("shared")), dbhome, (dbfile ? dbfile : "")); ++ rpmlog(RPMLOG_WARNING, _("waiting for %s lock on %s/%s\n"), ((dbi->dbi_mode & (O_RDWR|O_WRONLY)) ? _("exclusive") : _("shared")), dbhome, (dbfile ? dbfile : "")); + ts.tv_sec = (time_t)0; + ts.tv_nsec = 100000000; + if (tries < 10*60*3) { @@ -80,17 +77,18 @@ Index: rpmdb/db3.c + continue; + } + } -+ rpmError( (rc ? RPMERR_FLOCK : RPMWARN_FLOCK), ++ rpmlog( (rc ? RPMLOG_ERR : RPMLOG_WARNING), + _("cannot get %s lock on %s/%s\n"), -+ ((dbi->dbi_mode & (O_RDWR|O_WRONLY)) -+ ? _("exclusive") : _("shared")), ++ ((dbi->dbi_mode & O_ACCMODE) == O_RDONLY) ++ ? _("shared") : _("exclusive"), + dbhome, (dbfile ? dbfile : "")); + } else if (dbfile) { -+ rpmMessage(RPMMESS_DEBUG, -+ _("locked db index %s/%s\n"), ++ rpmlog(RPMLOG_DEBUG, ++ "locked db index %s/%s\n", + dbhome, dbfile); ++ break; + } -+ break; ++ } } + if (rc && dbi->dbi_use_dbenv) diff --git a/weakdeps.diff b/weakdeps.diff index ce52075..179f088 100644 --- a/weakdeps.diff +++ b/weakdeps.diff @@ -18,7 +18,7 @@ Index: build/parsePreamble.c =================================================================== --- build/parsePreamble.c.orig +++ build/parsePreamble.c -@@ -129,6 +129,8 @@ static struct tokenBits_s installScriptB +@@ -122,6 +122,8 @@ static struct tokenBits_s const installS { "post", RPMSENSE_SCRIPT_POST }, { "rpmlib", RPMSENSE_RPMLIB }, { "verify", RPMSENSE_SCRIPT_VERIFY }, @@ -27,7 +27,7 @@ Index: build/parsePreamble.c { NULL, 0 } }; -@@ -140,6 +142,8 @@ static struct tokenBits_s buildScriptBit +@@ -132,6 +134,8 @@ static const struct tokenBits_s const bu { "build", RPMSENSE_SCRIPT_BUILD }, { "install", RPMSENSE_SCRIPT_INSTALL }, { "clean", RPMSENSE_SCRIPT_CLEAN }, @@ -36,7 +36,7 @@ Index: build/parsePreamble.c { NULL, 0 } }; -@@ -692,6 +696,18 @@ static int handlePreambleTag(Spec spec, +@@ -637,6 +641,18 @@ static int handlePreambleTag(rpmSpec spe if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags))) return rc; break; @@ -55,10 +55,10 @@ Index: build/parsePreamble.c case RPMTAG_EXCLUDEARCH: case RPMTAG_EXCLUSIVEARCH: case RPMTAG_EXCLUDEOS: -@@ -783,6 +799,14 @@ static struct PreambleRec_s preambleList +@@ -734,6 +750,14 @@ static struct PreambleRec_s preambleList + {RPMTAG_AUTOPROV, 0, 0, 0, "autoprov"}, + {RPMTAG_DOCDIR, 0, 0, 0, "docdir"}, {RPMTAG_DISTTAG, 0, 0, 0, "disttag"}, - {RPMTAG_CVSID, 0, 0, 0, "cvsid"}, - {RPMTAG_SVNID, 0, 0, 0, "svnid"}, + {RPMTAG_SUGGESTSFLAGS, 0, 0, 0, "recommends"}, + {RPMTAG_SUGGESTSFLAGS, 0, 0, 0, "suggests"}, + {RPMTAG_ENHANCESFLAGS, 0, 0, 0, "supplements"}, @@ -67,14 +67,14 @@ Index: build/parsePreamble.c + {RPMTAG_BUILDSUGGESTS, 0, 0, 0, "buildsuggests"}, + {RPMTAG_BUILDENHANCES, 0, 0, 0, "buildsupplements"}, + {RPMTAG_BUILDENHANCES, 0, 0, 0, "buildenhances"}, - /*@-nullassign@*/ /* LCL: can't add null annotation */ + /* LCL: can't add null annotation */ {0, 0, 0, 0, 0} - /*@=nullassign@*/ + }; Index: build/parseReqs.c =================================================================== --- build/parseReqs.c.orig +++ build/parseReqs.c -@@ -85,6 +85,14 @@ int parseRCPOT(Spec spec, Package pkg, c +@@ -84,6 +84,14 @@ rpmRC parseRCPOT(rpmSpec spec, Package p tagflags |= RPMSENSE_ANY; h = spec->buildRestrictions; break; @@ -93,7 +93,7 @@ Index: build/reqprov.c =================================================================== --- build/reqprov.c.orig +++ build/reqprov.c -@@ -48,6 +48,16 @@ int addReqProv(/*@unused@*/ Spec spec, H +@@ -43,6 +43,16 @@ int addReqProv(rpmSpec spec, Header h, r flagtag = RPMTAG_TRIGGERFLAGS; indextag = RPMTAG_TRIGGERINDEX; extra = Flags & RPMSENSE_TRIGGER; @@ -114,7 +114,7 @@ Index: build/rpmfc.c =================================================================== --- build/rpmfc.c.orig +++ build/rpmfc.c -@@ -1385,6 +1385,12 @@ static struct DepMsg_s depMsgs[] = { +@@ -1377,6 +1377,12 @@ static struct DepMsg_s depMsgs[] = { { "Obsoletes", { "%{?__find_obsoletes}", NULL, NULL, NULL }, RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OBSOLETEFLAGS, 0, -1 }, @@ -127,10 +127,10 @@ Index: build/rpmfc.c { NULL, { NULL, NULL, NULL, NULL }, 0, 0, 0, 0, 0 } }; -@@ -1480,6 +1486,14 @@ static int rpmfcGenerateDependsHelper(co +@@ -1467,6 +1473,14 @@ static int rpmfcGenerateDependsHelper(co failnonzero = 0; tagflags = RPMSENSE_FIND_REQUIRES; - /*@switchbreak@*/ break; + break; + case RPMTAG_ENHANCESFLAGS: + if (!pkg->autoProv) + continue; @@ -138,36 +138,15 @@ Index: build/rpmfc.c + tagflags = RPMSENSE_FIND_REQUIRES | RPMSENSE_MISSINGOK; + if (strcmp(dm->msg, "Supplements") == 0) + tagflags |= RPMSENSE_STRONG; -+ /*@switchbreak@*/ break; ++ break; default: continue; - /*@notreached@*/ /*@switchbreak@*/ break; -Index: lib/rpmlib.h -=================================================================== ---- lib/rpmlib.h.orig -+++ lib/rpmlib.h -@@ -541,7 +541,7 @@ typedef enum rpmsenseFlags_e { - RPMSENSE_TRIGGERPREIN = (1 << 25), /*!< @todo Implement %triggerprein. */ - /*@=enummemuse@*/ - RPMSENSE_KEYRING = (1 << 26), -- RPMSENSE_PATCHES = (1 << 27), -+ RPMSENSE_STRONG = (1 << 27), - RPMSENSE_CONFIG = (1 << 28), - RPMSENSE_PROBE = (1 << 29), - RPMSENSE_PACKAGE = (1 << 30) -@@ -562,6 +562,7 @@ typedef enum rpmsenseFlags_e { - RPMSENSE_SCRIPT_VERIFY | \ - RPMSENSE_FIND_REQUIRES | \ - RPMSENSE_MISSINGOK | \ -+ RPMSENSE_STRONG | \ - RPMSENSE_SCRIPT_PREP | \ - RPMSENSE_SCRIPT_BUILD | \ - RPMSENSE_SCRIPT_INSTALL | \ + break; Index: python/rpmmodule.c =================================================================== --- python/rpmmodule.c.orig +++ python/rpmmodule.c -@@ -433,7 +433,7 @@ void init_rpm(void) +@@ -387,7 +387,7 @@ void init_rpm(void) REGISTER_ENUM(RPMSENSE_RPMLIB); REGISTER_ENUM(RPMSENSE_TRIGGERPREIN); REGISTER_ENUM(RPMSENSE_KEYRING); @@ -180,23 +159,22 @@ Index: lib/rpmds.c =================================================================== --- lib/rpmds.c.orig +++ lib/rpmds.c -@@ -320,6 +320,11 @@ rpmds rpmdsNew(Header h, rpmTag tagN, in - tagEVR = RPMTAG_TRIGGERVERSION; - tagF = RPMTAG_TRIGGERFLAGS; - } else -+ if (tagN == RPMTAG_ENHANCESNAME) { -+ Type = "Enhances"; -+ tagEVR = RPMTAG_ENHANCESVERSION; -+ tagF = RPMTAG_ENHANCESFLAGS; -+ } else - goto exit; - - /*@-branchstate@*/ +@@ -73,6 +73,10 @@ static int dsType(rpmTag tag, + t = "Trigger"; + evr = RPMTAG_TRIGGERVERSION; + f = RPMTAG_TRIGGERFLAGS; ++ } else if (tag == RPMTAG_ENHANCESNAME) { ++ t = "Enhances"; ++ evr = RPMTAG_ENHANCESVERSION; ++ f = RPMTAG_ENHANCESFLAGS; + } else { + rc = 1; + } Index: rpmpopt.in =================================================================== --- rpmpopt.in.orig +++ rpmpopt.in -@@ -68,6 +68,22 @@ rpm alias --requires --qf \ +@@ -65,6 +65,22 @@ rpm alias --requires --qf \ --POPTdesc=$"list capabilities required by package(s)" rpm alias -R --requires @@ -219,100 +197,100 @@ Index: rpmpopt.in rpm alias --info --qf 'Name : %-27{NAME} Relocations: %|PREFIXES?{[%{PREFIXES} ]}:{(not relocatable)}|\n\ Version : %-27{VERSION} Vendor: %{VENDOR}\n\ Release : %-27{RELEASE} Build Date: %{BUILDTIME:date}\n\ -@@ -351,6 +367,22 @@ rpmq alias --requires --qf \ - --POPTdesc=$"list capabilities required by package(s)" - rpmq alias -R --requires - -+rpmq alias --suggests --qf \ -+ "[%|SUGGESTSFLAGS:depflag_strong?{}:{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \ -+ --POPTdesc=$"list capabilities this package suggests" -+ -+rpmq alias --recommends --qf \ -+ "[%|SUGGESTSFLAGS:depflag_strong?{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \ -+ --POPTdesc=$"list capabilities this package recommends" -+ -+rpmq alias --enhances --qf \ -+ "[%|ENHANCESFLAGS:depflag_strong?{}:{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \ -+ --POPTdesc=$"list capabilities this package enhances" -+ -+rpmq alias --supplements --qf \ -+ "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \ -+ --POPTdesc=$"list capabilities this package supplements" -+ - rpmq alias --info --qf 'Name : %-27{NAME} Relocations: %|PREFIXES?{[%{PREFIXES} ]}:{(not relocatable)}|\n\ - Version : %-27{VERSION} Vendor: %{VENDOR}\n\ - Release : %-27{RELEASE} Build Date: %{BUILDTIME:date}\n\ -@@ -452,6 +484,22 @@ rpmquery alias --requires --qf \ - --POPTdesc=$"list capabilities required by package(s)" - rpmquery alias -R --requires - -+rpmquery alias --suggests --qf \ -+ "[%|SUGGESTSFLAGS:depflag_strong?{}:{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \ -+ --POPTdesc=$"list capabilities this package suggests" -+ -+rpmquery alias --recommends --qf \ -+ "[%|SUGGESTSFLAGS:depflag_strong?{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \ -+ --POPTdesc=$"list capabilities this package recommends" -+ -+rpmquery alias --enhances --qf \ -+ "[%|ENHANCESFLAGS:depflag_strong?{}:{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \ -+ --POPTdesc=$"list capabilities this package enhances" -+ -+rpmquery alias --supplements --qf \ -+ "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \ -+ --POPTdesc=$"list capabilities this package supplements" -+ - rpmquery alias --info --qf 'Name : %-27{NAME} Relocations: %|PREFIXES?{[%{PREFIXES} ]}:{(not relocatable)}|\n\ - Version : %-27{VERSION} Vendor: %{VENDOR}\n\ - Release : %-27{RELEASE} Build Date: %{BUILDTIME:date}\n\ Index: lib/formats.c =================================================================== --- lib/formats.c.orig +++ lib/formats.c -@@ -652,6 +652,38 @@ static /*@only@*/ char * depflagsFormat( +@@ -601,6 +601,25 @@ static char * depflagsFormat(rpmtd td, c return val; } -+static /*@only@*/ char * depflag_strongFormat(int_32 type, const void * data, -+ char * formatPrefix, int padding, /*@unused@*/ int element) -+ /*@modifies formatPrefix @*/ -+ /*@requires maxRead(data) >= 0 @*/ ++static char * depflag_strongFormat(rpmtd td, char * formatPrefix) +{ -+ char * val; -+ char buf[10]; -+ int anint; ++ char * val = NULL; + -+ if (type != RPM_INT32_TYPE) { ++ if (rpmtdType(td) != RPM_NUMERIC_CLASS) { + val = xstrdup(_("(not a number)")); + } else { -+ anint = *((int_32 *) data); ++ uint64_t anint = rpmtdGetNumber(td); ++ char buf[10]; + buf[0] = '\0'; -+ -+/*@-boundswrite@*/ + if (anint & RPMSENSE_STRONG) + strcat(buf, "strong"); -+/*@=boundswrite@*/ -+ -+ val = xmalloc(7 + padding); -+/*@-boundswrite@*/ + strcat(formatPrefix, "s"); -+/*@=boundswrite@*/ -+ /*@-formatconst@*/ -+ sprintf(val, formatPrefix, buf); -+ /*@=formatconst@*/ ++ rasprintf(&val, formatPrefix, buf); + } + + return val; +} + /** - * Retrieve mounted file system paths. - * @param h header -@@ -1347,6 +1379,7 @@ const struct headerSprintfExtension_s rp - { HEADER_EXT_FORMAT, "base64", { base64Format } }, - { HEADER_EXT_FORMAT, "pgpsig", { pgpsigFormat } }, - { HEADER_EXT_FORMAT, "depflags", { depflagsFormat } }, -+ { HEADER_EXT_FORMAT, "depflag_strong", { depflag_strongFormat } }, - { HEADER_EXT_FORMAT, "fflags", { fflagsFormat } }, - { HEADER_EXT_FORMAT, "perms", { permsFormat } }, - { HEADER_EXT_FORMAT, "permissions", { permsFormat } }, + * Return tag container array size. + * @param td tag data container +@@ -661,5 +680,6 @@ static const struct headerFormatFunc_s r + { RPMTD_FORMAT_DAY, "day", dayFormat }, + { RPMTD_FORMAT_SHESCAPE, "shescape", shescapeFormat }, + { RPMTD_FORMAT_ARRAYSIZE, "arraysize", arraysizeFormat }, ++ { RPMTD_FORMAT_DEPFLAG_STRONG, "depflag_strong", { depflag_strongFormat } }, + { -1, NULL, NULL } + }; +Index: lib/rpmds.h +=================================================================== +--- lib/rpmds.h.orig ++++ lib/rpmds.h +@@ -55,7 +55,7 @@ typedef enum rpmsenseFlags_e { + RPMSENSE_RPMLIB = (1 << 24), /*!< rpmlib(feature) dependency. */ + RPMSENSE_TRIGGERPREIN = (1 << 25), /*!< %triggerprein dependency. */ + RPMSENSE_KEYRING = (1 << 26), +- RPMSENSE_PATCHES = (1 << 27), ++ RPMSENSE_STRONG = (1 << 27), + RPMSENSE_CONFIG = (1 << 28) + } rpmsenseFlags; + +@@ -74,6 +74,7 @@ typedef enum rpmsenseFlags_e { + RPMSENSE_SCRIPT_VERIFY | \ + RPMSENSE_FIND_REQUIRES | \ + RPMSENSE_MISSINGOK | \ ++ RPMSENSE_STRONG | \ + RPMSENSE_SCRIPT_PREP | \ + RPMSENSE_SCRIPT_BUILD | \ + RPMSENSE_SCRIPT_INSTALL | \ +Index: lib/rpmtd.h +=================================================================== +--- lib/rpmtd.h.orig ++++ lib/rpmtd.h +@@ -214,6 +214,7 @@ typedef enum rpmtdFormats_e { + RPMTD_FORMAT_SHESCAPE = 13, /* shell escaped (any type) */ + RPMTD_FORMAT_ARRAYSIZE = 14, /* size of contained array (any type) */ + RPMTD_FORMAT_DEPTYPE = 15, /* dependency types (int32 types) */ ++ RPMTD_FORMAT_DEPFLAG_STRONG = 16, /* strong dependency */ + } rpmtdFormats; + + /** \ingroup rpmtd +Index: lib/rpmtag.h +=================================================================== +--- lib/rpmtag.h.orig ++++ lib/rpmtag.h +@@ -228,14 +228,14 @@ typedef enum rpmTag_e { + RPMTAG_PRETRANSPROG = 1153, /* s */ + RPMTAG_POSTTRANSPROG = 1154, /* s */ + RPMTAG_DISTTAG = 1155, /* s */ +- RPMTAG_SUGGESTSNAME = 1156, /* s[] extension (unimplemented) */ +-#define RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME /* s[] (unimplemented) */ +- RPMTAG_SUGGESTSVERSION = 1157, /* s[] extension (unimplemented) */ +- RPMTAG_SUGGESTSFLAGS = 1158, /* i[] extension (unimplemented) */ +- RPMTAG_ENHANCESNAME = 1159, /* s[] extension placeholder (unimplemented) */ +-#define RPMTAG_ENHANCES RPMTAG_ENHANCESNAME /* s[] (unimplemented) */ +- RPMTAG_ENHANCESVERSION = 1160, /* s[] extension placeholder (unimplemented) */ +- RPMTAG_ENHANCESFLAGS = 1161, /* i[] extension placeholder (unimplemented) */ ++ RPMTAG_SUGGESTSNAME = 1156, /* s[] extension */ ++#define RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME /* s[] */ ++ RPMTAG_SUGGESTSVERSION = 1157, /* s[] extension */ ++ RPMTAG_SUGGESTSFLAGS = 1158, /* i[] extension */ ++ RPMTAG_ENHANCESNAME = 1159, /* s[] extension */ ++#define RPMTAG_ENHANCES RPMTAG_ENHANCESNAME /* s[] */ ++ RPMTAG_ENHANCESVERSION = 1160, /* s[] extension */ ++ RPMTAG_ENHANCESFLAGS = 1161, /* i[] extension */ + RPMTAG_PRIORITY = 1162, /* i[] extension placeholder (unimplemented) */ + RPMTAG_CVSID = 1163, /* s (unimplemented) */ + #define RPMTAG_SVNID RPMTAG_CVSID /* s (unimplemented) */ diff --git a/whatrequires-doc.diff b/whatrequires-doc.diff index 2ea6033..dff6c33 100644 --- a/whatrequires-doc.diff +++ b/whatrequires-doc.diff @@ -1,12 +1,14 @@ ---- doc/rpm.8.orig 2008-04-10 12:02:59.000000000 +0200 -+++ doc/rpm.8 2008-04-10 12:30:16.923076000 +0200 -@@ -584,6 +584,11 @@ +Index: doc/rpm.8 +=================================================================== +--- doc/rpm.8.orig ++++ doc/rpm.8 +@@ -572,6 +572,11 @@ Query all packages that provide the \fIC .TP \fB--whatrequires \fICAPABILITY\fB\fR - Query all packages that requires \fICAPABILITY\fR for proper functioning. + Query all packages that require \fICAPABILITY\fR for proper functioning. +.br +Note that this does not return what requires a given package. -+A package usually provides multiple capabilities and file-names on which ++A package usually provides multiple capabilities and file-names on which +other packages may depend. To see the complete dependencies +for a package, use \fB-e --test \fIPACKAGE_NAME\fB\fR .SS "PACKAGE QUERY OPTIONS:" diff --git a/xz.diff b/xz.diff deleted file mode 100644 index 092fc8f..0000000 --- a/xz.diff +++ /dev/null @@ -1,86 +0,0 @@ ---- - build/parsePrep.c | 3 +++ - configure.ac | 1 + - macros.in | 1 + - rpmio/macro.c | 8 ++++++++ - rpmio/rpmmacro.h | 3 ++- - 5 files changed, 15 insertions(+), 1 deletion(-) - -Index: build/parsePrep.c -=================================================================== ---- build/parsePrep.c.orig 2008-04-01 09:28:21.000000000 +0200 -+++ build/parsePrep.c 2009-02-19 10:49:23.000000000 +0100 -@@ -258,6 +258,9 @@ static char *doPatch(Spec spec, int c, i - case COMPRESSED_LZMA: - t = "%{__lzma} -dc"; - break; -+ case COMPRESSED_XZ: -+ t = "%{__xz} -dc"; -+ break; - } - zipper = rpmGetPath(t, NULL); - buf[0] = '\0'; -Index: configure.ac -=================================================================== ---- configure.ac.orig 2009-02-19 10:43:13.000000000 +0100 -+++ configure.ac 2009-02-19 10:50:25.000000000 +0100 -@@ -247,6 +247,7 @@ AC_SUBST(__ID_U) - - AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH) - AC_PATH_PROG(__LZMA, lzma, /usr/bin/lzma, $MYPATH) -+AC_PATH_PROG(__XZ, xz, /usr/bin/xz, $MYPATH) - AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH) - AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH) - AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH) -Index: macros.in -=================================================================== ---- macros.in.orig 2009-02-19 10:43:13.000000000 +0100 -+++ macros.in 2009-02-19 10:51:05.000000000 +0100 -@@ -49,6 +49,7 @@ - %__install @__INSTALL@ - %__ln_s @LN_S@ - %__lzma @__LZMA@ -+%__xz @__XZ@ - %__make @__MAKE@ - %__mkdir @__MKDIR@ - %__mkdir_p @MKDIR_P@ -Index: rpmio/macro.c -=================================================================== ---- rpmio/macro.c.orig 2008-04-01 09:29:13.000000000 +0200 -+++ rpmio/macro.c 2009-02-19 10:47:57.000000000 +0100 -@@ -1184,6 +1184,9 @@ doFoo(MacroBuf mb, int negate, const cha - case COMPRESSED_LZMA: - sprintf(be, "%%_lzma -dc %s", b); - break; -+ case COMPRESSED_XZ: -+ sprintf(be, "%%_xz -dc %s", b); -+ break; - } - b = be; - } else if (STREQ("S", f, fn)) { -@@ -2120,6 +2123,11 @@ int isCompressed(const char * file, rpmC - (magic[4] == 0x41) && (magic[5] == 0x00)) { - /* new style lzma with magic */ - *compressed = COMPRESSED_LZMA; -+ } else if ((magic[0] == 0xfd) && (magic[1] == 0x37) && -+ (magic[2] == 0x7a) && (magic[3] == 0x58) && -+ (magic[4] == 0x5a) && (magic[5] == 0x00)) { -+ /* xz */ -+ *compressed = COMPRESSED_XZ; - } else if (((magic[0] == 0037) && (magic[1] == 0213)) || /* gzip */ - ((magic[0] == 0037) && (magic[1] == 0236)) || /* old gzip */ - ((magic[0] == 0037) && (magic[1] == 0036)) || /* pack */ -Index: rpmio/rpmmacro.h -=================================================================== ---- rpmio/rpmmacro.h.orig 2008-04-01 09:28:22.000000000 +0200 -+++ rpmio/rpmmacro.h 2009-02-19 10:48:39.000000000 +0100 -@@ -176,7 +176,8 @@ typedef enum rpmCompressedMagic_e { - COMPRESSED_OTHER = 1, /*!< gzip can handle */ - COMPRESSED_BZIP2 = 2, /*!< bzip2 can handle */ - COMPRESSED_ZIP = 3, /*!< unzip can handle */ -- COMPRESSED_LZMA = 4 /*!< lzma can handle */ -+ COMPRESSED_LZMA = 4, /*!< lzma can handle */ -+ COMPRESSED_XZ = 5 /*!< xz can handle */ - } rpmCompressedMagic; - - /**