From 02bfd7404afee3e3918cf12b4e3892b91477aff6a25383bb920877e082a6cdda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Schr=C3=B6der?= Date: Wed, 24 Feb 2010 10:58:45 +0000 Subject: [PATCH 1/8] - fix readLine segfault [bnc#582599] OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=38 --- readlineofi.diff | 10 ++++++++++ rpm.changes | 5 +++++ rpm.spec | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 readlineofi.diff diff --git a/readlineofi.diff b/readlineofi.diff new file mode 100644 index 0000000..d4123d1 --- /dev/null +++ b/readlineofi.diff @@ -0,0 +1,10 @@ +--- build/parseSpec.c.orig 2010-02-15 11:49:29.000000000 +0000 ++++ build/parseSpec.c 2010-02-24 10:38:25.000000000 +0000 +@@ -283,6 +283,7 @@ int readLine(rpmSpec spec, int strip) + retry: + if ((rc = readLineFromOFI(spec, ofi)) != 0) + return rc; ++ ofi = spec->fileStack; + + /* Copy next file line into the spec line buffer */ + rc = copyNextLineFromOFI(spec, ofi); diff --git a/rpm.changes b/rpm.changes index 3102d6a..e99a0f8 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Feb 24 11:57:30 CET 2010 - mls@suse.de + +- fix readLine segfault [bnc#582599] + ------------------------------------------------------------------- Sat Dec 12 23:42:26 CET 2009 - jengelh@medozas.de diff --git a/rpm.spec b/rpm.spec index 2f23318..c58f039 100644 --- a/rpm.spec +++ b/rpm.spec @@ -102,6 +102,7 @@ Patch65: fixabsfilelists.diff Patch66: fixqueryreturn.diff Patch67: lazystatfs.diff Patch68: defclean.diff +Patch69: readlineofi.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # # avoid bootstrapping problem @@ -161,7 +162,7 @@ rm -f rpmdb/db.h %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 +%patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69 #chmod 755 scripts/find-supplements{,.ksyms} #chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms #chmod 755 scripts/firmware.prov From 3de0fb748381c386e86ec9e6f825d67b08782a8c4065ee7505ca00307226c62d Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Thu, 25 Feb 2010 10:12:29 +0000 Subject: [PATCH 2/8] checked in (request 33357) OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=39 --- readlineofi.diff | 10 ---------- rpm.changes | 5 ----- rpm.spec | 3 +-- 3 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 readlineofi.diff diff --git a/readlineofi.diff b/readlineofi.diff deleted file mode 100644 index d4123d1..0000000 --- a/readlineofi.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- build/parseSpec.c.orig 2010-02-15 11:49:29.000000000 +0000 -+++ build/parseSpec.c 2010-02-24 10:38:25.000000000 +0000 -@@ -283,6 +283,7 @@ int readLine(rpmSpec spec, int strip) - retry: - if ((rc = readLineFromOFI(spec, ofi)) != 0) - return rc; -+ ofi = spec->fileStack; - - /* Copy next file line into the spec line buffer */ - rc = copyNextLineFromOFI(spec, ofi); diff --git a/rpm.changes b/rpm.changes index e99a0f8..3102d6a 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,8 +1,3 @@ -------------------------------------------------------------------- -Wed Feb 24 11:57:30 CET 2010 - mls@suse.de - -- fix readLine segfault [bnc#582599] - ------------------------------------------------------------------- Sat Dec 12 23:42:26 CET 2009 - jengelh@medozas.de diff --git a/rpm.spec b/rpm.spec index c58f039..2f23318 100644 --- a/rpm.spec +++ b/rpm.spec @@ -102,7 +102,6 @@ Patch65: fixabsfilelists.diff Patch66: fixqueryreturn.diff Patch67: lazystatfs.diff Patch68: defclean.diff -Patch69: readlineofi.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # # avoid bootstrapping problem @@ -162,7 +161,7 @@ rm -f rpmdb/db.h %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 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 #chmod 755 scripts/find-supplements{,.ksyms} #chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms #chmod 755 scripts/firmware.prov From a6846b83caef49c6f0db910700673d37d50561e803138d6db70e140b46321b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Schr=C3=B6der?= Date: Fri, 26 Mar 2010 10:56:28 +0000 Subject: [PATCH 3/8] - update to rpm-4.8.0 * updated python bindings * new transaction ordering code OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=40 --- allowufdio.diff | 18 +- brpcombress.diff | 36 ++- build.diff | 47 +-- dbfsync.diff | 24 +- debugsubpkg.diff | 31 +- defclean.diff | 10 +- diskspace.diff | 29 +- disttag-macro.diff | 20 +- findksyms.diff | 55 ++-- fixabsfilelists.diff | 21 -- fixqueryreturn.diff | 13 - lazystatfs.diff | 496 +++++++++++++++---------------- localetag.diff | 51 ++-- luaroot.diff | 34 +-- macrosin.diff | 32 +- missingok.diff | 27 +- modemuncher.diff | 16 + nameversioncompare.diff | 18 +- readlineofi.diff | 10 + ready | 0 rpm-4.8.0.tar.bz2 | 3 + rpm-beecrypt.diff | 640 +++++++++++++++++----------------------- rpm-python.spec | 2 +- rpm.changes | 12 + rpm.spec | 19 +- rpmdb-no-svc.diff | 19 ++ suspendlock.diff | 125 ++++---- taggedfileindex.diff | 46 ++- waitlock.diff | 51 ++-- weakdeps.diff | 221 +++++++------- 30 files changed, 960 insertions(+), 1166 deletions(-) delete mode 100644 fixabsfilelists.diff delete mode 100644 fixqueryreturn.diff create mode 100644 modemuncher.diff create mode 100644 readlineofi.diff delete mode 100644 ready create mode 100644 rpm-4.8.0.tar.bz2 create mode 100644 rpmdb-no-svc.diff diff --git a/allowufdio.diff b/allowufdio.diff index 471ecc1..57b0c3b 100644 --- a/allowufdio.diff +++ b/allowufdio.diff @@ -1,19 +1,17 @@ -Index: build/pack.c -=================================================================== ---- build/pack.c.orig -+++ build/pack.c -@@ -379,7 +379,9 @@ rpmRC writeRPM(Header *hdrp, unsigned ch +--- ./build/pack.c.orig 2010-03-25 15:18:23.000000000 +0000 ++++ ./build/pack.c 2010-03-25 15:23:54.000000000 +0000 +@@ -375,7 +375,9 @@ rpmRC writeRPM(Header *hdrp, unsigned ch const char *compr = NULL; headerPutString(h, RPMTAG_PAYLOADFORMAT, "cpio"); -- if (strcmp(s+1, "gzdio") == 0) { -+ if (strcmp(s+1, "ufdio") == 0) { +- if (rstreq(s+1, "gzdio")) { ++ if (rstreq(s+1, "ufdio")) { + compr = NULL; -+ } else if (strcmp(s+1, "gzdio") == 0) { ++ } else if (rstreq(s+1, "gzdio")) { compr = "gzip"; #if HAVE_BZLIB_H - } else if (strcmp(s+1, "bzdio") == 0) { -@@ -402,7 +404,8 @@ rpmRC writeRPM(Header *hdrp, unsigned ch + } else if (rstreq(s+1, "bzdio")) { +@@ -398,7 +400,8 @@ rpmRC writeRPM(Header *hdrp, unsigned ch goto exit; } diff --git a/brpcombress.diff b/brpcombress.diff index f46c29b..c879014 100644 --- a/brpcombress.diff +++ b/brpcombress.diff @@ -1,8 +1,11 @@ -make brp-compress deal correctly with hardlinked man pages - ---- ./scripts/brp-compress.orig 2004-10-17 18:49:52.000000000 +0000 -+++ ./scripts/brp-compress 2005-12-15 14:03:58.000000000 +0000 -@@ -5,12 +5,38 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD +--- ./scripts/brp-compress.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./scripts/brp-compress 2010-03-25 15:11:29.000000000 +0000 +@@ -1,16 +1,43 @@ +-#!/bin/sh ++#!/bin/bash + + # If using normal root, avoid changing anything. + if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then exit 0 fi @@ -20,7 +23,6 @@ make brp-compress deal correctly with hardlinked man pages +{ + dir=$1 + b=$2 -+ type=$3 + + inode=`ls -i $b | awk '{ print $1 }'` + others=`find $dir -type f -inum $inode` @@ -28,11 +30,13 @@ make brp-compress deal correctly with hardlinked man pages + [ "$afile" != "$b" ] && rm -f $afile + done + -+ case $type in -+ Z|gz) gunzip $b ;; -+ bz2) bunzip2 $b ;; ++ case $b in ++ *.Z|*.gz) gunzip $b ;; ++ *.bz2) bunzip2 $b ;; ++ *.xz|*.lzma) unxz $b ;; + esac + ++ type=${b##*.} + for afile in $others ; do + [ "${afile%.$type}" != "${b%.$type}" ] && ln ${b%.$type} ${afile%.$type} + done @@ -41,16 +45,16 @@ make brp-compress deal correctly with hardlinked man pages for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \ ./usr/share/man/man* ./usr/share/man/*/man* ./usr/share/info \ ./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man* \ -@@ -23,9 +49,9 @@ do +@@ -23,9 +50,9 @@ do [ "`basename $f`" = "dir" ] && continue case "$f" in -- *.Z) gunzip $f; b=`echo $f | sed -e 's/\.Z$//'`;; -- *.gz) gunzip $f; b=`echo $f | sed -e 's/\.gz$//'`;; -- *.bz2) bunzip2 $f; b=`echo $f | sed -e 's/\.bz2$//'`;; -+ *.Z) gunzip $f || check_for_hard_link $d $f Z; b=`echo $f | sed -e 's/\.Z$//'`;; -+ *.gz) gunzip $f || check_for_hard_link $d $f gz; b=`echo $f | sed -e 's/\.gz$//'`;; -+ *.bz2) bunzip2 $f || check_for_hard_link $d $f bz2; b=`echo $f | sed -e 's/\.bz2$//'`;; +- *.gz|*.Z) gunzip $f; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;; +- *.bz2) bunzip2 $f; b=`echo $f | sed -e 's/\.bz2$//'`;; +- *.xz|*.lzma) unxz $f; b=`echo $f | sed -e 's/\.\(xz\|lzma\)$//'`;; ++ *.gz|*.Z) gunzip $f || check_for_hard_link $d $f; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;; ++ *.bz2) bunzip2 $f || check_for_hard_link $d $f; b=`echo $f | sed -e 's/\.bz2$//'`;; ++ *.xz|*.lzma) unxz $f || check_for_hard_link $d $f; b=`echo $f | sed -e 's/\.\(xz\|lzma\)$//'`;; *) b=$f;; esac diff --git a/build.diff b/build.diff index 7aa43dc..861aa1b 100644 --- a/build.diff +++ b/build.diff @@ -1,25 +1,9 @@ Many changes to Makefiles/autogen and the like to make it build on SUSE systems. ---- - autogen.sh | 16 +++-- - build/Makefile.am | 2 - configure.ac | 153 ++++++++++++++++++++++++++++++++------------------- - db3/configure | 6 +- - file/src/Makefile.am | 2 - installplatform | 9 ++- - lib/Makefile.am | 2 - popt/autogen.sh | 2 - rpmdb/Makefile.am | 4 - - rpmio/Makefile.am | 10 +-- - scripts/Makefile.am | 8 ++ - 11 files changed, 132 insertions(+), 82 deletions(-) - -Index: configure.ac -=================================================================== ---- configure.ac.orig -+++ configure.ac -@@ -1009,6 +1009,7 @@ arm*) RPMCANONCOLOR=0; RPMCANONARCH=arm +--- ./configure.ac.orig 2010-03-24 16:35:40.000000000 +0000 ++++ ./configure.ac 2010-03-25 15:16:21.000000000 +0000 +@@ -1006,6 +1006,7 @@ arm*) RPMCANONCOLOR=0; RPMCANONARCH=arm mipsel*) RPMCANONCOLOR=0; RPMCANONARCH=mipsel ;; mips*) RPMCANONCOLOR=0; RPMCANONARCH=mips ;; m68k*) RPMCANONCOLOR=0; RPMCANONARCH=m68k ;; @@ -27,7 +11,7 @@ Index: configure.ac sh3*) RPMCANONCOLOR=0; RPMCANONARCH=sh3 ;; sh4*) RPMCANONCOLOR=0; RPMCANONARCH=sh4 ;; *) RPMCANONCOLOR=0; RPMCANONARCH=unknown ;; -@@ -1019,6 +1020,7 @@ esac +@@ -1016,6 +1017,7 @@ esac RPMCANONVENDOR="$build_vendor" case "${build_vendor}" in unknown|pc|ibm|redhat|pld|mandrake|conectiva|lvr|yellowdog|caos|suse) @@ -35,7 +19,7 @@ Index: configure.ac test -f /etc/redhat-release && RPMCANONVENDOR=redhat test -f /etc/SuSE-release && RPMCANONVENDOR=suse test -f /etc/pld-release && RPMCANONVENDOR=pld -@@ -1031,6 +1033,9 @@ unknown|pc|ibm|redhat|pld|mandrake|conec +@@ -1028,6 +1030,9 @@ unknown|pc|ibm|redhat|pld|mandrake|conec esac RPMCANONOS="$host_os_noversion" RPMCANONGNU="$host_os_gnu" @@ -45,28 +29,23 @@ Index: configure.ac AC_SUBST(RPMCANONCOLOR) AC_SUBST(RPMCANONARCH) AC_SUBST(RPMCANONVENDOR) -Index: db3/configure -=================================================================== ---- db3/configure.orig -+++ db3/configure +--- ./db3/configure.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./db3/configure 2010-03-25 15:17:41.000000000 +0000 @@ -10,9 +10,9 @@ rm -f config.cache # XXX edit CFLAGS= ... out of invocation args ??? ARGS="`echo $* | sed -e 's% [^ ]*CFLAGS=[^ ]*%%' -e 's% -[^-][^ ]*%%g' -e 's% --param=[^ ]*%%g' -e 's%--cache-file=.*$%%'`" -CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure $ARGS \ -- --enable-shared --enable-static --enable-rpc \ -- --with-uniquename=_rpmdb --srcdir=$db_dist +CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure \ -+ --enable-shared --enable-static --enable-rpc \ + --enable-shared --enable-static \ +- --with-uniquename=_rpmdb --srcdir=$db_dist + --with-uniquename=_rpmdb --srcdir=$db_dist $ARGS mv Makefile Makefile.orig cat Makefile.orig | sed -e '/^install[:-]/c\ -Index: installplatform -=================================================================== ---- installplatform.orig -+++ installplatform -@@ -54,9 +54,9 @@ for SUBST in $SUBSTS ; do +--- ./installplatform.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./installplatform 2010-03-25 15:16:21.000000000 +0000 +@@ -47,9 +47,9 @@ for SUBST in $SUBSTS ; do ARCH_INSTALL_POST='%{nil}' case "${ARCH}-${OS}" in sparc64*-linux) LIB=lib64 ;; @@ -79,7 +58,7 @@ Index: installplatform *) LIB=lib;; esac -@@ -136,6 +136,9 @@ for SUBST in $SUBSTS ; do +@@ -129,6 +129,9 @@ for SUBST in $SUBSTS ; do apple) VENDORSED='-e s,^@apple@,,' ;; diff --git a/dbfsync.diff b/dbfsync.diff index 4c5c9c4..2326504 100644 --- a/dbfsync.diff +++ b/dbfsync.diff @@ -1,10 +1,8 @@ Support a database-local fsync setting. Needs berkeley db patch. -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 +--- ./lib/backend/db3.c.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./lib/backend/db3.c 2010-03-25 14:35:39.000000000 +0000 +@@ -62,10 +62,12 @@ static int db_fini(dbiIndex dbi, const c return rc; } @@ -17,9 +15,9 @@ Index: lib/backend/db3.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(???) */ +@@ -168,10 +170,12 @@ static int db_init(dbiIndex dbi, const c + xx = cvtdberr(dbi, "dbenv->set_cachesize", xx, _debug); + } +#if 0 if (dbi->dbi_no_fsync) { @@ -30,11 +28,9 @@ Index: lib/backend/db3.c if (dbi->dbi_shmkey) { xx = dbenv->set_shm_key(dbenv, dbi->dbi_shmkey); -Index: lib/backend/dbconfig.c -=================================================================== ---- lib/backend/dbconfig.c.orig -+++ lib/backend/dbconfig.c -@@ -94,6 +94,8 @@ struct poptOption rdbOptions[] = { +--- ./lib/backend/dbconfig.c.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./lib/backend/dbconfig.c 2010-03-25 14:35:39.000000000 +0000 +@@ -72,6 +72,8 @@ static const struct poptOption rdbOption NULL, NULL }, { "fcntl_locking",0,POPT_BIT_SET, &db3dbi.dbi_oflags, DB_FCNTL_LOCKING, NULL, NULL }, @@ -43,7 +39,7 @@ Index: lib/backend/dbconfig.c { "btree", 0,POPT_ARG_VAL, &db3dbi.dbi_type, DB_BTREE, NULL, NULL }, -@@ -140,8 +142,6 @@ struct poptOption rdbOptions[] = { +@@ -101,8 +103,6 @@ static const struct poptOption rdbOption NULL, NULL }, { "usedbenv", 0,POPT_ARG_NONE, &db3dbi.dbi_use_dbenv, 0, NULL, NULL }, diff --git a/debugsubpkg.diff b/debugsubpkg.diff index cab3e33..e6002df 100644 --- a/debugsubpkg.diff +++ b/debugsubpkg.diff @@ -1,7 +1,5 @@ -Index: build/files.c -=================================================================== ---- build/files.c.orig -+++ build/files.c +--- ./build/files.c.orig 2010-03-25 15:18:05.000000000 +0000 ++++ ./build/files.c 2010-03-25 15:21:26.000000000 +0000 @@ -17,6 +17,10 @@ #include /* rpmDoDigest() */ #include @@ -13,7 +11,7 @@ Index: build/files.c #include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */ #include "rpmio/base64.h" #include "rpmio/fts.h" -@@ -2220,12 +2224,136 @@ exit: +@@ -2230,12 +2234,136 @@ exit: return rc; } @@ -150,9 +148,9 @@ Index: build/files.c genSourceRpmName(spec); for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { -@@ -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); +@@ -2250,8 +2378,110 @@ int processBinaryFiles(rpmSpec spec, int + rpmlog(RPMLOG_NOTICE, _("Processing files: %s\n"), nvr); + free(nvr); - if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test)) != RPMRC_OK || - (rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK) @@ -162,6 +160,7 @@ Index: build/files.c + /* BEGIN DEBUGPKG */ +#if HAVE_GELF_H && HAVE_LIBELF + elf_version(EV_CURRENT); ++ a = headerGetString(pkg->header, RPMTAG_ARCH); + if (strcmp(a, "noarch") != 0 && strcmp(a, "src") != 0 && strcmp(a, "nosrc") != 0) + { + Package dbg; @@ -261,11 +260,9 @@ Index: build/files.c + if ((rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK) goto exit; - if (strcmp(a, "noarch") == 0 && headerGetColor(pkg->header) != 0) { -Index: macros.in -=================================================================== ---- macros.in.orig -+++ macros.in + a = headerGetString(pkg->header, RPMTAG_ARCH); +--- ./macros.in.orig 2010-03-25 15:21:20.000000000 +0000 ++++ ./macros.in 2010-03-25 15:21:26.000000000 +0000 @@ -176,24 +176,10 @@ # Template for debug information sub-package. %debug_package \ @@ -291,11 +288,9 @@ Index: macros.in %description debugsource\ This package provides debug sources for package %{name}.\ Debug sources are useful when developing applications that use this\ -Index: scripts/find-debuginfo.sh -=================================================================== ---- scripts/find-debuginfo.sh.orig -+++ scripts/find-debuginfo.sh -@@ -274,19 +274,11 @@ while read nlinks inum f; do +--- ./scripts/find-debuginfo.sh.orig 2010-03-25 15:19:04.000000000 +0000 ++++ ./scripts/find-debuginfo.sh 2010-03-25 15:21:26.000000000 +0000 +@@ -275,19 +275,11 @@ while read nlinks inum f; do fi done || exit diff --git a/defclean.diff b/defclean.diff index 1f02855..59ab7aa 100644 --- a/defclean.diff +++ b/defclean.diff @@ -1,10 +1,8 @@ -Index: build/parseSpec.c -=================================================================== ---- build/parseSpec.c.orig -+++ build/parseSpec.c -@@ -569,6 +569,13 @@ int parseSpec(rpmts ts, const char *spec +--- ./build/parseSpec.c.orig 2010-03-25 15:19:16.000000000 +0000 ++++ ./build/parseSpec.c 2010-03-25 15:45:25.000000000 +0000 +@@ -562,6 +562,13 @@ int parseSpec(rpmts ts, const char *spec + free(body); } - /* LCL: parsePart is modified @*/ + if (spec->clean == NULL) { + char *body = rpmExpand("%{?buildroot: %{__rm} -rf %{buildroot}}", NULL); diff --git a/diskspace.diff b/diskspace.diff index f647151..1744881 100644 --- a/diskspace.diff +++ b/diskspace.diff @@ -2,24 +2,23 @@ Make the numbers reported for diskspace problems more user friendly. Probably a bad idea, as it changes the semantics. Instead, the messages should be changed. -Index: lib/rpmts.c -=================================================================== ---- lib/rpmts.c.orig -+++ lib/rpmts.c -@@ -924,14 +924,14 @@ void rpmtsCheckDSIProblems(const rpmts t - rpmpsAppend(ps, RPMPROB_DISKSPACE, +--- ./lib/transaction.c.orig 2010-03-25 14:37:50.000000000 +0000 ++++ ./lib/transaction.c 2010-03-25 14:38:27.000000000 +0000 +@@ -212,7 +212,7 @@ static void rpmtsCheckDSIProblems(const + rpmpsAppend(ps, RPMPROB_DISKSPACE, rpmteNEVRA(te), rpmteKey(te), ts->filesystems[i], NULL, NULL, -- (adj_fs_blocks(dsi->bneeded) - dsi->bavail) * dsi->bsize); -+ (adj_fs_blocks(dsi->bneeded)) * dsi->bsize); +- (adj_fs_blocks(dsi->bneeded) - dsi->bavail) * dsi->bsize); ++ (adj_fs_blocks(dsi->bneeded)) * dsi->bsize); + dsi->obneeded = dsi->bneeded; + } } - - if (dsi->iavail >= 0 && adj_fs_blocks(dsi->ineeded) > dsi->iavail) { - rpmpsAppend(ps, RPMPROB_DISKNODES, +@@ -222,7 +222,7 @@ static void rpmtsCheckDSIProblems(const + rpmpsAppend(ps, RPMPROB_DISKNODES, rpmteNEVRA(te), rpmteKey(te), ts->filesystems[i], NULL, NULL, -- (adj_fs_blocks(dsi->ineeded) - dsi->iavail)); -+ (adj_fs_blocks(dsi->ineeded))); +- (adj_fs_blocks(dsi->ineeded) - dsi->iavail)); ++ (adj_fs_blocks(dsi->ineeded))); + dsi->oineeded = dsi->ineeded; + } } - } - ps = rpmpsFree(ps); diff --git a/disttag-macro.diff b/disttag-macro.diff index e436aaf..c9dd0f2 100644 --- a/disttag-macro.diff +++ b/disttag-macro.diff @@ -1,22 +1,18 @@ -Index: build/parsePreamble.c -=================================================================== ---- build/parsePreamble.c.orig -+++ build/parsePreamble.c -@@ -311,6 +311,7 @@ static struct optionalTag { +--- ./build/parsePreamble.c.orig 2010-03-25 14:56:24.000000000 +0000 ++++ ./build/parsePreamble.c 2010-03-25 15:20:35.000000000 +0000 +@@ -312,6 +312,7 @@ static struct optionalTag { { RPMTAG_PACKAGER, "%{packager}" }, { RPMTAG_DISTRIBUTION, "%{distribution}" }, { RPMTAG_DISTURL, "%{disturl}" }, + { RPMTAG_DISTTAG, "%{disttag}" }, + { RPMTAG_BUGURL, "%{bugurl}" }, { -1, NULL } }; - -Index: macros.in -=================================================================== ---- macros.in.orig -+++ macros.in -@@ -276,6 +276,16 @@ package or when debugging this package.\ +--- ./macros.in.orig 2010-03-25 15:18:50.000000000 +0000 ++++ ./macros.in 2010-03-25 15:19:25.000000000 +0000 +@@ -279,6 +279,16 @@ package or when debugging this package.\ # - #%disturl + #%bugurl +# Configurable distribution tag, same as Disttag: tag in a specfile. +# The tag will be used to supply reliable information to tools like diff --git a/findksyms.diff b/findksyms.diff index d279ad4..5b14c52 100644 --- a/findksyms.diff +++ b/findksyms.diff @@ -1,14 +1,25 @@ SUSE specific kernel provides/requires scripts ---- - scripts/find-provides.ksyms | 41 +++++++++++++++++++++++++++++++ - scripts/find-requires.ksyms | 57 ++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 98 insertions(+) - -Index: scripts/find-provides.ksyms -=================================================================== ---- /dev/null -+++ scripts/find-provides.ksyms +--- ./scripts/Makefile.am.orig 2010-03-25 16:39:30.000000000 +0000 ++++ ./scripts/Makefile.am 2010-03-25 16:39:56.000000000 +0000 +@@ -18,6 +18,7 @@ EXTRA_DIST = \ + rpm.daily rpm.log rpm.xinetd rpm2cpio.sh \ + tcl.req tgpg vpkg-provides.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 \ + ocaml-find-requires.sh ocaml-find-provides.sh \ +@@ -34,6 +35,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 \ + ocaml-find-requires.sh ocaml-find-provides.sh \ +--- ./scripts/find-provides.ksyms.orig 2010-03-25 16:39:56.000000000 +0000 ++++ ./scripts/find-provides.ksyms 2010-03-25 16:39:56.000000000 +0000 @@ -0,0 +1,41 @@ +#! /bin/sh + @@ -51,10 +62,8 @@ Index: scripts/find-provides.ksyms + | 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 +--- ./scripts/find-requires.ksyms.orig 2010-03-25 16:39:56.000000000 +0000 ++++ ./scripts/find-requires.ksyms 2010-03-25 16:39:56.000000000 +0000 @@ -0,0 +1,57 @@ +#! /bin/bash + @@ -113,23 +122,3 @@ Index: scripts/find-requires.ksyms + { 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/fixabsfilelists.diff b/fixabsfilelists.diff deleted file mode 100644 index 6683e06..0000000 --- a/fixabsfilelists.diff +++ /dev/null @@ -1,21 +0,0 @@ -Index: build/files.c -=================================================================== ---- build/files.c.orig -+++ build/files.c -@@ -1742,9 +1742,13 @@ static rpmRC processPackageFiles(rpmSpec - - argvSplit(&filelists, getStringBuf(pkg->fileFile), "\n"); - for (fp = filelists; *fp != NULL; fp++) { -- ffn = rpmGetPath("%{_builddir}/", -- (spec->buildSubdir ? spec->buildSubdir : "") , -- "/", *fp, NULL); -+ if (**fp == '/') { -+ ffn = rpmGetPath(*fp, NULL); -+ } else { -+ ffn = rpmGetPath("%{_builddir}/", -+ (spec->buildSubdir ? spec->buildSubdir : "") , -+ "/", *fp, NULL); -+ } - fd = fopen(ffn, "r"); - - if (fd == NULL || ferror(fd)) { diff --git a/fixqueryreturn.diff b/fixqueryreturn.diff deleted file mode 100644 index 99bb24c..0000000 --- a/fixqueryreturn.diff +++ /dev/null @@ -1,13 +0,0 @@ -Index: lib/query.c -=================================================================== ---- lib/query.c.orig -+++ lib/query.c -@@ -283,7 +283,7 @@ static int rpmgiShowMatches(QVA_t qva, r - if (qva->qva_source == RPMQV_DBOFFSET) - break; - } -- return rpmgiNumErrors(gi); -+ return ec + rpmgiNumErrors(gi); - } - - int rpmcliShowMatches(QVA_t qva, rpmts ts) diff --git a/lazystatfs.diff b/lazystatfs.diff index ecfbb69..71389f3 100644 --- a/lazystatfs.diff +++ b/lazystatfs.diff @@ -1,257 +1,6 @@ -Index: lib/rpmts.c -=================================================================== ---- lib/rpmts.c.orig -+++ lib/rpmts.c -@@ -779,83 +779,102 @@ rpmdb rpmtsGetRdb(rpmts ts) - - int rpmtsInitDSI(const rpmts ts) - { -- rpmDiskSpaceInfo dsi; -- struct stat sb; -- int rc; -- int i; -- - if (rpmtsFilterFlags(ts) & RPMPROB_FILTER_DISKSPACE) - return 0; -- -- rpmlog(RPMLOG_DEBUG, "mounted filesystems:\n"); -- rpmlog(RPMLOG_DEBUG, -- " i dev bsize bavail iavail mount point\n"); -- -- rc = rpmGetFilesystemList(&ts->filesystems, &ts->filesystemCount); -- if (rc || ts->filesystems == NULL || ts->filesystemCount <= 0) -- return rc; -- -- /* Get available space on mounted file systems. */ -- - ts->dsi = _free(ts->dsi); -- ts->dsi = xcalloc((ts->filesystemCount + 1), sizeof(*ts->dsi)); -+ ts->dsi = xcalloc(1, sizeof(*ts->dsi)); -+ return 0; -+} - -- dsi = ts->dsi; -+static rpmDiskSpaceInfo rpmtsCreateDSI(const rpmts ts, dev_t dev, const char *dirName, int count) -+{ -+ rpmDiskSpaceInfo dsi; -+ struct stat sb; -+ int rc; - -- if (dsi != NULL) -- for (i = 0; (i < ts->filesystemCount) && dsi; i++, dsi++) { - #if STATFS_IN_SYS_STATVFS -- struct statvfs sfb; -- memset(&sfb, 0, sizeof(sfb)); -- rc = statvfs(ts->filesystems[i], &sfb); -+ struct statvfs sfb; -+ memset(&sfb, 0, sizeof(sfb)); -+ rc = statvfs(dirName, &sfb); - #else -- struct statfs sfb; -- memset(&sfb, 0, sizeof(sfb)); -+ struct statfs sfb; -+ memset(&sfb, 0, sizeof(sfb)); - # if STAT_STATFS4 - /* This platform has the 4-argument version of the statfs call. The last two - * should be the size of struct statfs and 0, respectively. The 0 is the - * filesystem type, and is always 0 when statfs is called on a mounted - * filesystem, as we're doing. - */ -- rc = statfs(ts->filesystems[i], &sfb, sizeof(sfb), 0); -+ rc = statfs(dirName, &sfb, sizeof(sfb), 0); - # else -- rc = statfs(ts->filesystems[i], &sfb); -+ rc = statfs(dirName, &sfb); - # endif - #endif -- if (rc) -- break; -- -- rc = stat(ts->filesystems[i], &sb); -- if (rc) -- break; -- dsi->dev = sb.st_dev; -+ if (rc) -+ return NULL; - -- dsi->bsize = sfb.f_bsize; -- dsi->bneeded = 0; -- dsi->ineeded = 0; -+ rc = stat(dirName, &sb); -+ if (rc) -+ return NULL; -+ if (sb.st_dev != dev) -+ return NULL; -+ -+ ts->dsi = xrealloc(ts->dsi, (count + 2) * sizeof(*ts->dsi)); -+ dsi = ts->dsi + count; -+ memset(dsi, 0, 2 * sizeof(*dsi)); -+ dsi->dev = dev; -+ dsi->bsize = sfb.f_bsize; -+ if (!dsi->bsize) -+ dsi->bsize = 512; /* we need a bsize */ -+ dsi->bneeded = 0; -+ dsi->ineeded = 0; - #ifdef STATFS_HAS_F_BAVAIL -- dsi->bavail = sfb.f_bavail; -+ dsi->bavail = sfb.f_bavail; - #else - /* FIXME: the statfs struct doesn't have a member to tell how many blocks are - * available for non-superusers. f_blocks - f_bfree is probably too big, but - * it's about all we can do. - */ -- dsi->bavail = sfb.f_blocks - sfb.f_bfree; -+ dsi->bavail = sfb.f_blocks - sfb.f_bfree; - #endif -- /* XXX Avoid FAT and other file systems that have not inodes. */ -- /* XXX assigning negative value to unsigned type */ -- dsi->iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0) -- ? sfb.f_ffree : -1; -- rpmlog(RPMLOG_DEBUG, -- "%5d 0x%08x %8" PRId64 " %12" PRId64 " %12" PRId64" %s\n", -- i, (unsigned) dsi->dev, dsi->bsize, -- dsi->bavail, dsi->iavail, -- ts->filesystems[i]); -+ /* XXX Avoid FAT and other file systems that have not inodes. */ -+ /* XXX assigning negative value to unsigned type */ -+ dsi->iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0) -+ ? sfb.f_ffree : -1; -+ -+ return dsi; -+} -+ -+static void rpmtsFindDSIMount(const rpmts ts, rpmDiskSpaceInfo dsi) -+{ -+ int i; -+ struct stat sb; -+ -+ /* must leave chroot for this */ -+ if (rpmtsChrootDone(ts)) { -+ chroot("."); -+ } -+ if (!ts->filesystemCount) -+ rpmGetFilesystemList(&ts->filesystems, &ts->filesystemCount); -+ for (i = 0; i < ts->filesystemCount; i++) { -+ if (stat(ts->filesystems[i], &sb)) -+ continue; -+ if (sb.st_dev == dsi->dev) { -+ dsi->mntPoint = ts->filesystems[i]; -+ break; -+ } -+ } -+ if (i == ts->filesystemCount) { -+ /* file system not found, create something to display */ -+ dsi->mntPoint = xmalloc(20); -+ sprintf(dsi->mntPoint, "dev 0x%08x", (unsigned)dsi->dev); -+ } -+ if (rpmtsChrootDone(ts)) { -+ chroot(ts->rootDir); - } -- return rc; - } - --void rpmtsUpdateDSI(const rpmts ts, dev_t dev, -+void rpmtsUpdateDSI(const rpmts ts, dev_t dev, const char *dirName, - rpm_loff_t fileSize, rpm_loff_t prevSize, rpm_loff_t fixupSize, - rpmFileAction action) - { -@@ -866,8 +885,10 @@ void rpmtsUpdateDSI(const rpmts ts, dev_ - if (dsi) { - while (dsi->bsize && dsi->dev != dev) - dsi++; -- if (dsi->bsize == 0) -- dsi = NULL; -+ if (dsi->bsize == 0) { -+ /* create new entry */ -+ dsi = rpmtsCreateDSI(ts, dev, dirName, dsi - ts->dsi); -+ } - } - if (dsi == NULL) - return; -@@ -910,32 +931,32 @@ void rpmtsCheckDSIProblems(const rpmts t - rpmDiskSpaceInfo dsi; - rpmps ps; - int fc; -- int i; -- -- if (ts->filesystems == NULL || ts->filesystemCount <= 0) -- return; - - dsi = ts->dsi; -- if (dsi == NULL) -+ if (dsi == NULL || !dsi->bsize) - return; - fc = rpmfiFC(rpmteFI(te)); - if (fc <= 0) - return; - - ps = rpmtsProblems(ts); -- for (i = 0; i < ts->filesystemCount; i++, dsi++) { -+ for (; dsi->bsize; dsi++) { - - if (dsi->bavail >= 0 && adj_fs_blocks(dsi->bneeded) > dsi->bavail) { -+ if (!dsi->mntPoint) -+ rpmtsFindDSIMount(ts, dsi); - rpmpsAppend(ps, RPMPROB_DISKSPACE, - rpmteNEVRA(te), rpmteKey(te), -- ts->filesystems[i], NULL, NULL, -+ dsi->mntPoint, NULL, NULL, - (adj_fs_blocks(dsi->bneeded)) * dsi->bsize); - } - - if (dsi->iavail >= 0 && adj_fs_blocks(dsi->ineeded) > dsi->iavail) { -+ if (!dsi->mntPoint) -+ rpmtsFindDSIMount(ts, dsi); - rpmpsAppend(ps, RPMPROB_DISKNODES, - rpmteNEVRA(te), rpmteKey(te), -- ts->filesystems[i], NULL, NULL, -+ dsi->mntPoint, NULL, NULL, - (adj_fs_blocks(dsi->ineeded))); - } - } -Index: lib/rpmts.h -=================================================================== ---- lib/rpmts.h.orig -+++ lib/rpmts.h -@@ -485,7 +485,7 @@ int rpmtsSuspendResumeDBLock(rpmts ts, i - * @param fixupSize long size difference - * @param action file disposition - */ --void rpmtsUpdateDSI(const rpmts ts, dev_t dev, -+void rpmtsUpdateDSI(const rpmts ts, dev_t dev, const char *dirName, - rpm_loff_t fileSize, rpm_loff_t prevSize, rpm_loff_t fixupSize, - rpmFileAction action); - -Index: lib/rpmts_internal.h -=================================================================== ---- lib/rpmts_internal.h.orig -+++ lib/rpmts_internal.h -@@ -14,6 +14,7 @@ typedef struct diskspaceInfo_s * rpmDisk - /** \ingroup rpmts - */ - struct diskspaceInfo_s { -+ const char *mntPoint; /*!< File system mount point */ - dev_t dev; /*!< File system device number. */ - int64_t bneeded; /*!< No. of blocks needed. */ - int64_t ineeded; /*!< No. of inodes needed. */ -Index: lib/transaction.c -=================================================================== ---- lib/transaction.c.orig -+++ lib/transaction.c -@@ -343,7 +343,7 @@ assert(otherFi != NULL); - } - - /* Update disk space info for a file. */ -- rpmtsUpdateDSI(ts, fiFps->entry->dev, rpmfiFSize(fi), -+ rpmtsUpdateDSI(ts, fiFps->entry->dev, fiFps->entry->dirName, rpmfiFSize(fi), - rpmfiFReplacedSize(fi), fixupSize, rpmfsGetAction(fs, i)); - - } -Index: configure.ac -=================================================================== ---- configure.ac.orig -+++ configure.ac -@@ -511,25 +511,25 @@ dnl +--- ./configure.ac.orig 2010-03-25 15:16:21.000000000 +0000 ++++ ./configure.ac 2010-03-25 15:27:47.000000000 +0000 +@@ -510,25 +510,25 @@ dnl found_struct_statfs=no if test X$found_struct_statfs = Xno ; then @@ -284,3 +33,242 @@ Index: configure.ac found_struct_statfs=yes],[]) fi +--- ./lib/transaction.c.orig 2010-03-25 15:14:38.000000000 +0000 ++++ ./lib/transaction.c 2010-03-25 15:44:25.000000000 +0000 +@@ -45,6 +45,7 @@ + #include "debug.h" + + struct diskspaceInfo_s { ++ const char *mntPoint; /*!< File system mount point */ + dev_t dev; /*!< File system device number. */ + int64_t bneeded; /*!< No. of blocks needed. */ + int64_t ineeded; /*!< No. of inodes needed. */ +@@ -61,83 +62,78 @@ struct diskspaceInfo_s { + + static int rpmtsInitDSI(const rpmts ts) + { +- rpmDiskSpaceInfo dsi; +- struct stat sb; +- int rc; +- int i; +- + if (rpmtsFilterFlags(ts) & RPMPROB_FILTER_DISKSPACE) + return 0; + +- rpmlog(RPMLOG_DEBUG, "mounted filesystems:\n"); +- rpmlog(RPMLOG_DEBUG, +- " i dev bsize bavail iavail mount point\n"); +- +- rc = rpmGetFilesystemList(&ts->filesystems, &ts->filesystemCount); +- if (rc || ts->filesystems == NULL || ts->filesystemCount <= 0) +- return rc; +- +- /* Get available space on mounted file systems. */ +- + ts->dsi = _free(ts->dsi); +- ts->dsi = xcalloc((ts->filesystemCount + 1), sizeof(*ts->dsi)); ++ ts->dsi = xcalloc(1, sizeof(*ts->dsi)); ++ return 0; ++} + +- dsi = ts->dsi; ++static rpmDiskSpaceInfo rpmtsCreateDSI(const rpmts ts, dev_t dev, const char *dirName, int count) ++{ ++ rpmDiskSpaceInfo dsi; ++ struct stat sb; ++ int rc; + +- if (dsi != NULL) +- for (i = 0; (i < ts->filesystemCount) && dsi; i++, dsi++) { + #if STATFS_IN_SYS_STATVFS +- struct statvfs sfb; +- memset(&sfb, 0, sizeof(sfb)); +- rc = statvfs(ts->filesystems[i], &sfb); ++ struct statvfs sfb; ++ memset(&sfb, 0, sizeof(sfb)); ++ rc = statvfs(ts->filesystems[i], &sfb); + #else +- struct statfs sfb; +- memset(&sfb, 0, sizeof(sfb)); ++ struct statfs sfb; ++ memset(&sfb, 0, sizeof(sfb)); + # if STAT_STATFS4 + /* This platform has the 4-argument version of the statfs call. The last two + * should be the size of struct statfs and 0, respectively. The 0 is the + * filesystem type, and is always 0 when statfs is called on a mounted + * filesystem, as we're doing. + */ +- rc = statfs(ts->filesystems[i], &sfb, sizeof(sfb), 0); ++ rc = statfs(dirName, &sfb, sizeof(sfb), 0); + # else +- rc = statfs(ts->filesystems[i], &sfb); ++ rc = statfs(dirName, &sfb); + # endif + #endif +- if (rc) +- break; ++ if (rc) ++ return NULL; + +- rc = stat(ts->filesystems[i], &sb); +- if (rc) +- break; +- dsi->dev = sb.st_dev; ++ rc = stat(dirName, &sb); ++ if (rc) ++ return NULL; ++ if (sb.st_dev != dev) ++ return NULL; + +- dsi->bsize = sfb.f_bsize; +- dsi->bneeded = 0; +- dsi->ineeded = 0; ++ ts->dsi = xrealloc(ts->dsi, (count + 2) * sizeof(*ts->dsi)); ++ dsi = ts->dsi + count; ++ memset(dsi, 0, 2 * sizeof(*dsi)); ++ ++ dsi->dev = sb.st_dev; ++ dsi->bsize = sfb.f_bsize; ++ if (!dsi->bsize) ++ dsi->bsize = 512; /* we need a bsize */ ++ dsi->bneeded = 0; ++ dsi->ineeded = 0; + #ifdef STATFS_HAS_F_BAVAIL +- dsi->bavail = (sfb.f_flag & ST_RDONLY) ? 0 : sfb.f_bavail; ++# ifdef ST_RDONLY ++ dsi->bavail = (sfb.f_flag & ST_RDONLY) ? 0 : sfb.f_bavail; ++# else ++ dsi->bavail = sfb.f_bavail; ++# endif + #else + /* FIXME: the statfs struct doesn't have a member to tell how many blocks are + * available for non-superusers. f_blocks - f_bfree is probably too big, but + * it's about all we can do. + */ +- dsi->bavail = sfb.f_blocks - sfb.f_bfree; ++ dsi->bavail = sfb.f_blocks - sfb.f_bfree; + #endif +- /* XXX Avoid FAT and other file systems that have not inodes. */ +- /* XXX assigning negative value to unsigned type */ +- dsi->iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0) +- ? sfb.f_ffree : -1; +- rpmlog(RPMLOG_DEBUG, +- "%5d 0x%08x %8" PRId64 " %12" PRId64 " %12" PRId64" %s\n", +- i, (unsigned) dsi->dev, dsi->bsize, +- dsi->bavail, dsi->iavail, +- ts->filesystems[i]); +- } +- return rc; ++ /* XXX Avoid FAT and other file systems that have not inodes. */ ++ /* XXX assigning negative value to unsigned type */ ++ dsi->iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0) ++ ? sfb.f_ffree : -1; ++ return dsi; + } + +-static void rpmtsUpdateDSI(const rpmts ts, dev_t dev, ++static void rpmtsUpdateDSI(const rpmts ts, dev_t dev, const char *dirName, + rpm_loff_t fileSize, rpm_loff_t prevSize, rpm_loff_t fixupSize, + rpmFileAction action) + { +@@ -148,8 +140,10 @@ static void rpmtsUpdateDSI(const rpmts t + if (dsi) { + while (dsi->bsize && dsi->dev != dev) + dsi++; +- if (dsi->bsize == 0) +- dsi = NULL; ++ if (dsi->bsize == 0) { ++ /* create new entry */ ++ dsi = rpmtsCreateDSI(ts, dev, dirName, dsi - ts->dsi); ++ } + } + if (dsi == NULL) + return; +@@ -187,31 +181,58 @@ static void rpmtsUpdateDSI(const rpmts t + dsi->bneeded -= BLOCK_ROUND(fixupSize, dsi->bsize); + } + ++static void rpmtsFindDSIMount(const rpmts ts, rpmDiskSpaceInfo dsi) ++{ ++ int i; ++ struct stat sb; ++ ++ /* must leave chroot for this */ ++ if (rpmtsChrootDone(ts)) { ++ chroot("."); ++ } ++ if (!ts->filesystemCount) ++ rpmGetFilesystemList(&ts->filesystems, &ts->filesystemCount); ++ for (i = 0; i < ts->filesystemCount; i++) { ++ if (stat(ts->filesystems[i], &sb)) ++ continue; ++ if (sb.st_dev == dsi->dev) { ++ dsi->mntPoint = ts->filesystems[i]; ++ break; ++ } ++ } ++ if (i == ts->filesystemCount) { ++ /* file system not found, create something to display */ ++ dsi->mntPoint = xmalloc(20); ++ sprintf((char *)dsi->mntPoint, "dev 0x%08x", (unsigned)dsi->dev); ++ } ++ if (rpmtsChrootDone(ts)) { ++ chroot(ts->rootDir); ++ } ++} ++ + static void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te) + { + rpmDiskSpaceInfo dsi; + rpmps ps; + int fc; +- int i; +- +- if (ts->filesystems == NULL || ts->filesystemCount <= 0) +- return; + + dsi = ts->dsi; +- if (dsi == NULL) ++ if (dsi == NULL || !dsi->bsize) + return; + fc = rpmfiFC(rpmteFI(te)); + if (fc <= 0) + return; + + ps = rpmtsProblems(ts); +- for (i = 0; i < ts->filesystemCount; i++, dsi++) { ++ for (; dsi->bsize; dsi++) { + + if (dsi->bavail >= 0 && adj_fs_blocks(dsi->bneeded) > dsi->bavail) { + if (dsi->bneeded != dsi->obneeded) { ++ if (!dsi->mntPoint) ++ rpmtsFindDSIMount(ts, dsi); + rpmpsAppend(ps, RPMPROB_DISKSPACE, + rpmteNEVRA(te), rpmteKey(te), +- ts->filesystems[i], NULL, NULL, ++ dsi->mntPoint, NULL, NULL, + (adj_fs_blocks(dsi->bneeded)) * dsi->bsize); + dsi->obneeded = dsi->bneeded; + } +@@ -219,9 +240,11 @@ static void rpmtsCheckDSIProblems(const + + if (dsi->iavail >= 0 && adj_fs_blocks(dsi->ineeded) > dsi->iavail) { + if (dsi->ineeded != dsi->oineeded) { ++ if (!dsi->mntPoint) ++ rpmtsFindDSIMount(ts, dsi); + rpmpsAppend(ps, RPMPROB_DISKNODES, + rpmteNEVRA(te), rpmteKey(te), +- ts->filesystems[i], NULL, NULL, ++ dsi->mntPoint, NULL, NULL, + (adj_fs_blocks(dsi->ineeded))); + dsi->oineeded = dsi->ineeded; + } +@@ -543,7 +566,7 @@ assert(otherFi != NULL); + } + + /* Update disk space info for a file. */ +- rpmtsUpdateDSI(ts, fiFps->entry->dev, rpmfiFSize(fi), ++ rpmtsUpdateDSI(ts, fiFps->entry->dev, fiFps->entry->dirName, rpmfiFSize(fi), + rpmfiFReplacedSize(fi), fixupSize, rpmfsGetAction(fs, i)); + + } diff --git a/localetag.diff b/localetag.diff index 8f4ead9..e3bea98 100644 --- a/localetag.diff +++ b/localetag.diff @@ -1,10 +1,5 @@ -Convert changelog and i18n header elements to current locale. -[#43347], rh#140050 - -Index: lib/tagexts.c -=================================================================== ---- lib/tagexts.c.orig -+++ lib/tagexts.c +--- ./lib/tagexts.c.orig 2010-01-08 08:14:37.000000000 +0000 ++++ ./lib/tagexts.c 2010-03-24 16:46:03.000000000 +0000 @@ -2,6 +2,7 @@ * \file lib/formats.c */ @@ -13,7 +8,7 @@ Index: lib/tagexts.c #include "system.h" #include -@@ -156,6 +157,114 @@ exit: +@@ -157,6 +158,114 @@ exit: return rc; } @@ -128,31 +123,27 @@ Index: lib/tagexts.c /** * Retrieve mounted file system paths. * @param h header -@@ -534,9 +643,43 @@ static int i18nTag(Header h, rpmTag tag, +@@ -533,10 +642,41 @@ static int i18nTag(Header h, rpmTag tag, dstring = _free(dstring); - rc = headerGet(h, tag, td, HEADERGET_DEFAULT); + rc = headerGet(h, tag, td, HEADERGET_ALLOC); + if (rc && td->data) { -+ td->data = xstrdup(td->data); + td->data = strtolocale(td->data); -+ td->flags = RPMTD_ALLOCED; + } -+ return rc; -+} -+ -+/** + return rc; + } + + /** + * Retrieve text and convert to locale. + */ +static int localeTag(Header h, rpmTag tag, rpmtd td) +{ + int rc; -+ rc = headerGet(h, tag, td, HEADERGET_DEFAULT); ++ rc = headerGet(h, tag, td, HEADERGET_ALLOC); + 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; @@ -162,18 +153,20 @@ Index: lib/tagexts.c + arr[i] = xstrdup(((char **)td->data)[i]); + arr[i] = strtolocale(arr[i]); + } ++ _free(td->data); + td->data = arr; + td->flags = RPMTD_ALLOCED | RPMTD_PTR_ALLOCED; + } - return rc; - } - ++ return rc; ++} + - /** ++ ++/** * Retrieve summary text. * @param h header -@@ -559,6 +702,16 @@ static int descriptionTag(Header h, rpmt - return i18nTag(h, RPMTAG_DESCRIPTION, td); + * @retval td tag data container +@@ -558,6 +698,16 @@ static int descriptionTag(Header h, rpmt + return i18nTag(h, RPMTAG_DESCRIPTION, td, hgflags); } +static int changelognameTag(Header h, rpmtd td) @@ -189,12 +182,12 @@ Index: lib/tagexts.c /** * Retrieve group text. * @param h header -@@ -663,6 +816,8 @@ static const struct headerTagFunc_s rpmH +@@ -791,6 +941,8 @@ static const struct headerTagFunc_s rpmH { RPMTAG_LONGARCHIVESIZE, longarchivesizeTag }, { RPMTAG_LONGSIZE, longsizeTag }, { RPMTAG_LONGSIGSIZE, longsigsizeTag }, + { RPMTAG_CHANGELOGNAME, changelognameTag }, + { RPMTAG_CHANGELOGTEXT, changelogtextTag }, - { 0, NULL } - }; - + { RPMTAG_DBINSTANCE, dbinstanceTag }, + { RPMTAG_EVR, evrTag }, + { RPMTAG_NVR, nvrTag }, diff --git a/luaroot.diff b/luaroot.diff index 764aec9..db5bff2 100644 --- a/luaroot.diff +++ b/luaroot.diff @@ -1,8 +1,6 @@ -Index: lib/psm.c -=================================================================== ---- lib/psm.c.orig -+++ lib/psm.c -@@ -441,6 +441,8 @@ static rpmRC runLuaScript(rpmpsm psm, He +--- ./lib/psm.c.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./lib/psm.c 2010-03-25 14:42:52.000000000 +0000 +@@ -455,6 +455,8 @@ static rpmRC runLuaScript(rpmpsm psm, He #ifdef WITH_LUA char *sname = NULL; int rootFd = -1; @@ -11,16 +9,10 @@ Index: lib/psm.c int xx; rpmlua lua = NULL; /* Global state. */ rpmluav var; -@@ -449,16 +451,21 @@ static rpmRC runLuaScript(rpmpsm psm, He +@@ -463,6 +465,22 @@ 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) { @@ -28,26 +20,26 @@ Index: lib/psm.c + xx = chdir("/"); + rootFd = open(".", O_RDONLY, 0); + if (rootFd >= 0) { - xx = chroot(rootDir); -- xx = rpmtsSetChrootDone(ts, 1); ++ xx = chroot(rootDir); + xx = rpmtsSetChrootDone(ts, 1); + } - } ++ } + } else { + rootFd = open(".", O_RDONLY, 0); - } ++ } + xx = chdir("/"); - - /* Create arg variable */ - rpmluaPushTable(lua, "arg"); -@@ -491,12 +498,17 @@ static rpmRC runLuaScript(rpmpsm psm, He ++ + if (!rpmtsChrootDone(ts)) { + const char *rootDir = rpmtsRootDir(ts); + xx = chdir("/"); +@@ -505,12 +523,17 @@ static rpmRC runLuaScript(rpmpsm psm, He rpmluaDelVar(lua, "arg"); if (rootFd >= 0) { - const char *rootDir = rpmtsRootDir(ts); xx = fchdir(rootFd); xx = close(rootFd); -- if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') +- if (rootDir != NULL && !rstreq(rootDir, "/") && *rootDir == '/') + if (!chroot_done) { xx = chroot("."); - xx = rpmtsSetChrootDone(ts, 0); diff --git a/macrosin.diff b/macrosin.diff index def6639..65d9089 100644 --- a/macrosin.diff +++ b/macrosin.diff @@ -1,9 +1,5 @@ -SUSE specific macro changes. - -Index: macros.in -=================================================================== ---- macros.in.orig -+++ macros.in +--- ./macros.in.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./macros.in 2010-03-25 15:13:43.000000000 +0000 @@ -175,22 +175,22 @@ # Template for debug information sub-package. @@ -33,7 +29,7 @@ Index: macros.in # The path to the gzip executable (legacy, use %{__gzip} instead). %_gzipbin %{__gzip} -@@ -233,7 +233,7 @@ package or when debugging this package.\ +@@ -230,7 +230,7 @@ package or when debugging this package.\ %_tmppath %{_var}/tmp # Path to top of build area. @@ -42,7 +38,7 @@ Index: macros.in # The path to the unzip executable (legacy, use %{__unzip} instead). %_unzipbin %{__unzip} -@@ -330,7 +330,7 @@ package or when debugging this package.\ +@@ -333,7 +333,7 @@ package or when debugging this package.\ # "w7.lzdio" lzma-alone level 7, lzma's default # #%_source_payload w9.gzdio @@ -51,7 +47,7 @@ Index: macros.in # Algorithm to use for generating file checksum digests on build. # If not specified or 0, MD5 is used. -@@ -420,7 +420,7 @@ package or when debugging this package.\ +@@ -417,7 +417,7 @@ package or when debugging this package.\ # # Use internal dependency generator rather than external helpers? @@ -60,7 +56,7 @@ Index: macros.in # # Filter GLIBC_PRIVATE Provides: and Requires: -@@ -466,16 +466,22 @@ print (t)\ +@@ -463,16 +463,22 @@ print (t)\ # Undefined, missing or %{nil} will use package content (if available). %_verify_file_context_path %{__file_context_path} @@ -84,8 +80,8 @@ Index: macros.in +#%__find_enhances ??? # - # Path to scripts to autogenerate per-interpreter package dependencies, -@@ -638,15 +644,15 @@ print (t)\ + # Path to scripts to autogenerate per-interpreter package dependencies. +@@ -644,15 +650,15 @@ print (t)\ %_dbi_config_Packages %{_dbi_htconfig} lockdbfd # "Depends" is a per-transaction cache of known dependency resolutions. @@ -108,7 +104,7 @@ Index: macros.in # XXX legacy configuration. # Choose db interface: -@@ -1008,7 +1014,7 @@ print (t)\ +@@ -991,7 +997,7 @@ print (t)\ %_build_vendor %{_host_vendor} %_build_os %{_host_os} %_host @host@ @@ -117,9 +113,9 @@ Index: macros.in %_host_cpu @host_cpu@ %_host_vendor @host_vendor@ %_host_os @host_os@ -@@ -1168,6 +1174,181 @@ done \ - %perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib) - %perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib) +@@ -1154,6 +1160,181 @@ done \ + %python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))") + %python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])") +# More useful perl macros (from Raul Dias ) +# @@ -299,7 +295,7 @@ Index: macros.in #------------------------------------------------------------------------------ # arch macro for all Intel i?86 compatibile processors # (Note: This macro (and it's analogues) will probably be obsoleted when -@@ -1178,7 +1359,9 @@ done \ +@@ -1164,7 +1345,9 @@ done \ #------------------------------------------------------------------------------ # arch macro for all supported ARM processors @@ -310,7 +306,7 @@ Index: macros.in #------------------------------------------------------------------------------ # arch macro for all supported Sparc processors -@@ -1207,3 +1390,26 @@ done \ +@@ -1197,3 +1380,26 @@ done \ # \endverbatim #*/ diff --git a/missingok.diff b/missingok.diff index 5eeac43..39285dd 100644 --- a/missingok.diff +++ b/missingok.diff @@ -1,10 +1,6 @@ -Obey MISSINGOK flag for dependencies. Backport from rpm-4.4.7. - -Index: lib/depends.c -=================================================================== ---- lib/depends.c.orig -+++ lib/depends.c -@@ -518,8 +518,13 @@ retry: +--- ./lib/depends.c.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./lib/depends.c 2010-03-24 16:47:28.000000000 +0000 +@@ -450,8 +450,13 @@ retry: } unsatisfied: @@ -19,20 +15,9 @@ Index: lib/depends.c + } exit: - /* -@@ -827,6 +832,8 @@ static inline const char * identifyDepen - return "Requires(postun):"; - if (f & RPMSENSE_SCRIPT_VERIFY) - return "Requires(verify):"; -+ if (f & RPMSENSE_MISSINGOK) -+ return "Requires(hint):"; - if (f & RPMSENSE_FIND_REQUIRES) - return "Requires(auto):"; - return "Requires:"; -Index: lib/rpmds.h -=================================================================== ---- lib/rpmds.h.orig -+++ lib/rpmds.h + if (cacheThis) { +--- ./lib/rpmds.h.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./lib/rpmds.h 2010-03-24 16:47:28.000000000 +0000 @@ -73,6 +73,7 @@ typedef enum rpmsenseFlags_e { RPMSENSE_SCRIPT_POSTUN | \ RPMSENSE_SCRIPT_VERIFY | \ diff --git a/modemuncher.diff b/modemuncher.diff new file mode 100644 index 0000000..f791f5e --- /dev/null +++ b/modemuncher.diff @@ -0,0 +1,16 @@ +--- luaext/modemuncher.c.orig 2010-03-26 09:43:45.000000000 +0000 ++++ luaext/modemuncher.c 2010-03-26 09:44:54.000000000 +0000 +@@ -245,11 +245,11 @@ printf("modemuncher: doneflag = %u\n", d + if (ch_mode) switch (op) + { + case '+': +- *mode = *mode |= ch_mode & affected_bits; ++ *mode |= ch_mode & affected_bits; + break; + + case '-': +- *mode = *mode &= ~(ch_mode & affected_bits); ++ *mode &= ~(ch_mode & affected_bits); + break; + + case '=': diff --git a/nameversioncompare.diff b/nameversioncompare.diff index bcf5ce7..99b21f0 100644 --- a/nameversioncompare.diff +++ b/nameversioncompare.diff @@ -1,11 +1,9 @@ Also compare the name and not only the version when checking if two packages are the same. rh#104066 -Index: lib/depends.c -=================================================================== ---- lib/depends.c.orig -+++ lib/depends.c -@@ -102,6 +102,24 @@ static int removePackage(rpmts ts, Heade +--- ./lib/depends.c.orig 2010-03-24 16:47:28.000000000 +0000 ++++ ./lib/depends.c 2010-03-24 16:52:00.000000000 +0000 +@@ -100,6 +100,24 @@ static int removePackage(rpmts ts, Heade return 0; } @@ -30,7 +28,7 @@ Index: lib/depends.c int rpmtsAddInstallElement(rpmts ts, Header h, fnpyKey key, int upgrade, rpmRelocation * relocs) { -@@ -291,7 +309,7 @@ addheader: +@@ -275,7 +293,7 @@ addheader: continue; /* Skip packages that contain identical NEVR. */ @@ -38,18 +36,18 @@ Index: lib/depends.c + if (rpmNameVersionCompare(h, oh) == 0) continue; - xx = removePackage(ts, oh, pkgKey); -@@ -342,11 +360,9 @@ addheader: + xx = removePackage(ts, oh, p); +@@ -316,11 +334,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)) { - char * ohNEVRA = headerGetNEVRA(oh, NULL); + char * ohNEVRA = headerGetAsString(oh, RPMTAG_NEVRA); -#ifdef DYING /* XXX see http://bugzilla.redhat.com #134497 */ - if (rpmVersionCompare(h, oh)) -#endif + if (rpmNameVersionCompare(h, oh)) - xx = removePackage(ts, oh, pkgKey); + xx = removePackage(ts, oh, p); rpmlog(RPMLOG_DEBUG, " Obsoletes: %s\t\terases %s\n", rpmdsDNEVR(obsoletes)+2, ohNEVRA); diff --git a/readlineofi.diff b/readlineofi.diff new file mode 100644 index 0000000..d4123d1 --- /dev/null +++ b/readlineofi.diff @@ -0,0 +1,10 @@ +--- build/parseSpec.c.orig 2010-02-15 11:49:29.000000000 +0000 ++++ build/parseSpec.c 2010-02-24 10:38:25.000000000 +0000 +@@ -283,6 +283,7 @@ int readLine(rpmSpec spec, int strip) + retry: + if ((rc = readLineFromOFI(spec, ofi)) != 0) + return rc; ++ ofi = spec->fileStack; + + /* Copy next file line into the spec line buffer */ + rc = copyNextLineFromOFI(spec, ofi); diff --git a/ready b/ready deleted file mode 100644 index 473a0f4..0000000 diff --git a/rpm-4.8.0.tar.bz2 b/rpm-4.8.0.tar.bz2 new file mode 100644 index 0000000..2fec1e1 --- /dev/null +++ b/rpm-4.8.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3b4bb2d78eaf1f5200fdcd51372ca9cedce64e030046372e6a13e361cb82b64 +size 3692408 diff --git a/rpm-beecrypt.diff b/rpm-beecrypt.diff index 0fff5e4..c4a2292 100644 --- a/rpm-beecrypt.diff +++ b/rpm-beecrypt.diff @@ -1,6 +1,6 @@ ---- ./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 +--- ./Makefile.am.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./Makefile.am 2010-03-24 15:39:14.000000000 +0000 +@@ -87,7 +87,8 @@ DISTCLEANFILES += find-requires rpm_SOURCES = rpmqv.c debug.h system.h rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV @@ -10,8 +10,8 @@ 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 +--- ./config.h.in.orig 2010-01-08 08:35:12.000000000 +0000 ++++ ./config.h.in 2010-03-24 15:39:14.000000000 +0000 @@ -13,6 +13,9 @@ /* Define to 1 if you have the `basename' function. */ #undef HAVE_BASENAME @@ -52,9 +52,9 @@ /* 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], [ +--- ./configure.ac.orig 2010-01-08 08:34:41.000000000 +0000 ++++ ./configure.ac 2010-03-24 15:39:14.000000000 +0000 +@@ -299,12 +299,43 @@ AC_CHECK_HEADERS([dwarf.h], [ AM_CONDITIONAL(LIBDWARF,[test "$WITH_LIBDWARF" = yes]) #================= @@ -98,7 +98,7 @@ 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, [ +@@ -313,6 +344,7 @@ AC_CHECK_LIB(nss3, NSS_NoDB_Init, [ ], [ AC_MSG_ERROR([missing required NSS library 'nss3']) ]) @@ -106,129 +106,8 @@ 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 +--- ./rpmio/Makefile.am.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./rpmio/Makefile.am 2010-03-24 15:42:04.000000000 +0000 @@ -2,6 +2,7 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/ @@ -247,7 +126,7 @@ +librpmio_la_SOURCES += digest_nss.c +endif + - librpmio_la_LDFLAGS = -version-info 0:0:0 + librpmio_la_LDFLAGS = -version-info 1:0:0 librpmio_la_LIBADD = \ ../misc/libmisc.la \ @WITH_NSS_LIB@ \ @@ -255,7 +134,7 @@ @WITH_LUA_LIB@ \ @WITH_BZ2_LIB@ \ @WITH_ZLIB_LIB@ \ -@@ -31,6 +39,17 @@ librpmio_la_LIBADD = \ +@@ -31,6 +39,15 @@ librpmio_la_LIBADD = \ @WITH_LZMA_LIB@ \ -lpthread @@ -267,14 +146,12 @@ +$(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/ + AM_CPPFLAGS += -I$(top_srcdir)/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 +--- ./rpmio/base64.c.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./rpmio/base64.c 2010-03-24 15:39:14.000000000 +0000 @@ -4,8 +4,11 @@ #include #include @@ -292,9 +169,9 @@ #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 @@ +--- ./rpmio/digest.c.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./rpmio/digest.c 2010-03-24 15:43:57.000000000 +0000 +@@ -4,26 +4,12 @@ #include "system.h" @@ -317,17 +194,26 @@ -struct DIGEST_CTX_s { - rpmDigestFlags flags; /*!< Bit(s) to control digest operation. */ - HASHContext *hashctx; /*!< Internal NSS hash context. */ +- pgpHashAlgo algo; /*!< Used hash algorithm */ -}; - + #define DIGESTS_MAX 11 + struct rpmDigestBundle_s { + int index_min; /*!< Smallest index of active digest */ +@@ -109,138 +95,3 @@ DIGEST_CTX rpmDigestBundleDupCtx(rpmDige + return dup; + } + -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 */ +- DIGEST_CTX nctx = NULL; +- if (octx) { +- HASHContext *hctx = HASH_Clone(octx->hashctx); +- if (hctx) { +- nctx = memcpy(xcalloc(1, sizeof(*nctx)), octx, sizeof(*nctx)); +- nctx->hashctx = hctx; +- } - } - return nctx; -} @@ -372,30 +258,23 @@ -DIGEST_CTX -rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags) -{ -- HASH_HashType type; -- DIGEST_CTX ctx; +- HASH_HashType type = getHashType(hashalgo); +- HASHContext *hashctx = NULL; +- DIGEST_CTX ctx = NULL; - -- if (rpmInitCrypto() < 0) -- return NULL; +- if (type == HASH_AlgNULL || rpmInitCrypto() < 0) +- goto exit; - -- ctx = xcalloc(1, sizeof(*ctx)); -- ctx->flags = flags; -- -- type = getHashType(hashalgo); -- if (type == HASH_AlgNULL) { -- free(ctx); -- return NULL; +- if ((hashctx = HASH_Create(type)) != NULL) { +- ctx = xcalloc(1, sizeof(*ctx)); +- ctx->flags = flags; +- ctx->algo = hashalgo; +- ctx->hashctx = hashctx; +- HASH_Begin(ctx->hashctx); - } -- -- 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)); +-exit: - return ctx; -} - @@ -459,11 +338,9 @@ - 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 +- +--- ./rpmio/digest.h.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./rpmio/digest.h 2010-03-24 15:56:12.000000000 +0000 @@ -1,11 +1,6 @@ #ifndef _RPMDIGEST_H #define _RPMDIGEST_H @@ -475,37 +352,31 @@ - #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; +@@ -42,8 +37,18 @@ struct pgpDig_s { + struct pgpDigParams_s pubkey; - /* RSA parameters */ -- SECKEYPublicKey *rsa; -- SECItem *rsasig; -+ void *rsa; -+ void *rsasig; + /* DSA/RSA parameters */ +- SECKEYPublicKey *keydata; +- SECItem *sigdata; ++ void *keydata; ++ void *sigdata; }; ++void pgpCleanRSADSA(pgpDig dig); ++ +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 pgpVerifyRSA(pgpDig dig, uint8_t *hash, size_t hashlen); + +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); ++int pgpVerifyDSA(pgpDig dig, uint8_t *hash, size_t hashlen); + #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 @@ +--- ./rpmio/digest_beecrypt.c.orig 2010-03-24 15:39:14.000000000 +0000 ++++ ./rpmio/digest_beecrypt.c 2010-03-24 16:16:23.000000000 +0000 +@@ -0,0 +1,493 @@ +#include "system.h" + +#include @@ -594,6 +465,18 @@ + return 0; +} + ++void pgpCleanRSADSA(pgpDig dig) ++{ ++ if (!dig) ++ return; ++ if (dig->keydata) { ++ dig->keydata= _free(dig->keydata); ++ } ++ if (dig->sigdata) { ++ dig->sigdata = _free(dig->sigdata); ++ } ++} ++ + +/****************************** RSA **************************************/ + @@ -611,9 +494,9 @@ + struct pgpDigSigRSA_s *sig; + if (num != 0) + return 1; -+ if (!dig->rsasig) -+ dig->rsasig = xcalloc(1, sizeof(*sig)); -+ sig = dig->rsasig; ++ if (!dig->sigdata) ++ dig->sigdata = xcalloc(1, sizeof(*sig)); ++ sig = dig->sigdata; + if (!sig) + return 1; + (void) mpnsethex(&sig->c, pgpMpiHex(p)); @@ -625,9 +508,9 @@ +{ + struct pgpDigPubRSA_s *pub; + -+ if (!dig->rsa) -+ dig->rsa = xcalloc(1, sizeof(*pub)); -+ pub = dig->rsa; ++ if (!dig->keydata) ++ dig->keydata = xcalloc(1, sizeof(*pub)); ++ pub = dig->keydata; + if (!pub) + return 1; + switch(num) { @@ -642,18 +525,6 @@ + } +} + -+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') @@ -665,7 +536,7 @@ + return 0; +} + -+int pgpVerifyRSA(pgpDig dig) ++int pgpVerifyRSA(pgpDig dig, uint8_t *hash, size_t hashlen) +{ + const char * prefix = NULL; + int res; @@ -673,8 +544,8 @@ + struct pgpDigSigRSA_s *sig; + struct pgpDigPubRSA_s *pub; + -+ sig = dig->rsasig; -+ pub = dig->rsa; ++ sig = dig->sigdata; ++ pub = dig->keydata; + if (!sig || !pub) + return 1; + @@ -713,13 +584,13 @@ + memset(buf, 0xff, nb); + buf[0] = 0x00; + buf[1] = 0x01; -+ bp = buf + nb - strlen(prefix)/2 - dig->md5len - 1; ++ bp = buf + nb - strlen(prefix)/2 - hashlen - 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); ++ memcpy(bp, hash, hashlen); + mpnzero(&rsahm); + (void) mpnsetbin(&rsahm, buf, nb); + buf = _free(buf); @@ -753,9 +624,9 @@ +{ + struct pgpDigSigDSA_s *sig; + -+ if (!dig->dsasig) -+ dig->dsasig = xcalloc(1, sizeof(*sig)); -+ sig = dig->dsasig; ++ if (!dig->sigdata) ++ dig->sigdata = xcalloc(1, sizeof(*sig)); ++ sig = dig->sigdata; + if (!sig) + return 1; + switch(num) { @@ -773,9 +644,9 @@ +{ + struct pgpDigPubDSA_s *pub; + -+ if (!dig->dsa) -+ dig->dsa = xcalloc(1, sizeof(*pub)); -+ pub = dig->dsa; ++ if (!dig->keydata) ++ dig->keydata = xcalloc(1, sizeof(*pub)); ++ pub = dig->keydata; + if (!pub) + return 1; + switch(num) { @@ -796,31 +667,19 @@ + } +} + -+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) ++int pgpVerifyDSA(pgpDig dig, uint8_t *hash, size_t hashlen) +{ + struct pgpDigSigDSA_s *sig; + struct pgpDigPubDSA_s *pub; + mpnumber hm; + int res; + -+ sig = dig->dsasig; -+ pub = dig->dsa; ++ sig = dig->sigdata; ++ pub = dig->keydata; + if (!sig || !pub) + return 1; + mpnzero(&hm); -+ mpnsetbin(&hm, dig->sha1, dig->sha1len); ++ mpnsetbin(&hm, hash, hashlen); + res = dsavrfy(&pub->p, &pub->q, &pub->g, &hm, &pub->y, &sig->r, &sig->s) == 1 ? 0 : 1; + mpnfree(&hm); + return res; @@ -839,6 +698,7 @@ + */ +struct DIGEST_CTX_s { + rpmDigestFlags flags; /*!< Bit(s) to control digest operation. */ ++ pgpHashAlgo algo; /*!< Used hash algorithm */ + 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. */ @@ -888,6 +748,7 @@ + int xx; + + ctx->flags = flags; ++ ctx->algo = hashalgo; + + switch (hashalgo) { + case PGPHASHALGO_MD5: @@ -1009,9 +870,9 @@ + 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 @@ +--- ./rpmio/digest_nss.c.orig 2010-03-24 15:39:14.000000000 +0000 ++++ ./rpmio/digest_nss.c 2010-03-24 16:14:36.000000000 +0000 +@@ -0,0 +1,500 @@ +#include +#include +#include @@ -1165,6 +1026,20 @@ + return 0; +} + ++void pgpCleanRSADSA(pgpDig dig) ++{ ++ if (!dig) ++ return; ++ if (dig->keydata) { ++ SECKEY_DestroyPublicKey(dig->keydata); ++ dig->keydata = NULL; ++ } ++ if (dig->sigdata) { ++ SECITEM_ZfreeItem(dig->sigdata, PR_TRUE); ++ dig->sigdata = NULL; ++ } ++} ++ +/****************************** RSA **************************************/ + +int @@ -1174,9 +1049,9 @@ + + if (num != 0) + return 1; -+ sig = dig->rsasig; ++ sig = dig->rsasigdata; + sig = pgpMpiItem(NULL, sig, p); -+ dig->rsasig = sig; ++ dig->rsasigdata = sig; + if (sig == NULL) + return 1; + return 0; @@ -1187,42 +1062,30 @@ +{ + SECKEYPublicKey *pub; + -+ if (!dig->rsa) -+ dig->rsa = pgpNewPublicKey(rsaKey); -+ pub = dig->rsa; ++ if (!dig->keydata) ++ dig->keydata = pgpNewPublicKey(rsaKey); ++ pub = dig->keydata; + if (!pub) + return 1; + switch(num) { + case 0: -+ pgpMpiItem(dig->rsa->arena, &pub->u.rsa.modulus, p); ++ pgpMpiItem(pub->arena, &pub->u.rsa.modulus, p); + return 0; + case 1: -+ pgpMpiItem(dig->rsa->arena, &pub->u.rsa.publicExponent, p); ++ pgpMpiItem(pub->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) ++int pgpVerifyRSA(pgpDig dig, uint8_t *hash, size_t hashlen) +{ + SECOidTag sigalg; + SECItem digest; ++ SECKEYPublicKey *pub; + SECItem *sig; ++ SECItem *newsig = NULL; + size_t siglen; + int res; + @@ -1251,29 +1114,31 @@ + break; + } + digest.type = siBuffer; -+ digest.data = dig->md5; -+ digest.len = dig->md5len; ++ digest.data = hash; ++ digest.len = hashlen; + -+ sig = dig->rsasig; -+ siglen = SECKEY_SignatureLen(dig->rsa); ++ pub = dig->keydata; ++ sig = dig->sigdata; ++ siglen = SECKEY_SignatureLen(dig->keydata); + + /* 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) { ++ if ((newsig = SECITEM_AllocItem(NULL, NULL, siglen)) == NULL) { + return 1; + } -+ memset(sig->data, 0, pad); -+ memcpy(sig->data+pad, dig->rsasig->data, dig->rsasig->len); ++ memset(newsig->data, 0, pad); ++ memcpy(newsig->data+pad, sig->data, sig->len); ++ sig = newsig; + } + -+ if (VFY_VerifyDigest(&digest, dig->rsa, sig, sigalg, NULL) == SECSuccess) ++ if (VFY_VerifyDigest(&digest, pub, sig, sigalg, NULL) == SECSuccess) + res = 0; + else + res = 1; + -+ if (sig != dig->rsasig) { -+ SECITEM_ZfreeItem(sig, 1); ++ if (newsig) { ++ SECITEM_ZfreeItem(newsig, 1); + } + return res; +} @@ -1289,12 +1154,12 @@ + switch(num) { + case 0: + sig = SECITEM_AllocItem(NULL, NULL, 2*DSA_SUBPRIME_LEN); -+ dig->dsasig = sig; ++ dig->sigdata = 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; ++ sig = dig->sigdata; + if (!sig) + return 1; + pgpMpiSet(DSA_SUBPRIME_LEN*8, sig->data + DSA_SUBPRIME_LEN, p, pend); @@ -1304,7 +1169,7 @@ + if (DSAU_EncodeDerSig(new, sig) != SECSuccess) + return 1; + SECITEM_FreeItem(sig, PR_TRUE); -+ dig->dsasig = new; ++ dig->sigdata = new; + return 0; + default: + return 1; @@ -1316,9 +1181,9 @@ +{ + SECKEYPublicKey *pub; + -+ if (!dig->dsa) -+ dig->dsa = pgpNewPublicKey(dsaKey); -+ pub = dig->dsa; ++ if (!dig->keydata) ++ dig->keydata = pgpNewPublicKey(dsaKey); ++ pub = dig->keydata; + if (!pub) + return 1; + switch(num) { @@ -1339,28 +1204,18 @@ + } +} + -+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) ++int pgpVerifyDSA(pgpDig dig, uint8_t *hash, size_t hashlen) +{ + SECItem digest; ++ SECKEYPublicKey *pub; ++ SECItem *sig; + ++ sig = dig->sigdata; ++ pub = dig->keydata; + 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) ++ digest.data = hash; ++ digest.len = hashlen; ++ if (VFY_VerifyDigest(&digest, pub, sig, SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST, NULL) == SECSuccess) + return 0; + else + return 1; @@ -1383,6 +1238,7 @@ +struct DIGEST_CTX_s { + rpmDigestFlags flags; /*!< Bit(s) to control digest operation. */ + HASHContext *hashctx; /*!< Internal NSS hash context. */ ++ pgpHashAlgo algo; /*!< Used hash algorithm */ +}; + +DIGEST_CTX @@ -1439,26 +1295,18 @@ +rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags) +{ + HASH_HashType type; -+ DIGEST_CTX ctx; ++ HASHContext *hashctx = NULL; ++ DIGEST_CTX ctx = NULL; + -+ if (rpmInitCrypto() < 0) ++ if (type == HASH_AlgNULL || rpmInitCrypto() < 0) + return NULL; + ++ if ((hashctx = HASH_Create(type)) == NULL) ++ 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; -+ } -+ ++ ctx->algo = hashalgo; ++ ctx->hashctx = hashctx; + HASH_Begin(ctx->hashctx); + +DPRINTF((stderr, "*** Init(%x) ctx %p hashctx %p\n", flags, ctx, ctx->hashctx)); @@ -1525,8 +1373,8 @@ + 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 +--- ./rpmio/rpmpgp.c.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./rpmio/rpmpgp.c 2010-03-24 16:26:00.000000000 +0000 @@ -20,9 +20,6 @@ static int _debug = 0; static int _print = 0; @@ -1537,7 +1385,7 @@ 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 * +@@ -291,89 +288,6 @@ int pgpValTok(pgpValTbl vs, const char * } while ((++vs)->val != -1); return vs->val; } @@ -1623,21 +1471,11 @@ - 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 +@@ -569,29 +483,16 @@ static int pgpPrtSigParams(pgpTag tag, u { const uint8_t * pend = h + hlen; size_t i; @@ -1657,8 +1495,8 @@ { - switch (i) { - case 0: /* m**d */ -- _dig->rsasig = pgpMpiItem(NULL, _dig->rsasig, p); -- if (_dig->rsasig == NULL) +- _dig->sigdata = pgpMpiItem(NULL, _dig->sigdata, p); +- if (_dig->sigdata == NULL) - return 1; - break; - default: @@ -1669,7 +1507,7 @@ } pgpPrtStr("", pgpSigRSA[i]); } else if (pubkey_algo == PGPPUBKEYALGO_DSA) { -@@ -609,30 +500,8 @@ static int pgpPrtSigParams(pgpTag tag, u +@@ -599,30 +500,8 @@ static int pgpPrtSigParams(pgpTag tag, u if (_dig && (sigtype == PGPSIGTYPE_BINARY || sigtype == PGPSIGTYPE_TEXT)) { @@ -1683,13 +1521,13 @@ - 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) { +- if (_dig->sigdata != NULL) +- SECITEM_FreeItem(_dig->sigdata, PR_FALSE); +- else if ((_dig->sigdata=SECITEM_AllocItem(NULL, NULL, 0)) == NULL) { - xx = 1; - break; - } -- if (DSAU_EncodeDerSig(_dig->dsasig, &dsaraw) != SECSuccess) +- if (DSAU_EncodeDerSig(_dig->sigdata, &dsaraw) != SECSuccess) - xx = 1; - break; - default: @@ -1702,22 +1540,22 @@ } pgpPrtStr("", pgpSigDSA[i]); } else { -@@ -824,49 +693,11 @@ static const uint8_t * pgpPrtPubkeyParam +@@ -814,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) +- if (_dig->keydata == NULL) { +- _dig->keydata = pgpNewPublicKey(rsaKey); +- if (_dig->keydata == NULL) - break; /* error abort? */ - } - switch (i) { - case 0: /* n */ -- pgpMpiItem(_dig->rsa->arena, &_dig->rsa->u.rsa.modulus, p); +- pgpMpiItem(_dig->keydata->arena, &_dig->keydata->u.rsa.modulus, p); - break; - case 1: /* e */ -- pgpMpiItem(_dig->rsa->arena, &_dig->rsa->u.rsa.publicExponent, p); +- pgpMpiItem(_dig->keydata->arena, &_dig->keydata->u.rsa.publicExponent, p); - break; - default: - break; @@ -1728,23 +1566,23 @@ } else if (pubkey_algo == PGPPUBKEYALGO_DSA) { if (i >= 4) break; - if (_dig) { -- if (_dig->dsa == NULL) { -- _dig->dsa = pgpNewDSAKey(); -- if (_dig->dsa == NULL) +- if (_dig->keydata == NULL) { +- _dig->keydata = pgpNewPublicKey(dsaKey); +- if (_dig->keydata == NULL) - break; /* error abort? */ - } - switch (i) { - case 0: /* p */ -- pgpMpiItem(_dig->dsa->arena, &_dig->dsa->u.dsa.params.prime, p); +- pgpMpiItem(_dig->keydata->arena, &_dig->keydata->u.dsa.params.prime, p); - break; - case 1: /* q */ -- pgpMpiItem(_dig->dsa->arena, &_dig->dsa->u.dsa.params.subPrime, p); +- pgpMpiItem(_dig->keydata->arena, &_dig->keydata->u.dsa.params.subPrime, p); - break; - case 2: /* g */ -- pgpMpiItem(_dig->dsa->arena, &_dig->dsa->u.dsa.params.base, p); +- pgpMpiItem(_dig->keydata->arena, &_dig->keydata->u.dsa.params.base, p); - break; - case 3: /* y */ -- pgpMpiItem(_dig->dsa->arena, &_dig->dsa->u.dsa.publicValue, p); +- pgpMpiItem(_dig->keydata->arena, &_dig->keydata->u.dsa.publicValue, p); - break; - default: - break; @@ -1754,35 +1592,101 @@ 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); +@@ -1241,15 +1082,7 @@ void pgpCleanDig(pgpDig dig) + memset(&dig->signature, 0, sizeof(dig->signature)); + memset(&dig->pubkey, 0, sizeof(dig->pubkey)); -- if (dig->dsa != NULL) { -- SECKEY_DestroyPublicKey(dig->dsa); -- dig->dsa = NULL; +- if (dig->keydata != NULL) { +- SECKEY_DestroyPublicKey(dig->keydata); +- dig->keydata = NULL; - } - -- if (dig->dsasig != NULL) { -- SECITEM_ZfreeItem(dig->dsasig, PR_TRUE); -- dig->dsasig = NULL; +- if (dig->sigdata != NULL) { +- SECITEM_ZfreeItem(dig->sigdata, PR_TRUE); +- dig->sigdata = 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); - ++ pgpCleanRSADSA(dig); } return; -@@ -1501,50 +1315,3 @@ char * pgpArmorWrap(int atype, const uns + } +@@ -1291,39 +1124,6 @@ int pgpPrtPkts(const uint8_t * pkts, siz + return 0; + } + +-static SECOidTag getSigAlg(pgpDigParams sigp) +-{ +- SECOidTag sigalg = SEC_OID_UNKNOWN; +- if (sigp->pubkey_algo == PGPPUBKEYALGO_DSA) { +- /* assume SHA1 for now, NSS doesn't have SECOID's for other types */ +- sigalg = SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST; +- } else if (sigp->pubkey_algo == PGPPUBKEYALGO_RSA) { +- switch (sigp->hash_algo) { +- case PGPHASHALGO_MD5: +- sigalg = SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION; +- break; +- case PGPHASHALGO_MD2: +- sigalg = SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION; +- break; +- case PGPHASHALGO_SHA1: +- sigalg = SEC_OID_PKCS1_SHA1_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; +- default: +- break; +- } +- } +- return sigalg; +-} +- + char *pgpIdentItem(pgpDigParams digp) + { + char *id = NULL; +@@ -1372,30 +1172,12 @@ rpmRC pgpVerifySig(pgpDig dig, DIGEST_CT + + /* Compare leading 16 bits of digest for quick check. */ + if (hash && memcmp(hash, sigp->signhash16, 2) == 0) { +- SECItem digest = { .type = siBuffer, .data = hash, .len = hashlen }; +- SECItem *sig = dig->sigdata; +- +- /* Zero-pad RSA signature to expected size if necessary */ +- if (sigp->pubkey_algo == PGPPUBKEYALGO_RSA) { +- size_t siglen = SECKEY_SignatureLen(dig->keydata); +- if (siglen > sig->len) { +- size_t pad = siglen - sig->len; +- if ((sig = SECITEM_AllocItem(NULL, NULL, siglen)) == NULL) { +- goto exit; +- } +- memset(sig->data, 0, pad); +- memcpy(sig->data+pad, dig->sigdata->data, dig->sigdata->len); +- } +- } +- +- /* XXX VFY_VerifyDigest() is deprecated in NSS 3.12 */ +- if (VFY_VerifyDigest(&digest, dig->keydata, sig, +- getSigAlg(sigp), NULL) == SECSuccess) { +- res = RPMRC_OK; +- } +- +- if (sig != dig->sigdata) { +- SECITEM_ZfreeItem(sig, 1); ++ if (sigp->pubkey_algo == PGPPUBKEYALGO_RSA) { ++ if (!pgpVerifyRSA(dig, hash, hashlen)) ++ res = RPMRC_OK; ++ } else if (sigp->pubkey_algo == PGPPUBKEYALGO_DSA) { ++ if (!pgpVerifyDSA(dig, hash, hashlen)) ++ res = RPMRC_OK; + } + } + +@@ -1580,50 +1362,3 @@ char * pgpArmorWrap(int atype, const uns return val; } diff --git a/rpm-python.spec b/rpm-python.spec index 6eb1eca..59e5970 100644 --- a/rpm-python.spec +++ b/rpm-python.spec @@ -25,7 +25,7 @@ License: GPLv2+ Group: System/Packages Summary: Python Bindings for Manipulating RPM Packages Version: 4.7.1 -Release: 8 +Release: 9 Requires: rpm = %{version} %py_requires Source99: rpm.spec diff --git a/rpm.changes b/rpm.changes index 3102d6a..57a3ca6 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Mar 26 11:49:59 CET 2010 - mls@suse.de + +- update to rpm-4.8.0 + * updated python bindings + * new transaction ordering code + +------------------------------------------------------------------- +Wed Feb 24 11:57:30 CET 2010 - mls@suse.de + +- fix readLine segfault [bnc#582599] + ------------------------------------------------------------------- Sat Dec 12 23:42:26 CET 2009 - jengelh@medozas.de diff --git a/rpm.spec b/rpm.spec index 2f23318..fd317cf 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,5 +1,5 @@ # -# spec file for package rpm (Version 4.7.1) +# spec file for package rpm (Version 4.8.0) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -27,8 +27,8 @@ Provides: rpminst PreReq: %insserv_prereq %fillup_prereq permissions AutoReqProv: on Summary: The RPM Package Manager -Version: 4.7.1 -Release: 8 +Version: 4.8.0 +Release: 1 Source: rpm-%{version}.tar.bz2 Source1: RPM-HOWTO.tar.bz2 Source2: RPM-Tips.html.tar.bz2 @@ -98,10 +98,11 @@ Patch61: debugsubpkg.diff Patch62: debuglink.diff Patch63: debuginfo-mono.patch Patch64: allowufdio.diff -Patch65: fixabsfilelists.diff -Patch66: fixqueryreturn.diff -Patch67: lazystatfs.diff -Patch68: defclean.diff +Patch65: lazystatfs.diff +Patch66: defclean.diff +Patch67: readlineofi.diff +Patch68: rpmdb-no-svc.diff +Patch69: modemuncher.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # # avoid bootstrapping problem @@ -161,7 +162,7 @@ rm -f rpmdb/db.h %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 +%patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69 #chmod 755 scripts/find-supplements{,.ksyms} #chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms #chmod 755 scripts/firmware.prov @@ -179,7 +180,7 @@ export LDFLAGS="-Wl,-Bsymbolic-functions -ffunction-sections" %ifarch alpha export CFLAGS="-g -O0 -fno-strict-aliasing" %endif -cp /usr/share/gettext/config.rpath . +#cp -p /usr/share/gettext/config.rpath . cp autogen.sh beecrypt pushd beecrypt ./autogen.sh --with-pic diff --git a/rpmdb-no-svc.diff b/rpmdb-no-svc.diff new file mode 100644 index 0000000..f2a4787 --- /dev/null +++ b/rpmdb-no-svc.diff @@ -0,0 +1,19 @@ +--- lib/Makefile.am.orig 2010-03-26 09:34:16.000000000 +0000 ++++ lib/Makefile.am 2010-03-26 09:34:39.000000000 +0000 +@@ -148,16 +148,6 @@ rpmdb_stat_LDADD = \ + $(top_builddir)/db3/util_sig.o \ + librpm.la + +-rpmlibexec_PROGRAMS += rpmdb_svc +-rpmdb_svc_SOURCES = +-rpmdb_svc_LDADD = \ +- $(top_builddir)/db3/db_server_proc.o \ +- $(top_builddir)/db3/db_server_svc.o \ +- $(top_builddir)/db3/db_server_util.o \ +- $(top_builddir)/db3/gen_db_server.o \ +- $(top_builddir)/db3/util_log.o \ +- librpm.la +- + rpmlibexec_PROGRAMS += rpmdb_upgrade + rpmdb_upgrade_SOURCES = + rpmdb_upgrade_LDADD = \ diff --git a/suspendlock.diff b/suspendlock.diff index 5b5f015..3346b01 100644 --- a/suspendlock.diff +++ b/suspendlock.diff @@ -5,64 +5,9 @@ locking. I hijacked the dbiSync function for this because I did not want to change the ABI. -Index: lib/psm.c -=================================================================== ---- lib/psm.c.orig -+++ lib/psm.c -@@ -756,6 +756,8 @@ static rpmRC runScript(rpmpsm psm, Heade - goto exit; - } - -+ rpmtsSuspendResumeDBLock(psm->ts, 0); -+ - xx = rpmsqFork(&psm->sq); - if (psm->sq.child == 0) { - 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); -+ - 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 -@@ -108,6 +108,11 @@ int rpmtsOpenDB(rpmts ts, int dbmode) - return rc; - } - -+int rpmtsSuspendResumeDBLock(rpmts ts, int mode) -+{ -+ return rpmdbSuspendResumeDBLock(ts->rdb, mode); -+} -+ - int rpmtsInitDB(rpmts ts, int dbmode) - { - void *lock = rpmtsAcquireLock(ts); -Index: lib/rpmts.h -=================================================================== ---- lib/rpmts.h.orig -+++ lib/rpmts.h -@@ -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 - * Update disk space info for a file. - * @param ts transaction set -Index: lib/backend/db3.c -=================================================================== ---- lib/backend/db3.c.orig -+++ lib/backend/db3.c -@@ -398,12 +398,18 @@ errxit: +--- ./lib/backend/db3.c.orig 2010-03-25 14:35:39.000000000 +0000 ++++ ./lib/backend/db3.c 2010-03-25 14:44:42.000000000 +0000 +@@ -208,11 +208,17 @@ errxit: return rc; } @@ -72,16 +17,15 @@ Index: lib/backend/db3.c { DB * db = dbi->dbi_db; int rc = 0; - int _printit; + if (flags == (unsigned int)-1) + return db3SuspendResumeLock(dbi, 0); + if (flags == (unsigned int)-2) + return db3SuspendResumeLock(dbi, 1); - if (db != NULL) + if (db != NULL) { rc = db->sync(db, flags); - /* XXX DB_INCOMPLETE is returned occaisionally with multiple access. */ -@@ -1122,6 +1128,50 @@ static int db3open(rpmdb rpmdb, rpmTag r + rc = cvtdberr(dbi, "db->sync", rc, _debug); +@@ -848,6 +854,48 @@ static int db3open(rpmdb rpmdb, rpmTag r return rc; } @@ -97,8 +41,6 @@ Index: lib/backend/db3.c + return 0; + if (!(dbi->dbi_mode & (O_RDWR|O_WRONLY))) + return 0; -+ if ((dbi->dbi_ecflags & DB_CLIENT) && dbi->dbi_host) -+ return 0; + if (dbi->dbi_use_dbenv && _lockdbfd == 0) + return 0; + if (!(dbi->dbi_db->fd(dbi->dbi_db, &fdno) == 0 && fdno >= 0)) @@ -132,11 +74,29 @@ Index: lib/backend/db3.c /** \ingroup db3 */ RPM_GNUC_INTERNAL -Index: lib/rpmdb.c -=================================================================== ---- lib/rpmdb.c.orig -+++ lib/rpmdb.c -@@ -886,6 +886,21 @@ int rpmdbSync(rpmdb db) +--- ./lib/psm.c.orig 2010-03-25 14:43:29.000000000 +0000 ++++ ./lib/psm.c 2010-03-25 14:43:41.000000000 +0000 +@@ -754,6 +754,8 @@ static rpmRC runScript(rpmpsm psm, Heade + goto exit; + } + ++ rpmtsSuspendResumeDBLock(psm->ts, 0); ++ + xx = rpmsqFork(&psm->sq); + if (psm->sq.child == 0) { + rpmlog(RPMLOG_DEBUG, "%s: %s\texecv(%s) pid %d\n", +@@ -768,6 +770,8 @@ static rpmRC runScript(rpmpsm psm, Heade + + (void) psmWait(psm); + ++ rpmtsSuspendResumeDBLock(psm->ts, 1); ++ + 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)); +--- ./lib/rpmdb.c.orig 2010-03-25 14:36:57.000000000 +0000 ++++ ./lib/rpmdb.c 2010-03-25 14:43:41.000000000 +0000 +@@ -903,6 +903,21 @@ int rpmdbSync(rpmdb db) return rc; } @@ -158,3 +118,30 @@ Index: lib/rpmdb.c /* FIX: dbTemplate structure assignment */ static rpmdb newRpmdb(const char * root, +--- ./lib/rpmts.c.orig 2009-12-17 09:05:37.000000000 +0000 ++++ ./lib/rpmts.c 2010-03-25 14:43:41.000000000 +0000 +@@ -89,6 +89,11 @@ int rpmtsOpenDB(rpmts ts, int dbmode) + return rc; + } + ++int rpmtsSuspendResumeDBLock(rpmts ts, int mode) ++{ ++ return rpmdbSuspendResumeDBLock(ts->rdb, mode); ++} ++ + int rpmtsInitDB(rpmts ts, int dbmode) + { + void *lock = rpmtsAcquireLock(ts); +--- ./lib/rpmts.h.orig 2009-12-17 09:05:37.000000000 +0000 ++++ ./lib/rpmts.h 2010-03-25 14:43:41.000000000 +0000 +@@ -469,6 +469,10 @@ rpmdb rpmtsGetRdb(rpmts ts); + void * rpmtsNotify(rpmts ts, rpmte te, + rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total); + ++int rpmtsSuspendResumeDBLock(rpmts ts, int mode) ++ /*@globals fileSystem @*/ ++ /*@modifies fileSystem @*/; ++ + /** \ingroup rpmts + * Return number of (ordered) transaction set elements. + * @param ts transaction set diff --git a/taggedfileindex.diff b/taggedfileindex.diff index b158377..52fe192 100644 --- a/taggedfileindex.diff +++ b/taggedfileindex.diff @@ -2,11 +2,9 @@ The taggedfileindex patch. Speeds up database searches, but breaks fingerprint semantics. rh#103204 -Index: lib/rpmdb.c -=================================================================== ---- lib/rpmdb.c.orig -+++ lib/rpmdb.c -@@ -1107,6 +1107,16 @@ int rpmdbVerify(const char * prefix) +--- ./lib/rpmdb.c.orig 2010-03-25 14:43:41.000000000 +0000 ++++ ./lib/rpmdb.c 2010-03-25 15:15:14.000000000 +0000 +@@ -1122,6 +1122,16 @@ int rpmdbVerify(const char * prefix) return rc; } @@ -23,7 +21,7 @@ Index: lib/rpmdb.c /** * Find file matches in database. * @param db rpm database -@@ -1169,6 +1179,11 @@ static int rpmdbFindByFile(rpmdb db, con +@@ -1181,6 +1191,11 @@ static int rpmdbFindByFile(rpmdb db, con if (rc == 0) (void) dbt2set(dbi, data, &allMatches); @@ -35,16 +33,16 @@ Index: lib/rpmdb.c xx = dbiCclose(dbi, dbcursor, 0); dbcursor = NULL; } else -@@ -2172,7 +2187,7 @@ void rpmdbSortIterator(rpmdbMatchIterato +@@ -2182,7 +2197,7 @@ void rpmdbSortIterator(rpmdbMatchIterato + } } - /* LCL: segfault */ -static int rpmdbGrowIterator(rpmdbMatchIterator mi) +static int rpmdbGrowIterator(rpmdbMatchIterator mi, unsigned int tag) { DBC * dbcursor; DBT * key; -@@ -2222,6 +2237,27 @@ static int rpmdbGrowIterator(rpmdbMatchI +@@ -2232,6 +2247,27 @@ static int rpmdbGrowIterator(rpmdbMatchI dbcursor = NULL; #endif @@ -72,7 +70,7 @@ Index: lib/rpmdb.c if (mi->mi_set == NULL) { mi->mi_set = set; } else { -@@ -2403,7 +2439,15 @@ int rpmdbExtendIterator(rpmdbMatchIterat +@@ -2413,7 +2449,15 @@ int rpmdbExtendIterator(rpmdbMatchIterat { mi->mi_key.data = (void *) keyp; mi->mi_key.size = keylen ? keylen : strlen(keyp); @@ -89,7 +87,7 @@ Index: lib/rpmdb.c } /* -@@ -2798,8 +2842,16 @@ int rpmdbAdd(rpmdb db, int iid, Header h +@@ -2808,8 +2852,16 @@ int rpmdbAdd(rpmdb db, int iid, Header h if (hdrNum) { @@ -106,7 +104,7 @@ Index: lib/rpmdb.c 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 +@@ -2901,6 +2953,10 @@ int rpmdbAdd(rpmdb db, int iid, Header h */ i = rec->tagNum = rpmtdGetIndex(&tagdata); switch (rpmtag) { @@ -117,7 +115,7 @@ Index: lib/rpmdb.c case RPMTAG_REQUIRENAME: { /* Filter out install prerequisites. */ rpm_flag_t *rflag = rpmtdNextUint32(&reqflags); -@@ -2976,6 +3032,9 @@ cont: +@@ -2986,6 +3042,9 @@ cont: if (ret == 0) { headerSetInstance(h, hdrNum); } @@ -127,11 +125,9 @@ Index: lib/rpmdb.c } exit: -Index: lib/rpmdb_internal.h -=================================================================== ---- lib/rpmdb_internal.h.orig -+++ lib/rpmdb_internal.h -@@ -540,6 +540,9 @@ unsigned int dbiIndexRecordFileNumber(db +--- ./lib/rpmdb_internal.h.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./lib/rpmdb_internal.h 2010-03-25 15:14:38.000000000 +0000 +@@ -542,6 +542,9 @@ const char *rpmdbHome(rpmdb db); int rpmdbExtendIterator(rpmdbMatchIterator mi, const void * keyp, size_t keylen); @@ -141,13 +137,11 @@ Index: lib/rpmdb_internal.h /** \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( +--- ./lib/transaction.c.orig 2010-03-25 14:38:27.000000000 +0000 ++++ ./lib/transaction.c 2010-03-25 15:14:38.000000000 +0000 +@@ -848,9 +848,12 @@ rpmdbMatchIterator rpmFindBaseNamesInDB( rpmdbMatchIterator mi; - int i, xx; + int xx; const char * baseName; + const char * dirName; @@ -158,8 +152,8 @@ Index: lib/transaction.c mi = rpmdbInitIterator(rpmtsGetRdb(ts), RPMTAG_BASENAMES, NULL, 0); -@@ -629,18 +632,25 @@ rpmdbMatchIterator rpmFindBaseNamesInDB( - while ((i = rpmfiNext(fi)) >= 0) { +@@ -868,18 +871,25 @@ rpmdbMatchIterator rpmFindBaseNamesInDB( + while (rpmfiNext(fi) >= 0) { size_t keylen; baseName = rpmfiBN(fi); + dirName = rpmfiDN(fi); diff --git a/waitlock.diff b/waitlock.diff index d60a798..d794d21 100644 --- a/waitlock.diff +++ b/waitlock.diff @@ -1,10 +1,9 @@ Fix global (DB_PRIVATE) lock code: fix recursion counter, retry failed lock operations for up to 3 minutes. -Index: lib/backend/db3.c -=================================================================== ---- lib/backend/db3.c.orig -+++ lib/backend/db3.c -@@ -586,6 +586,8 @@ static int db3stat(dbiIndex dbi, unsigne + +--- ./lib/backend/db3.c.orig 2010-03-25 14:44:42.000000000 +0000 ++++ ./lib/backend/db3.c 2010-03-25 14:52:05.000000000 +0000 +@@ -394,6 +394,8 @@ static int db3stat(dbiIndex dbi, unsigne return rc; } @@ -13,18 +12,17 @@ Index: lib/backend/db3.c static int db3close(dbiIndex dbi, unsigned int flags) { rpmdb rpmdb = dbi->dbi_rpmdb; -@@ -632,6 +634,10 @@ static int db3close(dbiIndex dbi, unsign +@@ -414,6 +416,9 @@ static int db3close(dbiIndex dbi, unsign rpmlog(RPMLOG_DEBUG, "closed db index %s/%s\n", - dbhome, (dbfile ? dbfile : rpmTagGetName(dbi->dbi_rpmtag))); + dbhome, dbi->dbi_file); + if (dbi->dbi_lockdbfd && -+ !((dbi->dbi_ecflags & DB_CLIENT) && dbi->dbi_host) && + _lockdbfd) + _lockdbfd--; } if (rpmdb->db_dbenv != NULL && dbi->dbi_use_dbenv) { -@@ -899,8 +905,6 @@ static int db3open(rpmdb rpmdb, rpmTag r +@@ -645,8 +651,6 @@ static int db3open(rpmdb rpmdb, rpmTag r } if (rc == 0) { @@ -33,7 +31,7 @@ Index: lib/backend/db3.c rc = db_create(&db, dbenv, dbi->dbi_cflags); rc = cvtdberr(dbi, "db_create", rc, _debug); if (rc == 0 && db != NULL) { -@@ -1082,6 +1086,7 @@ static int db3open(rpmdb rpmdb, rpmTag r +@@ -810,6 +814,7 @@ static int db3open(rpmdb rpmdb, rpmTag r if (!(db->fd(db, &fdno) == 0 && fdno >= 0)) { rc = 1; } else { @@ -41,7 +39,7 @@ Index: lib/backend/db3.c struct flock l; memset(&l, 0, sizeof(l)); l.l_whence = 0; -@@ -1091,24 +1096,40 @@ static int db3open(rpmdb rpmdb, rpmTag r +@@ -819,24 +824,39 @@ static int db3open(rpmdb rpmdb, rpmTag r ? F_RDLCK : F_WRLCK; l.l_pid = 0; @@ -49,27 +47,29 @@ Index: lib/backend/db3.c - if (rc) { - /* Warning iff using non-private CDB locking. */ - rc = ((dbi->dbi_use_dbenv && -+ for (tries = 0; ; tries++) { -+ rc = fcntl(fdno, F_SETLK, (void *) &l); -+ if (rc) { -+ 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) { +- dbhome, dbi->dbi_file); +- } else { - rpmlog(RPMLOG_DEBUG, - "locked db index %s/%s\n", -- dbhome, dbfile); +- dbhome, dbi->dbi_file); ++ for (tries = 0; ; tries++) { ++ rc = fcntl(fdno, F_SETLK, (void *) &l); ++ if (rc) { ++ rc = ((dbi->dbi_use_dbenv && ++ (dbi->dbi_eflags & DB_INIT_CDB) && ++ !(dbi->dbi_eflags & DB_PRIVATE)) + ? 0 : 1); + if (errno == EAGAIN && rc) { + struct timespec ts; + if (tries == 0) -+ rpmlog(RPMLOG_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, dbi->dbi_file); + ts.tv_sec = (time_t)0; + ts.tv_nsec = 100000000; + if (tries < 10*60*3) { @@ -81,14 +81,13 @@ Index: lib/backend/db3.c + _("cannot get %s lock on %s/%s\n"), + ((dbi->dbi_mode & O_ACCMODE) == O_RDONLY) + ? _("shared") : _("exclusive"), -+ dbhome, (dbfile ? dbfile : "")); -+ } else if (dbfile) { ++ dbhome, dbi->dbi_file); ++ } else { + rpmlog(RPMLOG_DEBUG, + "locked db index %s/%s\n", -+ dbhome, dbfile); -+ break; ++ dbhome, dbi->dbi_file); + } -+ ++ break; } } + if (rc && dbi->dbi_use_dbenv) diff --git a/weakdeps.diff b/weakdeps.diff index 179f088..22bd9bc 100644 --- a/weakdeps.diff +++ b/weakdeps.diff @@ -14,11 +14,9 @@ B) use RPMSENSE_STRONG to support a "strong" version, "Recommends" Needs extcond.diff for query operations. -Index: build/parsePreamble.c -=================================================================== ---- build/parsePreamble.c.orig -+++ build/parsePreamble.c -@@ -122,6 +122,8 @@ static struct tokenBits_s const installS +--- ./build/parsePreamble.c.orig 2009-12-17 09:05:55.000000000 +0000 ++++ ./build/parsePreamble.c 2010-03-25 14:56:24.000000000 +0000 +@@ -124,6 +124,8 @@ static struct tokenBits_s const installS { "post", RPMSENSE_SCRIPT_POST }, { "rpmlib", RPMSENSE_RPMLIB }, { "verify", RPMSENSE_SCRIPT_VERIFY }, @@ -27,7 +25,7 @@ Index: build/parsePreamble.c { NULL, 0 } }; -@@ -132,6 +134,8 @@ static const struct tokenBits_s const bu +@@ -134,6 +136,8 @@ static const struct tokenBits_s const bu { "build", RPMSENSE_SCRIPT_BUILD }, { "install", RPMSENSE_SCRIPT_INSTALL }, { "clean", RPMSENSE_SCRIPT_CLEAN }, @@ -36,7 +34,7 @@ Index: build/parsePreamble.c { NULL, 0 } }; -@@ -637,6 +641,18 @@ static int handlePreambleTag(rpmSpec spe +@@ -649,6 +653,18 @@ static int handlePreambleTag(rpmSpec spe if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags))) return rc; break; @@ -55,26 +53,24 @@ Index: build/parsePreamble.c case RPMTAG_EXCLUDEARCH: case RPMTAG_EXCLUSIVEARCH: case RPMTAG_EXCLUDEOS: -@@ -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_SUGGESTSFLAGS, 0, 0, 0, "recommends"}, -+ {RPMTAG_SUGGESTSFLAGS, 0, 0, 0, "suggests"}, -+ {RPMTAG_ENHANCESFLAGS, 0, 0, 0, "supplements"}, -+ {RPMTAG_ENHANCESFLAGS, 0, 0, 0, "enhances"}, -+ {RPMTAG_BUILDSUGGESTS, 0, 0, 0, "buildrecommends"}, -+ {RPMTAG_BUILDSUGGESTS, 0, 0, 0, "buildsuggests"}, -+ {RPMTAG_BUILDENHANCES, 0, 0, 0, "buildsupplements"}, -+ {RPMTAG_BUILDENHANCES, 0, 0, 0, "buildenhances"}, - /* LCL: can't add null annotation */ - {0, 0, 0, 0, 0} +@@ -748,6 +764,14 @@ static struct PreambleRec_s const preamb + {RPMTAG_DOCDIR, 0, 0, LEN_AND_STR("docdir")}, + {RPMTAG_DISTTAG, 0, 0, LEN_AND_STR("disttag")}, + {RPMTAG_BUGURL, 0, 0, LEN_AND_STR("bugurl")}, ++ {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("recommends")}, ++ {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("suggests")}, ++ {RPMTAG_ENHANCESFLAGS, 0, 0, LEN_AND_STR("supplements")}, ++ {RPMTAG_ENHANCESFLAGS, 0, 0, LEN_AND_STR("enhances")}, ++ {RPMTAG_BUILDSUGGESTS, 0, 0, LEN_AND_STR("buildrecommends")}, ++ {RPMTAG_BUILDSUGGESTS, 0, 0, LEN_AND_STR("buildsuggests")}, ++ {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildsupplements")}, ++ {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildenhances")}, + {0, 0, 0, 0} }; -Index: build/parseReqs.c -=================================================================== ---- build/parseReqs.c.orig -+++ build/parseReqs.c -@@ -84,6 +84,14 @@ rpmRC parseRCPOT(rpmSpec spec, Package p + +--- ./build/parseReqs.c.orig 2009-12-17 09:05:55.000000000 +0000 ++++ ./build/parseReqs.c 2010-03-25 14:53:47.000000000 +0000 +@@ -85,6 +85,14 @@ rpmRC parseRCPOT(rpmSpec spec, Package p tagflags |= RPMSENSE_ANY; h = spec->buildRestrictions; break; @@ -89,11 +85,9 @@ Index: build/parseReqs.c default: case RPMTAG_REQUIREFLAGS: tagflags |= RPMSENSE_ANY; -Index: build/reqprov.c -=================================================================== ---- build/reqprov.c.orig -+++ build/reqprov.c -@@ -43,6 +43,16 @@ int addReqProv(rpmSpec spec, Header h, r +--- ./build/reqprov.c.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./build/reqprov.c 2010-03-25 14:53:47.000000000 +0000 +@@ -75,6 +75,16 @@ int addReqProv(rpmSpec spec, Header h, r flagtag = RPMTAG_TRIGGERFLAGS; indextag = RPMTAG_TRIGGERINDEX; extra = Flags & RPMSENSE_TRIGGER; @@ -110,11 +104,9 @@ Index: build/reqprov.c } else { nametag = RPMTAG_REQUIRENAME; versiontag = RPMTAG_REQUIREVERSION; -Index: build/rpmfc.c -=================================================================== ---- build/rpmfc.c.orig -+++ build/rpmfc.c -@@ -1377,6 +1377,12 @@ static struct DepMsg_s depMsgs[] = { +--- ./build/rpmfc.c.orig 2009-12-09 13:37:25.000000000 +0000 ++++ ./build/rpmfc.c 2010-03-25 14:53:47.000000000 +0000 +@@ -1405,6 +1405,12 @@ static struct DepMsg_s depMsgs[] = { { "Obsoletes", { "%{?__find_obsoletes}", NULL, NULL, NULL }, RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OBSOLETEFLAGS, 0, -1 }, @@ -127,7 +119,7 @@ Index: build/rpmfc.c { NULL, { NULL, NULL, NULL, NULL }, 0, 0, 0, 0, 0 } }; -@@ -1467,6 +1473,14 @@ static int rpmfcGenerateDependsHelper(co +@@ -1490,6 +1496,14 @@ static int rpmfcGenerateDependsHelper(co failnonzero = 0; tagflags = RPMSENSE_FIND_REQUIRES; break; @@ -142,66 +134,9 @@ Index: build/rpmfc.c default: continue; break; -Index: python/rpmmodule.c -=================================================================== ---- python/rpmmodule.c.orig -+++ python/rpmmodule.c -@@ -387,7 +387,7 @@ void init_rpm(void) - REGISTER_ENUM(RPMSENSE_RPMLIB); - REGISTER_ENUM(RPMSENSE_TRIGGERPREIN); - REGISTER_ENUM(RPMSENSE_KEYRING); -- REGISTER_ENUM(RPMSENSE_PATCHES); -+ REGISTER_ENUM(RPMSENSE_STRONG); - REGISTER_ENUM(RPMSENSE_CONFIG); - - REGISTER_ENUM(RPMTRANS_FLAG_TEST); -Index: lib/rpmds.c -=================================================================== ---- lib/rpmds.c.orig -+++ lib/rpmds.c -@@ -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 -@@ -65,6 +65,22 @@ rpm alias --requires --qf \ - --POPTdesc=$"list capabilities required by package(s)" - rpm alias -R --requires - -+rpm alias --suggests --qf \ -+ "[%|SUGGESTSFLAGS:depflag_strong?{}:{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \ -+ --POPTdesc=$"list capabilities this package suggests" -+ -+rpm alias --recommends --qf \ -+ "[%|SUGGESTSFLAGS:depflag_strong?{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \ -+ --POPTdesc=$"list capabilities this package recommends" -+ -+rpm alias --enhances --qf \ -+ "[%|ENHANCESFLAGS:depflag_strong?{}:{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \ -+ --POPTdesc=$"list capabilities this package enhances" -+ -+rpm alias --supplements --qf \ -+ "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \ -+ --POPTdesc=$"list capabilities this package supplements" -+ - 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\ -Index: lib/formats.c -=================================================================== ---- lib/formats.c.orig -+++ lib/formats.c -@@ -601,6 +601,25 @@ static char * depflagsFormat(rpmtd td, c +--- ./lib/formats.c.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./lib/formats.c 2010-03-25 15:00:15.000000000 +0000 +@@ -601,6 +601,24 @@ static char * depflagsFormat(rpmtd td, c return val; } @@ -220,24 +155,34 @@ Index: lib/formats.c + strcat(formatPrefix, "s"); + rasprintf(&val, formatPrefix, buf); + } -+ + return val; +} + /** * 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 }, +@@ -738,5 +756,6 @@ static const struct headerFormatFunc_s r { RPMTD_FORMAT_ARRAYSIZE, "arraysize", arraysizeFormat }, -+ { RPMTD_FORMAT_DEPFLAG_STRONG, "depflag_strong", { depflag_strongFormat } }, + { RPMTD_FORMAT_FSTATE, "fstate", fstateFormat }, + { RPMTD_FORMAT_VFLAGS, "vflags", vflagsFormat }, ++ { RPMTD_FORMAT_DEPFLAG_STRONG, "depflag_strong", depflag_strongFormat }, { -1, NULL, NULL } }; -Index: lib/rpmds.h -=================================================================== ---- lib/rpmds.h.orig -+++ lib/rpmds.h +--- ./lib/rpmds.c.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./lib/rpmds.c 2010-03-25 14:53:47.000000000 +0000 +@@ -66,6 +66,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; + } +--- ./lib/rpmds.h.orig 2010-03-24 16:47:28.000000000 +0000 ++++ ./lib/rpmds.h 2010-03-25 14:53:47.000000000 +0000 @@ -55,7 +55,7 @@ typedef enum rpmsenseFlags_e { RPMSENSE_RPMLIB = (1 << 24), /*!< rpmlib(feature) dependency. */ RPMSENSE_TRIGGERPREIN = (1 << 25), /*!< %triggerprein dependency. */ @@ -255,22 +200,8 @@ Index: lib/rpmds.h 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 +--- ./lib/rpmtag.h.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./lib/rpmtag.h 2010-03-25 14:53:47.000000000 +0000 @@ -228,14 +228,14 @@ typedef enum rpmTag_e { RPMTAG_PRETRANSPROG = 1153, /* s */ RPMTAG_POSTTRANSPROG = 1154, /* s */ @@ -294,3 +225,49 @@ Index: lib/rpmtag.h RPMTAG_PRIORITY = 1162, /* i[] extension placeholder (unimplemented) */ RPMTAG_CVSID = 1163, /* s (unimplemented) */ #define RPMTAG_SVNID RPMTAG_CVSID /* s (unimplemented) */ +--- ./lib/rpmtd.h.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./lib/rpmtd.h 2010-03-25 14:58:31.000000000 +0000 +@@ -216,6 +216,7 @@ typedef enum rpmtdFormats_e { + RPMTD_FORMAT_DEPTYPE = 15, /* dependency types (int types) */ + RPMTD_FORMAT_FSTATE = 16, /* file states (int types) */ + RPMTD_FORMAT_VFLAGS = 17, /* file verify flags (int types) */ ++ RPMTD_FORMAT_DEPFLAG_STRONG = 18, /* strong dependency */ + } rpmtdFormats; + + /** \ingroup rpmtd +--- ./python/rpmmodule.c.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./python/rpmmodule.c 2010-03-25 14:53:47.000000000 +0000 +@@ -373,7 +373,7 @@ static int initModule(PyObject *m) + REGISTER_ENUM(RPMSENSE_RPMLIB); + REGISTER_ENUM(RPMSENSE_TRIGGERPREIN); + REGISTER_ENUM(RPMSENSE_KEYRING); +- REGISTER_ENUM(RPMSENSE_PATCHES); ++ REGISTER_ENUM(RPMSENSE_STRONG); + REGISTER_ENUM(RPMSENSE_CONFIG); + + REGISTER_ENUM(RPMTRANS_FLAG_TEST); +--- ./rpmpopt.in.orig 2009-12-07 14:36:49.000000000 +0000 ++++ ./rpmpopt.in 2010-03-25 14:53:47.000000000 +0000 +@@ -65,6 +65,22 @@ rpm alias --requires --qf \ + --POPTdesc=$"list capabilities required by package(s)" + rpm alias -R --requires + ++rpm alias --suggests --qf \ ++ "[%|SUGGESTSFLAGS:depflag_strong?{}:{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \ ++ --POPTdesc=$"list capabilities this package suggests" ++ ++rpm alias --recommends --qf \ ++ "[%|SUGGESTSFLAGS:depflag_strong?{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \ ++ --POPTdesc=$"list capabilities this package recommends" ++ ++rpm alias --enhances --qf \ ++ "[%|ENHANCESFLAGS:depflag_strong?{}:{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \ ++ --POPTdesc=$"list capabilities this package enhances" ++ ++rpm alias --supplements --qf \ ++ "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \ ++ --POPTdesc=$"list capabilities this package supplements" ++ + 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\ From cd2dcf1a1778458fb83f6963410d2c04362f3d5fde714efcc5249554b98f2aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Schr=C3=B6der?= Date: Fri, 26 Mar 2010 15:30:18 +0000 Subject: [PATCH 4/8] - port sles11-sp1 repackage-nomd5.diff and safeugid.diff OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=41 --- repackage-nomd5.diff | 29 ++++++ rpm-4.7.1.tar.bz2 | 3 - rpm.changes | 5 + rpm.spec | 3 + safeugid.diff | 236 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 273 insertions(+), 3 deletions(-) create mode 100644 repackage-nomd5.diff delete mode 100644 rpm-4.7.1.tar.bz2 create mode 100644 safeugid.diff diff --git a/repackage-nomd5.diff b/repackage-nomd5.diff new file mode 100644 index 0000000..639b841 --- /dev/null +++ b/repackage-nomd5.diff @@ -0,0 +1,29 @@ +--- ./lib/psm.c.orig 2010-03-26 15:06:20.000000000 +0000 ++++ ./lib/psm.c 2010-03-26 15:11:27.000000000 +0000 +@@ -1318,6 +1318,7 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage s + + if (psm->goal == PSM_PKGINSTALL) { + FD_t payload = NULL; ++ rpmtransFlags oldtsflags; + + if (rpmtsFlags(ts) & RPMTRANS_FLAG_JUSTDB) break; + +@@ -1343,6 +1344,9 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage s + break; + } + ++ oldtsflags = rpmtsFlags(ts); ++ if (headerIsEntry(fi->h, RPMTAG_REMOVETID)) ++ (void) rpmtsSetFlags(ts, oldtsflags | RPMTRANS_FLAG_NOMD5); + rc = fsmSetup(rpmfiFSM(fi), FSM_PKGINSTALL, ts, psm->te, fi, + payload, NULL, &psm->failedFile); + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_UNCOMPRESS), +@@ -1350,6 +1354,8 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage s + (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_DIGEST), + fdOp(payload, FDSTAT_DIGEST)); + xx = fsmTeardown(rpmfiFSM(fi)); ++ if (headerIsEntry(fi->h, RPMTAG_REMOVETID)) ++ (void) rpmtsSetFlags(ts, oldtsflags); + + saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ + xx = Fclose(payload); diff --git a/rpm-4.7.1.tar.bz2 b/rpm-4.7.1.tar.bz2 deleted file mode 100644 index 13a628c..0000000 --- a/rpm-4.7.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b0af1f507b342eda33f9ef113b645048034fb7fef3b4ff3c084532af12b6f70d -size 3410587 diff --git a/rpm.changes b/rpm.changes index 57a3ca6..364a858 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 26 16:29:36 CET 2010 - mls@suse.de + +- port sles11-sp1 repackage-nomd5.diff and safeugid.diff + ------------------------------------------------------------------- Fri Mar 26 11:49:59 CET 2010 - mls@suse.de diff --git a/rpm.spec b/rpm.spec index fd317cf..fbfaa90 100644 --- a/rpm.spec +++ b/rpm.spec @@ -103,6 +103,8 @@ Patch66: defclean.diff Patch67: readlineofi.diff Patch68: rpmdb-no-svc.diff Patch69: modemuncher.diff +Patch70: repackage-nomd5.diff +Patch71: safeugid.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # # avoid bootstrapping problem @@ -163,6 +165,7 @@ rm -f rpmdb/db.h %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 -P 71 #chmod 755 scripts/find-supplements{,.ksyms} #chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms #chmod 755 scripts/firmware.prov diff --git a/safeugid.diff b/safeugid.diff new file mode 100644 index 0000000..d2cfa90 --- /dev/null +++ b/safeugid.diff @@ -0,0 +1,236 @@ +--- lib/fsm.c.orig 2010-03-26 15:06:20.000000000 +0000 ++++ lib/fsm.c 2010-03-26 15:16:31.000000000 +0000 +@@ -736,22 +736,26 @@ static int fsmMapAttrs(FSM_t fsm) + + /* this check is pretty moot, rpmfi accessors check array bounds etc */ + if (fi && i >= 0 && i < rpmfiFC(fi)) { ++ rpmts ts = fsmGetTs(fsm); + mode_t finalMode = rpmfiFModeIndex(fi, i); + dev_t finalRdev = rpmfiFRdevIndex(fi, i); + time_t finalMtime = rpmfiFMtimeIndex(fi, i); + const char *user = rpmfiFUserIndex(fi, i); + const char *group = rpmfiFGroupIndex(fi, i); ++ int safe = rpmtsChrootDone(ts); ++ extern int unameToUid_safe(const char *, gid_t *, int); ++ extern int gnameToGid_safe(const char *, gid_t *, int); + uid_t uid = 0; + gid_t gid = 0; + +- if (user && unameToUid(user, &uid)) { ++ if (user && unameToUid_safe(user, &uid, safe)) { + if (fsm->goal == FSM_PKGINSTALL) + rpmlog(RPMLOG_WARNING, + _("user %s does not exist - using root\n"), user); + finalMode &= ~S_ISUID; /* turn off suid bit */ + } + +- if (group && gnameToGid(group, &gid)) { ++ if (group && gnameToGid(group, &gid, safe)) { + if (fsm->goal == FSM_PKGINSTALL) + rpmlog(RPMLOG_WARNING, + _("group %s does not exist - using root\n"), group); +@@ -773,8 +777,7 @@ static int fsmMapAttrs(FSM_t fsm) + if (fsm->mapFlags & CPIO_MAP_GID) + st->st_gid = gid; + +- { rpmts ts = fsmGetTs(fsm); +- ++ { + /* + * Set file digest (if not disabled). + */ +--- lib/misc.c.orig 2009-12-07 14:36:49.000000000 +0000 ++++ lib/misc.c 2010-03-26 15:26:05.000000000 +0000 +@@ -14,6 +14,42 @@ const char * const RPMVERSION = VERSION; + + #include "debug.h" + ++/* ++ * Unfortunatelly glibc caches nss/nscd data and there is no ++ * good way to flush those caches when we did a chroot(). Thus ++ * we need to parse /etc/passwd and /etc/group ourselfs. ++ */ ++static int safe_lookup(const char * file, const char * name) ++{ ++ FILE *fp; ++ int l; ++ char buf[4096], *p; ++ ++ if (!name || !*name) ++ return -1; ++ l = strlen(name); ++ if ((fp = fopen(file, "r")) == 0) ++ return -1; ++ while ((p = fgets(buf, sizeof(buf), fp)) != 0) { ++ if (*p == '#') ++ continue; ++ while (*p && (*p == ' ' || *p == '\t')) ++ p++; ++ if (strncmp(p, name, l) != 0 || p[l] != ':') ++ continue; ++ p = strchr(p + l + 1, ':'); ++ if (!p) ++ continue; ++ fclose(fp); ++ p++; ++ while (*p && (*p == ' ' || *p == '\t')) ++ p++; ++ return atoi(p); ++ } ++ fclose(fp); ++ return -1; ++} ++ + /* unameToUid(), uidTouname() and the group variants are really poorly + implemented. They really ought to use hash tables. I just made the + guess that most files would be owned by root or the same person/group +@@ -21,11 +57,12 @@ const char * const RPMVERSION = VERSION; + is looked up via getpw() and getgr() functions. If this performs + too poorly I'll have to implement it properly :-( */ + +-int unameToUid(const char * thisUname, uid_t * uid) ++int unameToUid_safe(const char * thisUname, uid_t * uid, int safe) + { + static char * lastUname = NULL; + static size_t lastUnameLen = 0; + static size_t lastUnameAlloced; ++ static int lastUnameSafe; + static uid_t lastUid; + struct passwd * pwent; + size_t thisUnameLen; +@@ -38,6 +75,11 @@ static char * lastUname = NULL; + return 0; + } + ++ if (safe != lastUnameSafe) { ++ lastUnameLen = 0; ++ lastUnameSafe = safe; ++ } ++ + thisUnameLen = strlen(thisUname); + if (lastUname == NULL || thisUnameLen != lastUnameLen || + !rstreq(thisUname, lastUname)) +@@ -48,15 +90,21 @@ static char * lastUname = NULL; + } + strcpy(lastUname, thisUname); + +- pwent = getpwnam(thisUname); +- if (pwent == NULL) { +- /* FIX: shrug */ +- endpwent(); ++ if (safe) { ++ int uid = safe_lookup("/etc/passwd", thisUname); ++ if (uid < 0) ++ return -1; ++ lastUid = (uid_t)uid; ++ } else { + pwent = getpwnam(thisUname); +- if (pwent == NULL) return -1; ++ if (pwent == NULL) { ++ /* FIX: shrug */ ++ endpwent(); ++ pwent = getpwnam(thisUname); ++ if (pwent == NULL) return -1; ++ } ++ lastUid = pwent->pw_uid; + } +- +- lastUid = pwent->pw_uid; + } + + *uid = lastUid; +@@ -64,11 +112,18 @@ static char * lastUname = NULL; + return 0; + } + +-int gnameToGid(const char * thisGname, gid_t * gid) ++int unameToUid(const char * thisUname, uid_t * uid) ++{ ++ return unameToUid_safe(thisUname, uid, 0); ++} ++ ++ ++int gnameToGid_safe(const char * thisGname, gid_t * gid, int safe) + { + static char * lastGname = NULL; + static size_t lastGnameLen = 0; + static size_t lastGnameAlloced; ++ static int lastGnameSafe; + static gid_t lastGid; + size_t thisGnameLen; + struct group * grent; +@@ -81,6 +136,11 @@ static char * lastGname = NULL; + return 0; + } + ++ if (safe != lastGnameSafe) { ++ lastGnameLen = 0; ++ lastGnameSafe = safe; ++ } ++ + thisGnameLen = strlen(thisGname); + if (lastGname == NULL || thisGnameLen != lastGnameLen || + !rstreq(thisGname, lastGname)) +@@ -91,25 +151,34 @@ static char * lastGname = NULL; + } + strcpy(lastGname, thisGname); + +- grent = getgrnam(thisGname); +- if (grent == NULL) { +- /* FIX: shrug */ +- endgrent(); ++ if (safe) { ++ int gid = safe_lookup("/etc/group", thisGname); ++ if (gid < 0) ++ return -1; ++ lastGid = (gid_t)gid; ++ } else { + grent = getgrnam(thisGname); + if (grent == NULL) { +- /* XXX The filesystem package needs group/lock w/o getgrnam. */ +- if (rstreq(thisGname, "lock")) { +- *gid = lastGid = 54; +- return 0; +- } else +- if (rstreq(thisGname, "mail")) { +- *gid = lastGid = 12; +- return 0; +- } else +- return -1; ++ /* FIX: shrug */ ++ endgrent(); ++ grent = getgrnam(thisGname); ++ if (grent == NULL) { ++#ifdef STRANGE_FEDORA_HACKS ++ /* XXX The filesystem package needs group/lock w/o getgrnam. */ ++ if (rstreq(thisGname, "lock")) { ++ *gid = lastGid = 54; ++ return 0; ++ } else ++ if (rstreq(thisGname, "mail")) { ++ *gid = lastGid = 12; ++ return 0; ++ } else ++#endif ++ return -1; ++ } + } ++ lastGid = grent->gr_gid; + } +- lastGid = grent->gr_gid; + } + + *gid = lastGid; +@@ -117,6 +186,12 @@ static char * lastGname = NULL; + return 0; + } + ++int gnameToGid(const char * thisGname, gid_t * gid) ++{ ++ return gnameToGid_safe(thisGname, gid, 0); ++} ++ ++ + const char * uidToUname(uid_t uid) + { + static uid_t lastUid = (uid_t) -1; From a15948cd53fb1329eeb1062fe3e792ad0a478aae916399ea220f3178cb54bd0e Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 26 Mar 2010 17:04:16 +0000 Subject: [PATCH 5/8] fix build OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=42 --- safeugid.diff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/safeugid.diff b/safeugid.diff index d2cfa90..e5180b3 100644 --- a/safeugid.diff +++ b/safeugid.diff @@ -25,7 +25,7 @@ } - if (group && gnameToGid(group, &gid)) { -+ if (group && gnameToGid(group, &gid, safe)) { ++ if (group && gnameToGid__safe(group, &gid, safe)) { if (fsm->goal == FSM_PKGINSTALL) rpmlog(RPMLOG_WARNING, _("group %s does not exist - using root\n"), group); From 93d131405103b8ece5f5545f76d486f03363c80ce976f39812d1c50b1f9850e5 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 26 Mar 2010 17:10:36 +0000 Subject: [PATCH 6/8] extra typo :-( OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=43 --- safeugid.diff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/safeugid.diff b/safeugid.diff index e5180b3..f1e7509 100644 --- a/safeugid.diff +++ b/safeugid.diff @@ -25,7 +25,7 @@ } - if (group && gnameToGid(group, &gid)) { -+ if (group && gnameToGid__safe(group, &gid, safe)) { ++ if (group && gnameToGid_safe(group, &gid, safe)) { if (fsm->goal == FSM_PKGINSTALL) rpmlog(RPMLOG_WARNING, _("group %s does not exist - using root\n"), group); From 14a32664666525fdd530667b37a9cb43fb8d4c0cff5511624ddc9627901d8352 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 26 Mar 2010 18:50:33 +0000 Subject: [PATCH 7/8] fixed version number OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=44 --- rpm-python.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpm-python.spec b/rpm-python.spec index 59e5970..759f349 100644 --- a/rpm-python.spec +++ b/rpm-python.spec @@ -24,8 +24,8 @@ BuildRequires: file-devel libbz2-devel libelf-devel libselinux-devel lua-devel License: GPLv2+ Group: System/Packages Summary: Python Bindings for Manipulating RPM Packages -Version: 4.7.1 -Release: 9 +Version: 4.8.0 +Release: 1 Requires: rpm = %{version} %py_requires Source99: rpm.spec From 3f51ae8169d4892eceb71b7ae7f8e06971446726b1dcced50ebd3a047d038d80 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Thu, 1 Apr 2010 16:15:26 +0000 Subject: [PATCH 8/8] Updating link to change in openSUSE:Factory/rpm revision 95.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=9c48ef565004469bed9d215084932522 --- rpm-python.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpm-python.spec b/rpm-python.spec index 759f349..99636b0 100644 --- a/rpm-python.spec +++ b/rpm-python.spec @@ -1,5 +1,5 @@ # -# spec file for package rpm-python (Version 4.7.1) +# spec file for package rpm-python (Version 4.8.0) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. #