update to rpm-4.9.0

OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=93
This commit is contained in:
Michael Schröder 2011-05-16 16:07:44 +00:00 committed by Git OBS Bridge
parent 5d8f14209e
commit cebe6dd1a8
87 changed files with 1633 additions and 2481 deletions

View File

@ -1,23 +0,0 @@
--- ./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 (rstreq(s+1, "gzdio")) {
+ if (rstreq(s+1, "ufdio")) {
+ compr = NULL;
+ } else if (rstreq(s+1, "gzdio")) {
compr = "gzip";
#if HAVE_BZLIB_H
} else if (rstreq(s+1, "bzdio")) {
@@ -398,7 +400,8 @@ rpmRC writeRPM(Header *hdrp, unsigned ch
goto exit;
}
- headerPutString(h, RPMTAG_PAYLOADCOMPRESSOR, compr);
+ if (compr)
+ headerPutString(h, RPMTAG_PAYLOADCOMPRESSOR, compr);
buf = xstrdup(rpmio_flags);
buf[s - rpmio_flags] = '\0';
headerPutString(h, RPMTAG_PAYLOADFLAGS, buf+1);

View File

@ -1,9 +1,5 @@
Some (probably SUSE specific) changes to linux.prov and linux.req
Index: autodeps/linux.prov
===================================================================
--- autodeps/linux.prov.orig
+++ autodeps/linux.prov
--- ./autodeps/linux.prov.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./autodeps/linux.prov 2011-05-11 14:27:40.000000000 +0000
@@ -2,60 +2,72 @@
# This script reads filenames from STDIN and outputs any relevant provides
@ -105,28 +101,20 @@ Index: autodeps/linux.prov
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-provides.ksyms "$@"
exit 0
Index: autodeps/linux.req
===================================================================
--- autodeps/linux.req.orig
+++ autodeps/linux.req
@@ -19,18 +19,22 @@ fi
--- ./autodeps/linux.req.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./autodeps/linux.req 2011-05-11 14:28:45.000000000 +0000
@@ -19,18 +19,21 @@ fi
#
# --- Grab the file manifest and classify files.
#filelist=`sed "s/['\"]/\\\&/g"`
-filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
-exelist=`echo $filelist | xargs -r file | egrep -v ":.* (commands|script) " | \
-exelist=`echo $filelist | xargs -r file | grep -Ev ":.* (commands|script) " | \
- grep ":.*executable" | cut -d: -f1`
-scriptlist=`echo $filelist | xargs -r file | \
- egrep ":.* (commands|script) " | cut -d: -f1`
- grep -E ":.* (commands|script) " | cut -d: -f1`
-liblist=`echo $filelist | xargs -r file | \
- grep ":.*shared object" | cut -d : -f1`
-
-interplist=
-perllist=
-pythonlist=
-tcllist=
+#filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
+IFS=$'\n'
+filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
+exelist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \
+ egrep -v ":.* (commands|script) " | \
@ -135,7 +123,11 @@ Index: autodeps/linux.req
+ egrep ":.* (commands|script) " | cut -d: -f1))
+liblist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \
+ grep ":.*shared object" | cut -d : -f1))
+
-interplist=
-perllist=
-pythonlist=
-tcllist=
+interplist=()
+perllist=()
+pythonlist=()
@ -144,7 +136,7 @@ Index: autodeps/linux.req
#
# --- Alpha does not mark 64bit dependencies
@@ -42,12 +46,12 @@ esac
@@ -42,12 +45,12 @@ esac
if [ "$needed" -eq 0 ]; then
#
# --- Executable dependency sonames.
@ -162,7 +154,7 @@ Index: autodeps/linux.req
gsub(/'\''"/,"\\&",$1);
printf "%s'$lib64'\n", $1
}
@@ -56,12 +60,12 @@ if [ "$needed" -eq 0 ]; then
@@ -56,12 +59,12 @@ if [ "$needed" -eq 0 ]; then
#
# --- Library dependency sonames.
@ -180,7 +172,7 @@ Index: autodeps/linux.req
gsub(/'\''"/,"\\&",$1);
printf "%s'$lib64'\n", $1
}
@@ -71,30 +75,30 @@ fi
@@ -71,30 +74,30 @@ fi
#
# --- Script interpreters.
@ -223,7 +215,7 @@ Index: autodeps/linux.req
/^$/ { START=0; }
/^Dynamic Section:$/ { START=1; }
(START==1) && /NEEDED/ {
@@ -111,7 +115,7 @@ for f in $liblist $exelist ; do
@@ -111,7 +114,7 @@ for f in $liblist $exelist ; do
sub(/:/, "", $3);
LIBNAME=$3;
}
@ -232,7 +224,7 @@ Index: autodeps/linux.req
print LIBNAME "(" $4 ")'$lib64'";
}
'
@@ -119,17 +123,29 @@ done | sort -u
@@ -119,17 +122,29 @@ done | sort -u
#
# --- Perl modules.

View File

@ -1,55 +0,0 @@
A couple of fixes picked from upstream.
--- ./lib/rpminstall.c.orig 2010-04-08 12:35:48.000000000 +0000
+++ ./lib/rpminstall.c 2010-04-08 12:36:00.000000000 +0000
@@ -458,7 +458,7 @@ restart:
case URL_IS_HTTPS:
case URL_IS_HTTP:
case URL_IS_FTP:
- { char *tfn;
+ { char *tfn = NULL;
FD_t tfd;
if (rpmIsVerbose())
--- ./lib/transaction.c.orig 2010-04-08 12:33:22.000000000 +0000
+++ ./lib/transaction.c 2010-04-08 12:35:00.000000000 +0000
@@ -183,6 +183,10 @@ static void rpmtsUpdateDSI(const rpmts t
if (fixupSize)
dsi->bneeded -= BLOCK_ROUND(fixupSize, dsi->bsize);
+
+ /* adjust bookkeeping when requirements shrink */
+ if (dsi->bneeded < dsi->obneeded) dsi->obneeded = dsi->bneeded;
+ if (dsi->ineeded < dsi->oineeded) dsi->oineeded = dsi->ineeded;
}
static void rpmtsFindDSIMount(const rpmts ts, rpmDiskSpaceInfo dsi)
@@ -231,7 +235,7 @@ static void rpmtsCheckDSIProblems(const
for (; dsi->bsize; dsi++) {
if (dsi->bavail >= 0 && adj_fs_blocks(dsi->bneeded) > dsi->bavail) {
- if (dsi->bneeded != dsi->obneeded) {
+ if (dsi->bneeded > dsi->obneeded) {
if (!dsi->mntPoint)
rpmtsFindDSIMount(ts, dsi);
rpmpsAppend(ps, RPMPROB_DISKSPACE,
@@ -243,7 +247,7 @@ static void rpmtsCheckDSIProblems(const
}
if (dsi->iavail >= 0 && adj_fs_blocks(dsi->ineeded) > dsi->iavail) {
- if (dsi->ineeded != dsi->oineeded) {
+ if (dsi->ineeded > dsi->oineeded) {
if (!dsi->mntPoint)
rpmtsFindDSIMount(ts, dsi);
rpmpsAppend(ps, RPMPROB_DISKNODES,
--- ./lib/verify.c.orig 2010-04-08 12:36:09.000000000 +0000
+++ ./lib/verify.c 2010-04-08 12:37:37.000000000 +0000
@@ -348,7 +348,7 @@ static int verifyHeader(QVA_t qva, const
static const char *const aok = ".";
static const char *const unknown = "?";
- ec = (verifyResult != 0);
+ if (verifyResult) ec = 1;
#define _verify(_RPMVERIFY_F, _C) \
((verifyResult & _RPMVERIFY_F) ? _C : aok)

View File

@ -1,9 +1,25 @@
SUSE specific brp script patches
Index: scripts/brp-lib64-linux
===================================================================
--- /dev/null
+++ scripts/brp-lib64-linux
--- ./scripts/Makefile.am.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./scripts/Makefile.am 2011-05-11 14:31:45.000000000 +0000
@@ -6,6 +6,7 @@ CLEANFILES =
EXTRA_DIST = \
brp-compress brp-python-bytecompile brp-java-gcjcompile \
+ brp-lib64-linux brp-symlink \
brp-strip brp-strip-comment-note brp-python-hardlink \
brp-strip-shared brp-strip-static-archive \
check-files check-prereqs \
@@ -24,6 +25,7 @@ EXTRA_DIST = \
rpmconfig_SCRIPTS = \
brp-compress brp-python-bytecompile brp-java-gcjcompile \
+ brp-lib64-linux brp-symlink \
brp-strip brp-strip-comment-note brp-python-hardlink \
brp-strip-shared brp-strip-static-archive \
check-files check-prereqs \
--- ./scripts/brp-lib64-linux.orig 2011-05-11 14:30:08.000000000 +0000
+++ ./scripts/brp-lib64-linux 2011-05-11 14:30:08.000000000 +0000
@@ -0,0 +1,42 @@
+#!/bin/bash
+# script checks wether package is 64-bit clean
@ -47,23 +63,9 @@ Index: scripts/brp-lib64-linux
+ fi
+done
+exit 0
Index: scripts/brp-strip
===================================================================
--- scripts/brp-strip.orig
+++ scripts/brp-strip
@@ -13,6 +13,7 @@ esac
for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
grep -v ' shared object,' | \
+ grep -v '/lib/modules/' | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
strip -g "$f" || :
done
Index: scripts/brp-strip-comment-note
===================================================================
--- scripts/brp-strip-comment-note.orig
+++ scripts/brp-strip-comment-note
@@ -13,6 +13,8 @@ esac
--- ./scripts/brp-strip-comment-note.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./scripts/brp-strip-comment-note 2011-05-11 14:30:08.000000000 +0000
@@ -16,6 +16,8 @@ esac
# for already stripped elf files in the build root
for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
@ -71,11 +73,19 @@ Index: scripts/brp-strip-comment-note
+ grep -v '/lib/modules/' | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped/\1/p'`; do
note="-R .note"
if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
Index: scripts/brp-symlink
===================================================================
--- /dev/null
+++ scripts/brp-symlink
if $OBJDUMP -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
--- ./scripts/brp-strip.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./scripts/brp-strip 2011-05-11 14:30:08.000000000 +0000
@@ -15,6 +15,7 @@ esac
for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
grep -v ' shared object,' | \
+ grep -v '/lib/modules/' | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
$STRIP -g "$f" || :
done
--- ./scripts/brp-symlink.orig 2011-05-11 14:30:08.000000000 +0000
+++ ./scripts/brp-symlink 2011-05-11 14:30:08.000000000 +0000
@@ -0,0 +1,184 @@
+#!/bin/sh
+
@ -261,29 +271,3 @@ Index: scripts/brp-symlink
+if test "$had_errors" = 1; then
+ exit 1
+fi
Index: scripts/Makefile.am
===================================================================
--- scripts/Makefile.am.orig
+++ scripts/Makefile.am
@@ -6,8 +6,10 @@ CLEANFILES =
EXTRA_DIST = \
brp-compress brp-python-bytecompile brp-java-gcjcompile \
+ brp-lib64-linux \
brp-strip brp-strip-comment-note \
brp-strip-shared brp-strip-static-archive \
+ brp-symlink \
check-files check-prereqs \
check-buildroot check-rpaths check-rpaths-worker \
find-debuginfo.sh find-lang.sh \
@@ -24,8 +26,10 @@ EXTRA_DIST = \
rpmconfig_SCRIPTS = \
brp-compress brp-python-bytecompile brp-java-gcjcompile \
+ brp-lib64-linux \
brp-strip brp-strip-comment-note \
brp-strip-shared brp-strip-static-archive \
+ brp-symlink \
check-files check-prereqs \
check-buildroot check-rpaths check-rpaths-worker \
find-lang.sh \

View File

@ -1,13 +1,6 @@
Index: scripts/brp-compress
===================================================================
--- scripts/brp-compress.orig
+++ scripts/brp-compress
@@ -1,56 +1,83 @@
-#!/bin/sh
+#!/bin/bash
# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
--- ./scripts/brp-compress.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./scripts/brp-compress 2011-05-11 14:44:21.000000000 +0000
@@ -5,51 +5,78 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD
exit 0
fi
@ -29,13 +22,13 @@ Index: scripts/brp-compress
+ inode=`ls -i $b | awk '{ print $1 }'`
+ others=`find $dir -type f -inum $inode`
+ for afile in $others ; do
+ [ "$afile" != "$b" ] && rm -f $afile
+ [ "$afile" != "$b" ] && rm -f "$afile"
+ done
+
+ case $b in
+ *.Z|*.gz) gunzip $b ;;
+ *.bz2) bunzip2 $b ;;
+ *.xz|*.lzma) unxz $b ;;
+ *.xz|*.lzma) unxz $b ;;
+ esac
+
+ type=${b##*.}
@ -50,21 +43,19 @@ Index: scripts/brp-compress
./usr/share/doc/*/man/man* ./usr/lib/*/man/man*
do
[ -d $d ] || continue
- for f in `find $d -type f`
+ find $d -type f | while read f
- for f in `find $d -type f ! -name dir`
+ find $d -type f ! -name dir | while read f
do
[ -f "$f" ] || continue
- [ "`basename $f`" = "dir" ] && continue
+ [ "`basename \"$f\"`" = "dir" ] && continue
case "$f" in
- *.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 $f; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
- *.bz2) bunzip2 -f $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
- *.xz|*.lzma) unxz -f $f; b=`echo $f | sed -e 's/\.\(xz\|lzma\)$//'`;;
- *) b=$f;;
+ *.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\)$//'`";;
+ *.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
@ -99,7 +90,7 @@ Index: scripts/brp-compress
- ln -sf $l$COMPRESS_EXT $b$COMPRESS_EXT
+ l="`ls -l "$f" | sed -e 's/.* -> //' -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`"
+ rm -f "$f"
+ b="`echo $f | sed -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`"
+ b="`echo "$f" | sed -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`"
+ ln -sf "$l$COMPRESS_EXT" "$b$COMPRESS_EXT"
done
done

View File

@ -1,9 +1,9 @@
Many changes to Makefiles/autogen and the like to make it build
on SUSE systems.
--- ./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
--- ./configure.ac.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./configure.ac 2011-05-11 15:18:44.000000000 +0000
@@ -850,6 +850,7 @@ arm*) RPMCANONCOLOR=0; RPMCANONARCH=arm
mipsel*) RPMCANONCOLOR=0; RPMCANONARCH=mipsel ;;
mips*) RPMCANONCOLOR=0; RPMCANONARCH=mips ;;
m68k*) RPMCANONCOLOR=0; RPMCANONARCH=m68k ;;
@ -11,7 +11,7 @@ on SUSE systems.
sh3*) RPMCANONCOLOR=0; RPMCANONARCH=sh3 ;;
sh4*) RPMCANONCOLOR=0; RPMCANONARCH=sh4 ;;
*) RPMCANONCOLOR=0; RPMCANONARCH=unknown ;;
@@ -1016,6 +1017,7 @@ esac
@@ -860,6 +861,7 @@ esac
RPMCANONVENDOR="$build_vendor"
case "${build_vendor}" in
unknown|pc|ibm|redhat|pld|mandrake|conectiva|lvr|yellowdog|caos|suse)
@ -19,7 +19,7 @@ on SUSE systems.
test -f /etc/redhat-release && RPMCANONVENDOR=redhat
test -f /etc/SuSE-release && RPMCANONVENDOR=suse
test -f /etc/pld-release && RPMCANONVENDOR=pld
@@ -1028,6 +1030,9 @@ unknown|pc|ibm|redhat|pld|mandrake|conec
@@ -872,6 +874,9 @@ unknown|pc|ibm|redhat|pld|mandrake|conec
esac
RPMCANONOS="$host_os_noversion"
RPMCANONGNU="$host_os_gnu"
@ -29,8 +29,8 @@ on SUSE systems.
AC_SUBST(RPMCANONCOLOR)
AC_SUBST(RPMCANONARCH)
AC_SUBST(RPMCANONVENDOR)
--- ./db3/configure.orig 2009-12-07 14:36:49.000000000 +0000
+++ ./db3/configure 2010-03-25 15:17:41.000000000 +0000
--- ./db3/configure.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./db3/configure 2011-05-11 15:18:44.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=.*$%%'`"
@ -43,8 +43,8 @@ on SUSE systems.
mv Makefile Makefile.orig
cat Makefile.orig | sed -e '/^install[:-]/c\
--- ./installplatform.orig 2009-12-07 14:36:49.000000000 +0000
+++ ./installplatform 2010-03-25 15:16:21.000000000 +0000
--- ./installplatform.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./installplatform 2011-05-11 15:18:44.000000000 +0000
@@ -47,9 +47,9 @@ for SUBST in $SUBSTS ; do
ARCH_INSTALL_POST='%{nil}'
case "${ARCH}-${OS}" in

View File

@ -1,7 +1,7 @@
From: Jan Blunck <jblunck@suse.de>
Subject: Let debuginfo packages provide the build-id
This patch let debuginfo packages provide build-id like follows:
This patch lets debuginfo packages provide build-id like follows:
debuginfo(build-id) = c63cb23876c5fa85f36beaff58f8557e1bf22517
@ -9,17 +9,8 @@ Users can therefore ask zypper to install the correct debuginfo package with:
zypper install -C "debuginfo(build-id) = c63cb23876c5fa85f36beaff58f8557e1bf22517"
Signed-off-by: Jan Blunck <jblunck@suse.de>
---
autodeps/linux.prov | 8 ++++++++
macros.in | 3 ++-
scripts/debuginfo.prov | 12 ++++++++++++
3 files changed, 22 insertions(+), 1 deletion(-)
Index: autodeps/linux.prov
===================================================================
--- autodeps/linux.prov.orig
+++ autodeps/linux.prov
--- ./autodeps/linux.prov.orig 2011-05-11 15:58:28.000000000 +0000
+++ ./autodeps/linux.prov 2011-05-11 15:59:31.000000000 +0000
@@ -5,6 +5,9 @@
IFS=$'\n'
filelist=($(cat))
@ -42,11 +33,9 @@ Index: autodeps/linux.prov
# --- Mono exes/dlls
: ${MONO_PREFIX=/usr}
if [ -x $MONO_PREFIX/bin/mono -a -n "$monolist" ] ; then
Index: macros.in
===================================================================
--- macros.in.orig
+++ macros.in
@@ -179,7 +179,8 @@
--- ./macros.in.orig 2011-05-11 15:59:08.000000000 +0000
+++ ./macros.in 2011-05-11 15:59:31.000000000 +0000
@@ -182,7 +182,8 @@
%package debuginfo\
Summary: Debug information for package %{name}\
Group: Development/Debug\
@ -56,10 +45,8 @@ Index: macros.in
#Requires: %{?!debug_package_requires:%{name} = %{version}-%{release}}%{?debug_package_requires}\
%description debuginfo\
This package provides debug information for package %{name}.\
Index: scripts/debuginfo.prov
===================================================================
--- /dev/null
+++ scripts/debuginfo.prov
--- ./scripts/debuginfo.prov.orig 2011-05-11 15:59:31.000000000 +0000
+++ ./scripts/debuginfo.prov 2011-05-11 15:59:31.000000000 +0000
@@ -0,0 +1,12 @@
+#!/bin/sh
+

View File

@ -1,28 +1,50 @@
Warn the user if chown/fchown fails.
Do not abort if chown/chmod fails but the file is already correct
Index: lib/fsm.c
===================================================================
--- lib/fsm.c.orig
+++ lib/fsm.c
@@ -2093,6 +2093,10 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS
break;
case FSM_CHOWN:
rc = chown(fsm->path, st->st_uid, st->st_gid);
+ if (rc < 0 && errno == EPERM) {
+ rpmlog(RPMLOG_WARNING, "can't chown %s (%s)\n", fsm->path, strerror(errno));
--- ./lib/fsm.c.orig 2011-03-02 06:46:13.000000000 +0000
+++ ./lib/fsm.c 2011-05-10 16:30:55.000000000 +0000
@@ -1449,6 +1449,11 @@ static int fsmRename(FSM_t fsm)
static int fsmChown(FSM_t fsm)
{
int rc = chown(fsm->path, fsm->sb.st_uid, fsm->sb.st_gid);
+ if (rc < 0) {
+ struct stat st;
+ if (lstat(fsm->path, &st) == 0 && st.st_uid == fsm->sb.st_uid && st.st_gid == fsm->sb.st_gid)
+ rc = 0;
+ }
if (_fsm_debug && (stage & FSM_SYSCALL))
rpmlog(RPMLOG_DEBUG, " %8s (%s, %d, %d) %s\n", cur,
fsm->path, (int)st->st_uid, (int)st->st_gid,
@@ -2102,6 +2106,10 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS
case FSM_LCHOWN:
#if ! CHOWN_FOLLOWS_SYMLINK
rc = lchown(fsm->path, st->st_uid, st->st_gid);
+ if (rc < 0 && errno == EPERM) {
+ rpmlog(RPMLOG_WARNING, "can't lchown %s (%s)\n", fsm->path, strerror(errno));
+ }
if (_fsm_debug && (FSM_CHOWN & FSM_SYSCALL))
rpmlog(RPMLOG_DEBUG, " %8s (%s, %d, %d) %s\n", fileStageString(FSM_CHOWN),
fsm->path, (int)fsm->sb.st_uid, (int)fsm->sb.st_gid,
@@ -1461,6 +1466,11 @@ static int fsmLChown(FSM_t fsm)
{
int rc = 0;
rc = lchown(fsm->path, fsm->sb.st_uid, fsm->sb.st_gid);
+ if (rc < 0) {
+ struct stat st;
+ if (lstat(fsm->path, &st) == 0 && st.st_uid == fsm->sb.st_uid && st.st_gid == fsm->sb.st_gid)
+ rc = 0;
+ }
if (_fsm_debug && (stage & FSM_SYSCALL))
rpmlog(RPMLOG_DEBUG, " %8s (%s, %d, %d) %s\n", cur,
fsm->path, (int)st->st_uid, (int)st->st_gid,
+ }
if (_fsm_debug && (FSM_LCHOWN & FSM_SYSCALL))
rpmlog(RPMLOG_DEBUG, " %8s (%s, %d, %d) %s\n", fileStageString(FSM_LCHOWN),
fsm->path, (int)fsm->sb.st_uid, (int)fsm->sb.st_gid,
@@ -1472,6 +1482,11 @@ static int fsmLChown(FSM_t fsm)
static int fsmChmod(FSM_t fsm)
{
int rc = chmod(fsm->path, (fsm->sb.st_mode & 07777));
+ if (rc < 0) {
+ struct stat st;
+ if (lstat(fsm->path, &st) == 0 && (st.st_mode & 07777) == (fsm->sb.st_mode & 07777))
+ rc = 0;
+ }
if (_fsm_debug && (FSM_CHMOD & FSM_SYSCALL))
rpmlog(RPMLOG_DEBUG, " %8s (%s, 0%04o) %s\n", fileStageString(FSM_CHMOD),
fsm->path, (unsigned)(fsm->sb.st_mode & 07777),
@@ -2033,6 +2048,9 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS
st->st_mtime = rpmfiFMtimeIndex(fi, fsm->ix);
rc = fsmUtime(fsm);
st->st_mtime = mtime;
+ /* utime error is not critical for directories */
+ if (rc && S_ISDIR(st->st_mode))
+ rc = 0;
}
#if WITH_CAP
if (!rc && !S_ISDIR(st->st_mode) && !getuid()) {

View File

@ -1,25 +1,21 @@
Build convertdb1, too.
Index: Makefile.am
===================================================================
--- Makefile.am.orig
+++ Makefile.am
@@ -143,6 +143,10 @@ bin_PROGRAMS += rpmqpack
--- ./Makefile.am.orig 2011-05-11 15:15:27.000000000 +0000
+++ ./Makefile.am 2011-05-11 15:18:21.000000000 +0000
@@ -174,6 +174,10 @@ bin_PROGRAMS += rpmqpack
rpmqpack_SOURCES = rpmqpack.c
rpmqpack_LDADD = lib/librpm.la
+check_PROGRAMS += convertdb1
+bin_PROGRAMS += convertdb1
+convertdb1_SOURCES = tools/convertdb1.c
+convertdb1_LDADD = lib/librpm.la
+
rpmconfig_DATA = rpmrc
rpmrc: $(top_srcdir)/rpmrc.in
@$(SED) \
Index: tools/convertdb1.c
===================================================================
--- /dev/null
+++ tools/convertdb1.c
@@ -0,0 +1,346 @@
--- tools/convertdb1.c.orig 2011-05-12 13:31:37.000000000 +0000
+++ tools/convertdb1.c 2011-05-12 13:31:28.000000000 +0000
@@ -0,0 +1,351 @@
+#if defined(HAVE_CONFIG_H)
+#include "system.h"
+const char *__progname;
@ -30,6 +26,7 @@ Index: tools/convertdb1.c
+#endif
+
+#include <rpmlib.h>
+#include <rpmts.h>
+#include <rpmdb.h>
+#include <rpmio.h>
+#include <rpmmacro.h>
@ -305,6 +302,7 @@ Index: tools/convertdb1.c
+ const char *name;
+ const char *version;
+ const char *release;
+ rpmts ts;
+
+ if (argc != 2)
+ {
@ -321,7 +319,9 @@ Index: tools/convertdb1.c
+ /* speed things up */
+ (void) rpmDefineMacro(NULL, "_rpmdb_rebuild %{nil}", -1);
+
+ if (rpmdbOpen("/", &db, O_RDWR, 0644)) {
+ ts = rpmtsCreate();
+
+ if (rpmtsOpenDB(ts, O_RDWR)) {
+ fprintf(stderr, "could not open rpm database\n");
+ exit(1);
+ }
@ -355,14 +355,15 @@ Index: tools/convertdb1.c
+ continue;
+ }
+ rpmdbFreeIterator(mi);
+ if (rpmdbAdd(db, -1, h, 0, 0))
+ if (rpmtsHeaderAddDB(ts, h))
+ {
+ fprintf(stderr, "could not add %s-%s-%s!\n", name, version, release);
+ }
+ headerFree(h);
+ }
+ Fclose(fd);
+ rpmdbClose(db);
+ rpmtsCloseDB(ts);
+ rpmtsFree(ts);
+ return 0;
+}
+

3
db-4.8.30.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2ba998b7451758928011878514c78b8a6f0fbfd49ebf5cc9f4269f4666414ab4
size 19969243

203
db.diff
View File

@ -1,179 +1,82 @@
--- db/db/db.c
+++ db/db/db.c
@@ -591,6 +591,8 @@ __db_dbenv_mpool(dbp, fname, flags)
(F_ISSET(dbp, DB_AM_NOT_DURABLE) ? DB_TXN_NOT_DURABLE : 0),
0, dbp->pgsize)) != 0)
--- db/db/db.c.orig 2010-04-12 20:25:22.000000000 +0000
+++ db/db/db.c 2011-05-12 11:38:59.000000000 +0000
@@ -646,6 +646,8 @@ __env_mpool(dbp, fname, flags)
MAKE_INMEM(dbp);
return (ret);
}
+ if (LF_ISSET(DB_NOFSYNC) && mpf->mfp)
+ F_SET(mpf->mfp, MP_NOFSYNC);
return (0);
}
--- db/db/db_iface.c
+++ db/db/db_iface.c
@@ -1068,7 +1068,7 @@ __db_open_arg(dbp, txn, fname, dname, ty
/*
* Set the open flag. We use it to mean that the dbp has gone
--- db/db/db_iface.c.orig 2010-04-12 20:25:22.000000000 +0000
+++ db/db/db_iface.c 2011-05-12 11:21:32.000000000 +0000
@@ -1230,6 +1230,7 @@ __db_open_arg(dbp, txn, fname, dname, ty
#define OKFLAGS \
(DB_AUTO_COMMIT | DB_CREATE | DB_DIRTY_READ | DB_EXCL | \
DB_FCNTL_LOCKING | DB_NO_AUTO_COMMIT | DB_NOMMAP | DB_RDONLY | \
- DB_RDWRMASTER | DB_THREAD | DB_TRUNCATE | DB_WRITEOPEN)
+ DB_RDWRMASTER | DB_THREAD | DB_TRUNCATE | DB_WRITEOPEN | DB_NOFSYNC)
if ((ret = __db_fchk(dbenv, "DB->open", flags, OKFLAGS)) != 0)
(DB_AUTO_COMMIT | DB_CREATE | DB_EXCL | DB_FCNTL_LOCKING | \
DB_MULTIVERSION | DB_NOMMAP | DB_NO_AUTO_COMMIT | DB_RDONLY | \
+ DB_NOFSYNC | \
DB_RDWRMASTER | DB_READ_UNCOMMITTED | DB_THREAD | DB_TRUNCATE)
if ((ret = __db_fchk(env, "DB->open", flags, OKFLAGS)) != 0)
return (ret);
if (LF_ISSET(DB_EXCL) && !LF_ISSET(DB_CREATE))
--- db/dbinc/db.in
+++ db/dbinc/db.in
@@ -260,6 +260,7 @@ struct __db_dbt {
#define DB_FCNTL_LOCKING 0x0002000 /* UNDOC: fcntl(2) locking. */
#define DB_RDWRMASTER 0x0004000 /* UNDOC: allow subdb master open R/W */
#define DB_WRITEOPEN 0x0008000 /* UNDOC: open with write lock. */
+#define DB_NOFSYNC 0x0010000 /* UNDOC: don't fsync */
/*
* Flags private to DB_ENV->txn_begin.
--- db/dbinc/mp.h
+++ db/dbinc/mp.h
@@ -309,6 +309,7 @@ struct __mpoolfile {
--- db/dbinc/mp.h.orig 2010-04-12 20:25:22.000000000 +0000
+++ db/dbinc/mp.h 2011-05-12 12:01:32.000000000 +0000
@@ -467,6 +467,7 @@ struct __mpoolfile {
#define MP_FAKE_UOC 0x080 /* Unlink_on_close field: fake flag. */
#define MP_NOT_DURABLE 0x100 /* File is not durable. */
#define MP_TEMP 0x200 /* Backing file is a temporary. */
+#define MP_NOFSYNC 0x400 /* Don't fsync */
+#define MP_NOFSYNC 0x400 /* Don't fsync */
u_int32_t flags;
};
--- db/dist/aclocal/options.ac
+++ db/dist/aclocal/options.ac
@@ -277,10 +277,6 @@ fi
# Uniquename excludes C++, Java, RPC.
if test "$db_cv_uniquename" = "yes"; then
- if test "$db_cv_rpc" = "yes"; then
- AC_MSG_ERROR(
- [--with-uniquename is not compatible with --enable-rpc])
- fi
if test "$db_cv_cxx" = "yes"; then
AC_MSG_ERROR(
[--with-uniquename is not compatible with --enable-cxx])
--- db/dist/configure.ac
+++ db/dist/configure.ac
@@ -690,14 +690,14 @@ LTLIBOBJS=`echo "$LIB@&t@OBJS" |
AC_SUBST(LTLIBOBJS)
# Initial output file list.
-CREATE_LIST="Makefile
- db_cxx.h:$srcdir/../dbinc/db_cxx.in
- db_int.h:$srcdir/../dbinc/db_int.in
+CREATE_LIST="Makefile \
+ db_cxx.h:$srcdir/../dbinc/db_cxx.in \
+ db_int.h:$srcdir/../dbinc/db_int.in \
include.tcl:$srcdir/../test/include.tcl"
# MinGW needs win_db.h.
if test "$db_cv_mingw" = "yes"; then
-CREATE_LIST="$CREATE_LIST
+CREATE_LIST="$CREATE_LIST \
win_db.h:$srcdir/win_db.in"
fi
@@ -705,10 +705,10 @@ fi
# prototypes, and, if configured for unique names, a list of #defines
# to do DB_VERSION_UNIQUE_NAME substitution.
if test "$db_cv_uniquename" = "yes"; then
- CREATE_LIST="$CREATE_LIST
+ CREATE_LIST="$CREATE_LIST \
db.h:$srcdir/../dbinc/db.in:$srcdir/../dbinc_auto/ext_def.in:$srcdir/../dbinc_auto/ext_prot.in"
else
- CREATE_LIST="$CREATE_LIST
+ CREATE_LIST="$CREATE_LIST \
db.h:$srcdir/../dbinc/db.in:$srcdir/../dbinc_auto/ext_prot.in"
fi
@@ -716,7 +716,7 @@ fi
# does the DB_VERSION_UNIQUE_NAME substitution), which is included by
# the db_int.h file.
if test "$db_cv_uniquename" = "yes"; then
- CREATE_LIST="$CREATE_LIST
+ CREATE_LIST="$CREATE_LIST \
db_int_def.h:$srcdir/../dbinc_auto/int_def.in"
db_int_def='#include "db_int_def.h"'
fi
@@ -726,12 +726,12 @@ fi
# of #defines to do DB_VERSION_UNIQUE_NAME substitution.
if test "$db_cv_compat185" = "yes"; then
if test "$db_cv_uniquename" = "yes"; then
- CREATE_LIST="$CREATE_LIST
- db_185.h:$srcdir/../dbinc/db_185.in:$srcdir/../dbinc_auto/ext_185_def.in:$srcdir/../dbinc_auto/ext_185_prot.in
+ CREATE_LIST="$CREATE_LIST \
+ db_185.h:$srcdir/../dbinc/db_185.in:$srcdir/../dbinc_auto/ext_185_def.in:$srcdir/../dbinc_auto/ext_185_prot.in \
db185_int.h:$srcdir/../db185/db185_int.in:$srcdir/../dbinc_auto/ext_185_def.in:$srcdir/../dbinc_auto/ext_185_prot.in"
else
- CREATE_LIST="$CREATE_LIST
- db_185.h:$srcdir/../dbinc/db_185.in:$srcdir/../dbinc_auto/ext_185_prot.in
+ CREATE_LIST="$CREATE_LIST \
+ db_185.h:$srcdir/../dbinc/db_185.in:$srcdir/../dbinc_auto/ext_185_prot.in \
db185_int.h:$srcdir/../db185/db185_int.in:$srcdir/../dbinc_auto/ext_185_prot.in"
fi
fi
--- db/dist/s_config
+++ db/dist/s_config
--- db/dbinc_auto/api_flags.in.orig 2011-05-12 11:40:57.000000000 +0000
+++ db/dbinc_auto/api_flags.in 2011-05-12 11:55:10.000000000 +0000
@@ -83,6 +83,7 @@
#define DB_NOORDERCHK 0x00000002
#define DB_NOPANIC 0x00000800
#define DB_NO_AUTO_COMMIT 0x00001000
+#define DB_NOFSYNC 0x00040000
#define DB_ODDFILESIZE 0x00000080
#define DB_ORDERCHKONLY 0x00000004
#define DB_OVERWRITE 0x00001000
--- db/dist/s_config.orig 2010-04-12 20:25:23.000000000 +0000
+++ db/dist/s_config 2011-05-12 12:00:34.000000000 +0000
@@ -8,7 +8,8 @@ trap 'rm -f aclocal.m4 ; exit 0' 0 1 2 3
. ./RELEASE
echo "autoconf: building aclocal.m4..."
-cat aclocal/*.ac aclocal_java/*.ac > aclocal.m4
+cat aclocal/*.ac aclocal_java/*.ac > acinclude.m4
-cat aclocal/*.m4 aclocal_java/*.m4 > aclocal.m4
+cat aclocal/*.m4 aclocal_java/*.m4 > acinclude.m4
+aclocal
echo "autoconf: running autoheader to build config.hin..."
rm -f config.hin
@@ -20,14 +21,13 @@ rm -f configure
autoconf
# Edit version information we couldn't pre-compute.
-(echo "1,\$s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" &&
- echo "1,\$s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" &&
- echo "1,\$s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" &&
- echo "1,\$s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" &&
- echo "1,\$s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" &&
- echo "1,\$s/__EDIT_DB_VERSION__/$DB_VERSION/g" &&
- echo "w" &&
- echo "q") | ed configure
+sed -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
+ -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
+ -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
+ -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
+ -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
+ -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" \
+ -i configure
rm -rf autom4te.cache
chmod 555 configure
--- db/mp/mp_sync.c
+++ db/mp/mp_sync.c
@@ -553,7 +553,7 @@ done: /*
if (ret == 0 && (op == DB_SYNC_CACHE || op == DB_SYNC_FILE)) {
--- db/mp/mp_sync.c.orig 2010-04-12 20:25:34.000000000 +0000
+++ db/mp/mp_sync.c 2011-05-12 11:36:58.000000000 +0000
@@ -578,7 +578,7 @@ done: /*
if (ret == 0 && required_write) {
if (dbmfp == NULL)
ret = __memp_sync_files(dbenv, dbmp);
ret = __memp_sync_files(env);
- else
+ else if (!dbmfp->mfp || !F_ISSET(dbmfp->mfp, MP_NOFSYNC))
ret = __os_fsync(dbenv, dbmfp->fhp);
+ else if (!F_ISSET(dbmfp->mfp, MP_NOFSYNC))
ret = __os_fsync(env, dbmfp->fhp);
}
@@ -600,7 +600,7 @@ int __memp_sync_files(dbenv, dbmp)
MUTEX_THREAD_LOCK(dbenv, dbmp->mutexp);
for (dbmfp = TAILQ_FIRST(&dbmp->dbmfq);
dbmfp != NULL; dbmfp = TAILQ_NEXT(dbmfp, q)) {
- if (dbmfp->mfp != mfp || F_ISSET(dbmfp, MP_READONLY))
+ if (dbmfp->mfp != mfp || F_ISSET(dbmfp, MP_READONLY | MP_NOFSYNC))
continue;
ret = __os_fsync(dbenv, dbmfp->fhp);
break;
@@ -662,6 +662,9 @@ __memp_mf_sync(dbmp, mfp)
@@ -665,7 +665,7 @@ __memp_sync_file(env, mfp, argp, countp,
"%s: unable to flush", (char *)
R_ADDR(dbmp->reginfo, mfp->path_off));
}
- } else
+ } else if (!F_ISSET(dbmfp->mfp, MP_NOFSYNC))
ret = __os_fsync(env, dbmfp->fhp);
dbenv = dbmp->dbenv;
/*
@@ -801,6 +801,8 @@ __memp_mf_sync(dbmp, mfp, locked)
COMPQUIET(hp, NULL);
env = dbmp->env;
+ if (F_ISSET(mfp, MP_NOFSYNC))
+ return 0;
+
/*
* Expects caller to be holding the region lock: we're using the path
* name and __memp_nameop might try and rename the file.
* We need to be holding the hash lock: we're using the path name
* and __memp_nameop might try and rename the file.

View File

@ -1,50 +1,24 @@
Support a database-local fsync setting. Needs berkeley db patch.
--- ./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;
}
--- ./lib/backend/dbconfig.c.orig 2011-01-03 13:57:41.000000000 +0000
+++ ./lib/backend/dbconfig.c 2011-05-10 17:00:29.000000000 +0000
@@ -58,8 +58,10 @@ static const struct poptOption rdbOption
{ "mp_size", 0,POPT_ARG_INT, &staticcfg.db_cachesize, 0,
NULL, NULL },
+#if 0
static int db3_fsync_disable(int fd)
{
return 0;
}
{ "nofsync", 0,POPT_ARG_NONE, &staticcfg.db_no_fsync, 0,
NULL, NULL },
+#endif
#if (DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 5)
/*
@@ -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) {
xx = db_env_set_func_fsync(db3_fsync_disable);
xx = cvtdberr(dbi, "db_env_set_func_fsync", xx, _debug);
}
+#endif
if (dbi->dbi_shmkey) {
xx = dbenv->set_shm_key(dbenv, dbi->dbi_shmkey);
--- ./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
/* Per-dbi options */
{ "nommap", 0,POPT_BIT_SET, &staticdbi.dbi_oflags, DB_NOMMAP,
@@ -69,6 +71,8 @@ static const struct poptOption rdbOption
NULL, NULL },
{ "fcntl_locking",0,POPT_BIT_SET, &db3dbi.dbi_oflags, DB_FCNTL_LOCKING,
{ "lockdbfd", 0,POPT_ARG_NONE, &staticdbi.dbi_lockdbfd, 0,
NULL, NULL },
+ { "nofsync", 0,POPT_BIT_SET, &db3dbi.dbi_oflags, DB_NOFSYNC,
+ { "nofsync", 0,POPT_BIT_SET, &staticdbi.dbi_oflags, DB_NOFSYNC,
+ NULL, NULL },
{ "btree", 0,POPT_ARG_VAL, &db3dbi.dbi_type, DB_BTREE,
NULL, NULL },
@@ -101,8 +103,6 @@ static const struct poptOption rdbOption
NULL, NULL },
{ "usedbenv", 0,POPT_ARG_NONE, &db3dbi.dbi_use_dbenv, 0,
NULL, NULL },
- { "nofsync", 0,POPT_ARG_NONE, &db3dbi.dbi_no_fsync, 0,
- NULL, NULL },
{ "nodbsync", 0,POPT_ARG_NONE, &db3dbi.dbi_no_dbsync, 0,
NULL, NULL },
{ "lockdbfd", 0,POPT_ARG_NONE, &db3dbi.dbi_lockdbfd, 0,
POPT_TABLEEND
};

View File

@ -1,16 +1,14 @@
Always use DB_PRIVATE. Should probably be configured instead.
Always use DB_PRIVATE. Unfortunately no longer configurable
in the macros file.
Index: lib/backend/db3.c
===================================================================
--- lib/backend/db3.c.orig
+++ lib/backend/db3.c
@@ -804,6 +804,9 @@ static int db3open(rpmdb rpmdb, rpmTag r
*/
if (dbi->dbi_use_dbenv) {
--- lib/backend/db3.c.orig 2011-05-12 15:38:18.000000000 +0000
+++ lib/backend/db3.c 2011-05-12 15:38:41.000000000 +0000
@@ -119,7 +119,7 @@ static int db_init(rpmdb rdb, const char
int retry_open = 2;
struct _dbConfig * cfg = &rdb->cfg;
/* This is our setup, thou shall not have other setups before us */
- uint32_t eflags = (DB_CREATE|DB_INIT_MPOOL|DB_INIT_CDB);
+ uint32_t eflags = (DB_CREATE|DB_INIT_MPOOL|DB_INIT_CDB|DB_PRIVATE);
+ /* always use fcntl lock */
+ dbi->dbi_eflags |= DB_PRIVATE;
+
if (access(dbhome, W_OK) == -1) {
/* dbhome is unwritable, don't attempt DB_CREATE on DB->open ... */
if (rdb->db_dbenv != NULL) {
rdb->db_opens++;

View File

@ -1,13 +1,11 @@
Do not block signals if the database is opened read-only, it jst
Do not block signals if the database is opened read-only, it just
annoys the users. [#48026]
Index: lib/rpmdb.c
===================================================================
--- lib/rpmdb.c.orig
+++ lib/rpmdb.c
@@ -819,10 +819,12 @@ int rpmdbClose(rpmdb db)
--- ./lib/rpmdb.c.orig 2011-02-28 09:57:27.000000000 +0000
+++ ./lib/rpmdb.c 2011-05-10 16:58:21.000000000 +0000
@@ -623,10 +623,12 @@ int rpmdbClose(rpmdb db)
{
rpmdb * prev, next;
int dbix;
int rc = 0;
+ int dbmode;
@ -15,13 +13,18 @@ Index: lib/rpmdb.c
goto exit;
+ dbmode = db->db_mode;
(void) rpmdbUnlink(db, RPMDBG_M("rpmdbClose"));
(void) rpmdbUnlink(db);
if (db->nrefs > 0)
@@ -855,12 +857,14 @@ int rpmdbClose(rpmdb db)
dbiTagsFree();
@@ -655,11 +657,13 @@ int rpmdbClose(rpmdb db)
db = _free(db);
exit:
- (void) rpmsqEnable(-SIGHUP, NULL);
- (void) rpmsqEnable(-SIGINT, NULL);
- (void) rpmsqEnable(-SIGTERM,NULL);
- (void) rpmsqEnable(-SIGQUIT,NULL);
- (void) rpmsqEnable(-SIGPIPE,NULL);
+ if ((dbmode & (O_RDWR|O_WRONLY)) != 0) {
+ (void) rpmsqEnable(-SIGHUP, NULL);
+ (void) rpmsqEnable(-SIGINT, NULL);
@ -29,31 +32,25 @@ Index: lib/rpmdb.c
+ (void) rpmsqEnable(-SIGQUIT,NULL);
+ (void) rpmsqEnable(-SIGPIPE,NULL);
+ }
exit:
- (void) rpmsqEnable(-SIGHUP, NULL);
- (void) rpmsqEnable(-SIGINT, NULL);
- (void) rpmsqEnable(-SIGTERM,NULL);
- (void) rpmsqEnable(-SIGQUIT,NULL);
- (void) rpmsqEnable(-SIGPIPE,NULL);
return rc;
}
@@ -956,11 +960,13 @@ static int openDatabase(const char * pre
if (db == NULL)
return 1;
- (void) rpmsqEnable(SIGHUP, NULL);
- (void) rpmsqEnable(SIGINT, NULL);
- (void) rpmsqEnable(SIGTERM,NULL);
- (void) rpmsqEnable(SIGQUIT,NULL);
- (void) rpmsqEnable(SIGPIPE,NULL);
+ if ((db->db_mode & (O_RDWR|O_WRONLY)) != 0) {
+ (void) rpmsqEnable(SIGHUP, NULL);
+ (void) rpmsqEnable(SIGINT, NULL);
+ (void) rpmsqEnable(SIGTERM,NULL);
+ (void) rpmsqEnable(SIGQUIT,NULL);
+ (void) rpmsqEnable(SIGPIPE,NULL);
+ }
db->db_api = _dbapi;
@@ -721,11 +725,13 @@ static int openDatabase(const char * pre
/* Try to ensure db home exists, error out if we cant even create */
rc = rpmioMkpath(rpmdbHome(db), 0755, getuid(), getgid());
if (rc == 0) {
- (void) rpmsqEnable(SIGHUP, NULL);
- (void) rpmsqEnable(SIGINT, NULL);
- (void) rpmsqEnable(SIGTERM,NULL);
- (void) rpmsqEnable(SIGQUIT,NULL);
- (void) rpmsqEnable(SIGPIPE,NULL);
+ if ((db->db_mode & (O_RDWR|O_WRONLY)) != 0) {
+ (void) rpmsqEnable(SIGHUP, NULL);
+ (void) rpmsqEnable(SIGINT, NULL);
+ (void) rpmsqEnable(SIGTERM,NULL);
+ (void) rpmsqEnable(SIGQUIT,NULL);
+ (void) rpmsqEnable(SIGPIPE,NULL);
+ }
/* Just the primary Packages database opened here */
rc = (rpmdbOpenIndex(db, RPMDBI_PACKAGES, db->db_flags) != NULL) ? 0 : -2;

View File

@ -3,14 +3,8 @@ Subject: Fix path canonicalization issues in debugedit
This patch fixes multiple problems with path canonicalization in
debugedit. This version of debugedit is taken from the dwarftools repository.
---
tools/debugedit.c | 168 ++++++++++++++++++++++++++----------------------------
1 file changed, 82 insertions(+), 86 deletions(-)
Index: tools/debugedit.c
===================================================================
--- tools/debugedit.c.orig
+++ tools/debugedit.c
--- ./tools/debugedit.c.orig 2011-05-11 15:31:31.000000000 +0000
+++ ./tools/debugedit.c 2011-05-11 15:54:49.000000000 +0000
@@ -158,7 +158,7 @@ strptr (DSO *dso, int sec, off_t offset)
{
if (data->d_buf
@ -20,7 +14,7 @@ Index: tools/debugedit.c
return (const char *) data->d_buf + (offset - data->d_off);
}
}
@@ -488,9 +488,10 @@ static int
@@ -496,9 +496,10 @@ static int
edit_dwarf2_line (DSO *dso, uint32_t off, char *comp_dir, int phase)
{
unsigned char *ptr = debug_sections[DEBUG_LINE].data, *dir;
@ -32,15 +26,15 @@ Index: tools/debugedit.c
unsigned char opcode_base;
uint32_t value, dirt_cnt;
size_t comp_dir_len = strlen (comp_dir);
@@ -534,6 +535,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
@@ -542,6 +543,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
return 1;
}
+ line_base = (char) (ptr[2] & 0xff);
opcode_base = ptr[4];
ptr = dir = ptr + 4 + opcode_base;
@@ -545,13 +547,13 @@ edit_dwarf2_line (DSO *dso, uint32_t off
@@ -553,13 +555,13 @@ edit_dwarf2_line (DSO *dso, uint32_t off
++value;
}
@ -56,7 +50,7 @@ Index: tools/debugedit.c
ptr = (unsigned char *) strchr ((char *)ptr, 0) + 1;
}
ptr++;
@@ -664,7 +666,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
@@ -672,7 +674,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
if (dest_dir)
{
@ -65,7 +59,7 @@ Index: tools/debugedit.c
size_t base_len = strlen (base_dir);
size_t dest_len = strlen (dest_dir);
size_t shrank = 0;
@@ -678,11 +680,14 @@ edit_dwarf2_line (DSO *dso, uint32_t off
@@ -686,11 +688,14 @@ edit_dwarf2_line (DSO *dso, uint32_t off
ptr = dir;
}
else
@ -76,72 +70,15 @@ Index: tools/debugedit.c
+ }
while (*srcptr != 0)
{
- size_t len = strlen ((char *)srcptr) + 1;
size_t len = strlen ((char *)srcptr) + 1;
- const unsigned char *readptr = srcptr;
+ size_t len = strlen ((char *)srcptr);
+ const char *readptr = srcptr;
if (*srcptr == '/' && has_prefix ((char *)srcptr, base_dir))
{
@@ -691,42 +696,27 @@ edit_dwarf2_line (DSO *dso, uint32_t off
memcpy (ptr, dest_dir, dest_len);
ptr += dest_len;
readptr += base_len;
- }
+ }
srcptr += len;
char *orig = strdup ((const char *) srcptr);
shrank += srcptr - readptr;
canonicalize_path ((char *)readptr, (char *)ptr);
- len = strlen ((char *)ptr) + 1;
- shrank -= len;
- ptr += len;
+ len = strlen ((char *)ptr);
- elf_flagdata (debug_sections[DEBUG_STR].elf_data,
- ELF_C_SET, ELF_F_DIRTY);
- }
+#ifdef DEBUG
+ if ((srcptr - readptr) > len)
+ error(0, 0,"canonicalization unexpectedly shrank (%lu): \"%s\"\n",
+ (long unsigned int)(srcptr - readptr) - len, ptr);
+#endif
- if (shrank > 0)
- {
- if (--shrank == 0)
- error (EXIT_FAILURE, 0,
- "canonicalization unexpectedly shrank by one character");
- else
- {
- memset (ptr, 'X', shrank);
- ptr += shrank;
- *ptr++ = '\0';
- }
+ shrank -= len;
+ ptr += len;
+ elf_flagdata (debug_sections[DEBUG_STR].elf_data,
+ ELF_C_SET, ELF_F_DIRTY);
+ ++ptr;
+ ++srcptr;
}
- if (abs_dir_cnt + abs_file_cnt != 0)
- {
- size_t len = (abs_dir_cnt + abs_file_cnt) * (base_len - dest_len);
-
- if (len == 1)
- error (EXIT_FAILURE, 0, "-b arg has to be either the same length as -d arg, or more than 1 char shorter");
- memset (ptr, 'X', len - 1);
- ptr += len - 1;
- *ptr++ = '\0';
- }
*ptr++ = '\0';
++srcptr;
@@ -746,21 +736,26 @@ edit_dwarf2_line (DSO *dso, uint32_t off
elf_flagdata (debug_sections[DEBUG_STR].elf_data,
ELF_C_SET, ELF_F_DIRTY);
@@ -756,21 +761,26 @@ edit_dwarf2_line (DSO *dso, uint32_t off
}
dirty_section (DEBUG_STR);
}
- else if (ptr != srcptr)
+ else if ((char *)ptr != srcptr)

View File

@ -1,14 +1,8 @@
Include compilation directory in source file list if used.
---
tools/debugedit.c | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
Index: tools/debugedit.c
===================================================================
--- tools/debugedit.c.orig
+++ tools/debugedit.c
@@ -495,6 +495,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
--- ./tools/debugedit.c.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./tools/debugedit.c 2011-05-11 15:31:31.000000000 +0000
@@ -503,6 +503,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
uint32_t value, dirt_cnt;
size_t comp_dir_len = strlen (comp_dir);
size_t abs_file_cnt = 0, abs_dir_cnt = 0;
@ -16,7 +10,7 @@ Index: tools/debugedit.c
if (phase != 0)
return 0;
@@ -603,6 +604,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
@@ -611,6 +612,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
memcpy (p, dirt[value], dir_len);
p[dir_len] = '/';
memcpy (p + dir_len + 1, file, file_len + 1);
@ -24,12 +18,10 @@ Index: tools/debugedit.c
}
canonicalize_path (s, s);
if (list_file_fd != -1)
@@ -635,7 +637,31 @@ edit_dwarf2_line (DSO *dso, uint32_t off
read_uleb128 (ptr);
@@ -644,6 +646,30 @@ edit_dwarf2_line (DSO *dso, uint32_t off
}
++ptr;
-
+
+ if (comp_dir_used && list_file_fd != -1
+ && (base_dir == NULL || has_prefix (comp_dir, base_dir)))
+ {

View File

@ -1,9 +1,25 @@
Make debugedit build without dwarf.h
Index: tools/debugedit.c
===================================================================
--- tools/debugedit.c.orig
+++ tools/debugedit.c
--- ./Makefile.am.orig 2010-12-22 11:17:20.000000000 +0000
+++ ./Makefile.am 2011-05-10 16:03:49.000000000 +0000
@@ -143,7 +143,6 @@ rpm2cpio_LDADD += @WITH_NSS_LIB@ @WITH_P
if LIBELF
-if LIBDWARF
rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
rpmlibexec_PROGRAMS += debugedit
@@ -156,7 +155,6 @@ elfdeps_SOURCES = tools/elfdeps.c
elfdeps_LDADD = rpmio/librpmio.la
elfdeps_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
endif
-endif
rpmlibexec_PROGRAMS += javadeps
javadeps_SOURCES = tools/javadeps.c
--- ./tools/debugedit.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./tools/debugedit.c 2011-05-10 16:03:49.000000000 +0000
@@ -37,7 +37,37 @@
#include <popt.h>
@ -43,23 +59,3 @@ Index: tools/debugedit.c
#include <rpm/rpmio.h>
#include <rpm/rpmpgp.h>
Index: Makefile.am
===================================================================
--- Makefile.am.orig
+++ Makefile.am
@@ -103,7 +103,6 @@ rpm2cpio_LDADD += @WITH_LIBELF_LIB@ @WIT
if LIBELF
-if LIBDWARF
rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
rpmlibexec_PROGRAMS += debugedit
@@ -111,7 +110,6 @@ debugedit_SOURCES = tools/debugedit.c to
debugedit_LDADD = rpmio/librpmio.la
debugedit_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
endif
-endif
rpmlibexec_PROGRAMS += javadeps
javadeps_SOURCES = tools/javadeps.c

View File

@ -1,8 +1,6 @@
Index: scripts/find-debuginfo.sh
===================================================================
--- scripts/find-debuginfo.sh.orig
+++ scripts/find-debuginfo.sh
@@ -210,6 +210,17 @@ while read nlinks inum f; do
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 16:10:22.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 16:10:48.000000000 +0000
@@ -211,6 +211,17 @@ while read nlinks inum f; do
;;
*) continue ;;
esac

View File

@ -1,8 +1,6 @@
Index: scripts/find-debuginfo.sh
===================================================================
--- scripts/find-debuginfo.sh.orig 2009-07-27 12:06:41.000000000 +0200
+++ scripts/find-debuginfo.sh 2009-07-27 12:08:05.000000000 +0200
@@ -185,7 +185,8 @@ make_id_link()
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 15:59:44.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 16:10:22.000000000 +0000
@@ -186,7 +186,8 @@ make_id_link()
get_debugfn()
{
dn=$(dirname "${1#$RPM_BUILD_ROOT}")

View File

@ -3,16 +3,9 @@ Subject: Split sources for debugging into separate -debugsource package
At the moment the -debuginfo package also include the sources where used to
build the binary. The patches moves them into a separate package -debugsource.
---
macros.in | 12 ++++++++++++
scripts/find-debuginfo.sh | 12 +++++++++---
2 files changed, 21 insertions(+), 3 deletions(-)
Index: macros.in
===================================================================
--- macros.in.orig
+++ macros.in
@@ -187,6 +187,18 @@ Debug information is useful when develop
--- ./macros.in.orig 2011-05-11 15:01:39.000000000 +0000
+++ ./macros.in 2011-05-11 15:36:05.000000000 +0000
@@ -190,6 +190,18 @@ Debug information is useful when develop
package or when debugging this package.\
%files debuginfo -f debugfiles.list\
%defattr(-,root,root)\
@ -31,11 +24,9 @@ Index: macros.in
%{nil}
%_defaultdocdir %{_datadir}/doc/packages
Index: scripts/find-debuginfo.sh
===================================================================
--- scripts/find-debuginfo.sh.orig
+++ scripts/find-debuginfo.sh
@@ -186,8 +186,8 @@ set -o pipefail
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 14:46:18.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 15:36:05.000000000 +0000
@@ -187,8 +187,8 @@ set -o pipefail
strict_error=ERROR
$strict || strict_error=WARNING
@ -46,7 +37,7 @@ Index: scripts/find-debuginfo.sh
xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' |
while read nlinks inum f; do
case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in
@@ -297,10 +297,16 @@ if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -
@@ -300,10 +300,16 @@ if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -
(cd "${RPM_BUILD_ROOT}/usr"
test ! -d lib/debug || find lib/debug ! -type d

View File

@ -1,6 +1,8 @@
--- ./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 @@
Create a debuginfo package for each subpackage.
--- ./build/files.c.orig 2011-05-13 15:34:01.000000000 +0000
+++ ./build/files.c 2011-05-13 15:35:42.000000000 +0000
@@ -20,6 +20,10 @@
#include <rpm/rpmfileutil.h> /* rpmDoDigest() */
#include <rpm/rpmlog.h>
@ -10,11 +12,12 @@
+
#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */
#include "rpmio/base64.h"
#include "rpmio/fts.h"
@@ -2230,12 +2234,136 @@ exit:
#include "misc/fts.h"
@@ -2105,13 +2109,237 @@ exit:
return rc;
}
+#if HAVE_GELF_H && HAVE_LIBELF
+/* Query the build-id from the ELF file NAME and store it in the newly
+ allocated *build_id array of size *build_id_size. Returns -1 on
+ error. */
@ -136,11 +139,111 @@
+ 0
+};
+
+static void addDebuginfoPackage(rpmSpec spec, Package pkg, char *buildroot)
+{
+ const char *a;
+
int processBinaryFiles(rpmSpec spec, int installSpecialDoc, int test)
+ 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;
+ rpmfi fi = pkg->cpioList;
+ char tmp[1024];
+ const char *name;
+ ARGV_t files = NULL;
+ int seen_build_id = 0;
+
+ /* Check if the current package has files with debug info
+ and record them. */
+ fi = rpmfiInit (fi, 0);
+ while (rpmfiNext (fi) >= 0)
+ {
+ const char *base;
+ int i;
+ unsigned char *build_id;
+ size_t build_id_size = 0;
+ struct stat sbuf;
+
+ name = rpmfiFN (fi);
+ /* Skip leading buildroot. */
+ base = name + strlen (buildroot);
+ /* Pre-pend %buildroot/usr/lib/debug and append .debug. */
+ snprintf (tmp, 1024, "%s/usr/lib/debug%s.debug",
+ buildroot, base);
+ /* If that file exists we have debug information for it. */
+ if (access (tmp, F_OK) != 0)
+ continue;
+
+ /* Append the file list preamble. */
+ if (!files)
+ {
+ argvAdd(&files, "%defattr(-,root,root)");
+ argvAdd(&files, "%dir /usr/lib/debug");
+ }
+ /* Add the files main debug-info file. */
+ snprintf (tmp, 1024, "/usr/lib/debug/%s.debug", base);
+ argvAdd(&files, tmp);
+
+ /* Do not bother to check build-ids for symbolic links.
+ We'll handle them for the link target. */
+ if (lstat (name, &sbuf) == -1
+ || S_ISLNK (sbuf.st_mode))
+ continue;
+
+ /* Try to gather the build-id from the binary. */
+ if (getELFBuildId (name, &build_id, &build_id_size) == -1)
+ continue;
+
+ /* If we see build-id links for the first time add the
+ directory. */
+ if (!seen_build_id)
+ argvAdd(&files, "%dir /usr/lib/debug/.build-id");
+
+ /* From the build-id construct the two links pointing back
+ to the debug information file and the binary. */
+ snprintf (tmp, 1024, "/usr/lib/debug/.build-id/%02x/",
+ build_id[0]);
+ for (i = 1; i < build_id_size; ++i)
+ sprintf (tmp + strlen (tmp), "%02x", build_id[i]);
+ argvAdd(&files, tmp);
+ sprintf (tmp + strlen (tmp), ".debug");
+ argvAdd(&files, tmp);
+
+ free (build_id);
+ }
+
+ /* If there are debuginfo files for this package add a
+ new debuginfo package. */
+ if (files)
+ {
+ dbg = newPackage (spec);
+ headerNVR (pkg->header, &name, NULL, NULL);
+ /* Set name, summary and group. */
+ snprintf (tmp, 1024, "%s-debuginfo", name);
+ headerPutString(dbg->header, RPMTAG_NAME, tmp);
+ snprintf (tmp, 1024, "Debug information for package %s", name);
+ headerPutString(dbg->header, RPMTAG_SUMMARY, tmp);
+ snprintf (tmp, 1024, "This package provides debug information for package %s.\n"
+ "Debug information is useful when developing applications that use this\n"
+ "package or when debugging this package.", name);
+ headerPutString(dbg->header, RPMTAG_DESCRIPTION, tmp);
+ headerPutString(dbg->header, RPMTAG_GROUP, "Development/Debug");
+ /* Inherit other tags from parent. */
+ headerCopyTags (pkg->header, dbg->header, copyTagsForDebug);
+
+ /* Build up the files list. */
+ dbg->fileList = files;
+ }
+ }
+}
+#endif
+
rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
int installSpecialDoc, int test)
{
Package pkg;
int rc = RPMRC_OK;
rpmRC rc = RPMRC_OK;
+ char *buildroot;
check_fileList = newStringBuf();
@ -148,122 +251,24 @@
genSourceRpmName(spec);
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
@@ -2250,8 +2378,110 @@ int processBinaryFiles(rpmSpec spec, int
@@ -2127,8 +2355,12 @@ rpmRC processBinaryFiles(rpmSpec spec, r
rpmlog(RPMLOG_NOTICE, _("Processing files: %s\n"), nvr);
free(nvr);
- if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test)) != RPMRC_OK ||
- if ((rc = processPackageFiles(spec, pkgFlags, pkg, installSpecialDoc, test)) != RPMRC_OK ||
- (rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK)
+ if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test)) != RPMRC_OK)
+ if ((rc = processPackageFiles(spec, pkgFlags, pkg, installSpecialDoc, test)) != RPMRC_OK)
+ goto exit;
+
+ /* 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;
+ rpmfi fi = pkg->cpioList;
+ char tmp[1024];
+ const char *name;
+ StringBuf files = NULL;
+ int seen_build_id = 0;
+
+ /* Check if the current package has files with debug info
+ and record them. */
+ fi = rpmfiInit (fi, 0);
+ while (rpmfiNext (fi) >= 0)
+ {
+ const char *base;
+ int i;
+ unsigned char *build_id;
+ size_t build_id_size = 0;
+ struct stat sbuf;
+
+ name = rpmfiFN (fi);
+ /* Skip leading buildroot. */
+ base = name + strlen (buildroot);
+ /* Pre-pend %buildroot/usr/lib/debug and append .debug. */
+ snprintf (tmp, 1024, "%s/usr/lib/debug%s.debug",
+ buildroot, base);
+ /* If that file exists we have debug information for it. */
+ if (access (tmp, F_OK) != 0)
+ continue;
+
+ /* Append the file list preamble. */
+ if (!files)
+ {
+ files = newStringBuf();
+ appendStringBuf(files, "%defattr(-,root,root)\n");
+ appendStringBuf(files, "%dir /usr/lib/debug\n");
+ }
+ /* Add the files main debug-info file. */
+ snprintf (tmp, 1024, "/usr/lib/debug/%s.debug\n", base);
+ appendStringBuf(files, tmp);
+
+ /* Do not bother to check build-ids for symbolic links.
+ We'll handle them for the link target. */
+ if (lstat (name, &sbuf) == -1
+ || S_ISLNK (sbuf.st_mode))
+ continue;
+
+ /* Try to gather the build-id from the binary. */
+ if (getELFBuildId (name, &build_id, &build_id_size) == -1)
+ continue;
+
+ /* If we see build-id links for the first time add the
+ directory. */
+ if (!seen_build_id)
+ appendStringBuf(files, "%dir /usr/lib/debug/.build-id\n");
+
+ /* From the build-id construct the two links pointing back
+ to the debug information file and the binary. */
+ snprintf (tmp, 1024, "/usr/lib/debug/.build-id/%02x/",
+ build_id[0]);
+ for (i = 1; i < build_id_size; ++i)
+ sprintf (tmp + strlen (tmp), "%02x", build_id[i]);
+ appendStringBuf(files, tmp);
+ appendStringBuf(files, "\n");
+ appendStringBuf(files, tmp);
+ appendStringBuf(files, ".debug\n");
+
+ free (build_id);
+ }
+
+ /* If there are debuginfo files for this package add a
+ new debuginfo package. */
+ if (files)
+ {
+ dbg = newPackage (spec);
+ headerNVR (pkg->header, &name, NULL, NULL);
+ /* Set name, summary and group. */
+ snprintf (tmp, 1024, "%s-debuginfo", name);
+ headerPutString(dbg->header, RPMTAG_NAME, tmp);
+ snprintf (tmp, 1024, "Debug information for package %s", name);
+ headerPutString(dbg->header, RPMTAG_SUMMARY, tmp);
+ snprintf (tmp, 1024, "This package provides debug information for package %s.\n"
+ "Debug information is useful when developing applications that use this\n"
+ "package or when debugging this package.", name);
+ headerPutString(dbg->header, RPMTAG_DESCRIPTION, tmp);
+ headerPutString(dbg->header, RPMTAG_GROUP, "Development/Debug");
+ /* Inherit other tags from parent. */
+ headerCopyTags (pkg->header, dbg->header, copyTagsForDebug);
+
+ /* Build up the files list. */
+ dbg->fileList = files;
+ }
+ }
+ addDebuginfoPackage(spec, pkg, buildroot);
+#endif
+ /* END DEBUGPKG */
+
+ if ((rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK)
goto exit;
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 @@
--- ./macros.in.orig 2011-05-13 15:34:01.000000000 +0000
+++ ./macros.in 2011-05-13 15:34:10.000000000 +0000
@@ -179,24 +179,10 @@
# Template for debug information sub-package.
%debug_package \
%global __debug_package 1\
@ -288,9 +293,9 @@
%description debugsource\
This package provides debug sources for package %{name}.\
Debug sources are useful when developing applications that use this\
--- ./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
--- ./scripts/find-debuginfo.sh.orig 2011-05-13 15:34:01.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-13 15:34:10.000000000 +0000
@@ -277,19 +277,11 @@ while read nlinks inum f; do
fi
done || exit

View File

@ -1,16 +0,0 @@
--- ./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);
}
+ if (spec->clean == NULL) {
+ char *body = rpmExpand("%{?buildroot: %{__rm} -rf %{buildroot}}", NULL);
+ spec->clean = newStringBuf();
+ appendLineStringBuf(spec->clean, body);
+ free(body);
+ }
+
/* Check for description in each package and add arch and os */
{
char *platform = rpmExpand("%{_target_platform}", NULL);

View File

@ -1,24 +0,0 @@
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.
--- ./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);
dsi->obneeded = dsi->bneeded;
}
}
@@ -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)));
dsi->oineeded = dsi->ineeded;
}
}

View File

@ -1,6 +1,8 @@
--- ./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 {
Hmm, SUSE doesn't use it, so what's the purpose of this patch?
--- ./build/parsePreamble.c.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./build/parsePreamble.c 2011-05-11 15:59:08.000000000 +0000
@@ -485,6 +485,7 @@ static struct optionalTag {
{ RPMTAG_PACKAGER, "%{packager}" },
{ RPMTAG_DISTRIBUTION, "%{distribution}" },
{ RPMTAG_DISTURL, "%{disturl}" },
@ -8,8 +10,8 @@
{ RPMTAG_BUGURL, "%{bugurl}" },
{ -1, NULL }
};
--- ./macros.in.orig 2010-03-25 15:18:50.000000000 +0000
+++ ./macros.in 2010-03-25 15:19:25.000000000 +0000
--- ./macros.in.orig 2011-05-11 15:38:44.000000000 +0000
+++ ./macros.in 2011-05-11 15:59:08.000000000 +0000
@@ -279,6 +279,16 @@ package or when debugging this package.\
#
#%bugurl

13
emptyprep.diff Normal file
View File

@ -0,0 +1,13 @@
Do not segfault if the prep section is empty
--- build/parsePrep.c.orig 2011-05-13 16:22:59.000000000 +0000
+++ build/parsePrep.c 2011-05-13 16:23:41.000000000 +0000
@@ -518,7 +518,7 @@ int parsePrep(rpmSpec spec)
}
}
- for (ARGV_const_t lines = saveLines; *lines; lines++) {
+ for (ARGV_const_t lines = saveLines; lines && *lines; lines++) {
res = 0;
if (rstreqn(*lines, "%setup", sizeof("%setup")-1)) {
res = doSetupMacro(spec, *lines);

View File

@ -4,11 +4,9 @@ assumed to be true.
This mechanism is used by the weakdeps patch to filter the
"RPMSENSE_STRONG" flag.
Index: lib/headerfmt.c
===================================================================
--- lib/headerfmt.c.orig
+++ lib/headerfmt.c
@@ -582,8 +582,12 @@ static int parseExpression(headerSprintf
--- ./lib/headerfmt.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./lib/headerfmt.c 2011-05-10 17:06:49.000000000 +0000
@@ -568,8 +568,12 @@ static int parseExpression(headerSprintf
*endPtr = chptr;
@ -21,7 +19,7 @@ Index: lib/headerfmt.c
(void) findTag(hsa, token, str);
return 0;
@@ -675,6 +679,7 @@ static char * singleSprintf(headerSprint
@@ -657,6 +661,7 @@ static char * singleSprintf(headerSprint
int i, j, found;
rpm_count_t count, numElements;
sprintfToken spft;
@ -29,7 +27,7 @@ Index: lib/headerfmt.c
int condNumFormats;
size_t need;
@@ -705,6 +710,18 @@ static char * singleSprintf(headerSprint
@@ -687,6 +692,18 @@ static char * singleSprintf(headerSprint
headerIsEntry(hsa->h, token->u.cond.tag.tag)) {
spft = token->u.cond.ifFormat;
condNumFormats = token->u.cond.numIfTokens;
@ -48,7 +46,7 @@ Index: lib/headerfmt.c
} else {
spft = token->u.cond.elseFormat;
condNumFormats = token->u.cond.numElseTokens;
@@ -728,10 +745,13 @@ static char * singleSprintf(headerSprint
@@ -710,10 +727,13 @@ static char * singleSprintf(headerSprint
for (i = 0; i < token->u.array.numTokens; i++, spft++)
{
rpmtd td = NULL;

58
fileattrs.diff Normal file
View File

@ -0,0 +1,58 @@
Add needed fileattrs for compatibility. In the future they will
be moved into the corresponding packages.
--- ./fileattrs/Makefile.am.orig 2011-05-13 14:34:47.000000000 +0000
+++ ./fileattrs/Makefile.am 2011-05-13 14:35:28.000000000 +0000
@@ -6,6 +6,7 @@ fattrsdir = $(rpmconfigdir)/fileattrs
fattrs_DATA = \
desktop.attr elf.attr font.attr libtool.attr perl.attr perllib.attr \
- pkgconfig.attr python.attr ocaml.attr script.attr mono.attr
+ pkgconfig.attr python.attr ocaml.attr script.attr mono.attr \
+ debuginfo.attr firmware.attr gstreamer.attr ksyms.attr sysvinit.attr
EXTRA_DIST = $(fattrs_DATA)
--- ./fileattrs/debuginfo.attr.orig 2011-05-13 14:16:03.000000000 +0000
+++ ./fileattrs/debuginfo.attr 2011-05-13 14:17:13.000000000 +0000
@@ -0,0 +1,2 @@
+%__debuginfo_provides %{_rpmconfigdir}/debuginfo.prov
+%__debuginfo_path ^/usr/lib/debug/
--- ./fileattrs/desktop.attr.orig 2011-05-13 13:59:14.000000000 +0000
+++ ./fileattrs/desktop.attr 2011-05-13 14:07:03.000000000 +0000
@@ -1,2 +1,2 @@
-%__desktop_provides %{_rpmconfigdir}/desktop-file.prov
-%__desktop_path ^%{_datadir}/applications/.*\\.desktop$
+%__desktop_provides %{_rpmconfigdir}/mimetypes.prov
+%__desktop_path .*\\.desktop$
--- ./fileattrs/firmware.attr.orig 2011-05-13 14:13:39.000000000 +0000
+++ ./fileattrs/firmware.attr 2011-05-13 14:14:37.000000000 +0000
@@ -0,0 +1,2 @@
+%__firmware_provides %{_rpmconfigdir}/firmware.prov
+%__firmware_path /lib/firmware/
--- ./fileattrs/gstreamer.attr.orig 2011-05-13 14:28:51.000000000 +0000
+++ ./fileattrs/gstreamer.attr 2011-05-13 14:31:59.000000000 +0000
@@ -0,0 +1,4 @@
+%__gstreamer_provides %{_rpmconfigdir}/gstreamer-provides
+%__gstreamer_path libgst
+%__gstreamer_magic ELF.*shared object
+%__gstreamer_flags magic_and_path
--- ./fileattrs/ksyms.attr.orig 2011-05-13 14:20:57.000000000 +0000
+++ ./fileattrs/ksyms.attr 2011-05-13 14:27:04.000000000 +0000
@@ -0,0 +1,4 @@
+%__ksyms_provides %{_rpmconfigdir}/find-provides.ksyms %name
+%__ksyms_requires %{_rpmconfigdir}/find-requires.ksyms %name
+%__ksyms_supplements %{_rpmconfigdir}/find-supplements.ksyms %name
+%__ksyms_path (/lib/modules/.*\.ko(\.gz)?)|(/boot/vmlinu[xz].*)$
--- ./fileattrs/perl.attr.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./fileattrs/perl.attr 2011-05-13 14:09:31.000000000 +0000
@@ -1,3 +1,4 @@
-%__perl_requires %{_rpmconfigdir}/perl.req
+# disabled for now
+#%__perl_requires %{_rpmconfigdir}/perl.req
%__perl_magic ^.*perl .*$
%__perl_flags exeonly
--- ./fileattrs/sysvinit.attr.orig 2011-05-13 14:32:30.000000000 +0000
+++ ./fileattrs/sysvinit.attr 2011-05-13 14:33:56.000000000 +0000
@@ -0,0 +1,2 @@
+%__sysvinit_provides %{_rpmconfigdir}/sysvinitdeps.sh --provides
+%__sysvinit_path ^/etc/init\.d/

View File

@ -1,13 +1,17 @@
Index: build/files.c
===================================================================
--- build/files.c.orig
+++ build/files.c
@@ -2211,6 +2211,8 @@ static int checkFiles(StringBuf fileList
_("Installed (but unpackaged) file(s) found:\n%s"), t);
}
}
+ else
+ checkFiles(check_fileList);
Print "unpackaged files" section even if there was an error
in the filelist.
--- ./build/files.c.orig 2011-05-11 15:27:11.000000000 +0000
+++ ./build/files.c 2011-05-11 15:29:12.000000000 +0000
@@ -2149,10 +2149,10 @@ rpmRC processBinaryFiles(rpmSpec spec, r
*/
exit:
sb_stdout = freeStringBuf(sb_stdout);
+exit:
if (checkFiles(spec->buildRoot, check_fileList) > 0) {
rc = RPMRC_FAIL;
}
-exit:
check_fileList = freeStringBuf(check_fileList);
return rc;

View File

@ -6,15 +6,10 @@ do it right in the first place. So this patch changes find-debuginfo.sh scripts
behavior to reflect that policy.
Signed-off-by: Jan Blunck <jblunck@suse.de>
---
scripts/find-debuginfo.sh | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
Index: b/scripts/find-debuginfo.sh
===================================================================
--- scripts/find-debuginfo.sh
+++ scripts/find-debuginfo.sh
@@ -123,7 +123,17 @@ debug_link()
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 15:36:05.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 15:58:17.000000000 +0000
@@ -124,7 +124,17 @@ debug_link()
local l="/usr/lib/debug$2"
local t="$1"
echo >> "$LINKSFILE" "$l $t"
@ -33,7 +28,7 @@ Index: b/scripts/find-debuginfo.sh
}
# Compare two binaries but ignore the .note.gnu.build-id section
@@ -157,8 +167,8 @@ make_id_link()
@@ -158,8 +168,8 @@ make_id_link()
local other=$(readlink -m "$root_idfile")
other=${other#$RPM_BUILD_ROOT}

View File

@ -1,12 +1,6 @@
---
scripts/find-debuginfo.sh | 69 +++++++++++++++++++++++++++++++++++-----------
1 file changed, 53 insertions(+), 16 deletions(-)
Index: scripts/find-debuginfo.sh
===================================================================
--- scripts/find-debuginfo.sh.orig
+++ scripts/find-debuginfo.sh
@@ -126,6 +126,20 @@ debug_link()
--- ./scripts/find-debuginfo.sh.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 14:46:18.000000000 +0000
@@ -127,6 +127,20 @@ debug_link()
link_relative "$t" "$l" "$RPM_BUILD_ROOT"
}
@ -27,7 +21,7 @@ Index: scripts/find-debuginfo.sh
# Make a build-id symlink for id $1 with suffix $3 to file $2.
make_id_link()
{
@@ -144,7 +158,7 @@ make_id_link()
@@ -145,7 +159,7 @@ make_id_link()
local other=$(readlink -m "$root_idfile")
other=${other#$RPM_BUILD_ROOT}
if cmp -s "$root_idfile" "$RPM_BUILD_ROOT$file" ||
@ -36,7 +30,7 @@ Index: scripts/find-debuginfo.sh
# Two copies. Maybe one has to be setuid or something.
echo >&2 "*** WARNING: identical binaries are copied, not linked:"
echo >&2 " $file"
@@ -173,12 +187,18 @@ strict_error=ERROR
@@ -174,12 +188,18 @@ strict_error=ERROR
$strict || strict_error=WARNING
# Strip ELF binaries
@ -60,7 +54,7 @@ Index: scripts/find-debuginfo.sh
get_debugfn "$f"
[ -f "${debugfn}" ] && continue
@@ -199,8 +219,11 @@ while read nlinks inum f; do
@@ -200,8 +220,11 @@ while read nlinks inum f; do
fi
echo "extracting debug info from $f"
@ -74,7 +68,7 @@ Index: scripts/find-debuginfo.sh
if [ -z "$id" ]; then
echo >&2 "*** ${strict_error}: No build ID note found in $f"
$strict && exit 2
@@ -215,13 +238,25 @@ while read nlinks inum f; do
@@ -218,13 +241,25 @@ while read nlinks inum f; do
esac
mkdir -p "${debugdn}"
@ -107,7 +101,7 @@ Index: scripts/find-debuginfo.sh
if [ -n "$id" ]; then
make_id_link "$id" "$dn/$(basename $f)"
@@ -250,12 +285,14 @@ if [ -s "$SOURCEFILE" ]; then
@@ -253,12 +288,14 @@ if [ -s "$SOURCEFILE" ]; then
# stupid cpio creates new directories in mode 0700, fixup
find "${RPM_BUILD_ROOT}/usr/src/debug" -type d -print0 |
xargs --no-run-if-empty -0 chmod a+rx

View File

@ -1,16 +1,16 @@
SUSE specific kernel provides/requires scripts
--- ./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 \
--- ./scripts/Makefile.am.orig 2011-05-11 14:31:45.000000000 +0000
+++ ./scripts/Makefile.am 2011-05-11 14:46:38.000000000 +0000
@@ -16,6 +16,7 @@ EXTRA_DIST = \
rpmdb_loadcvt rpm.daily rpm.log 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 = \
@@ -32,6 +33,7 @@ rpmconfig_SCRIPTS = \
check-buildroot check-rpaths check-rpaths-worker \
find-lang.sh \
perl.prov perl.req perldeps.pl pythondeps.sh osgideps.pl \
@ -18,8 +18,8 @@ SUSE specific kernel provides/requires scripts
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
--- ./scripts/find-provides.ksyms.orig 2011-05-11 14:46:38.000000000 +0000
+++ ./scripts/find-provides.ksyms 2011-05-11 14:46:38.000000000 +0000
@@ -0,0 +1,41 @@
+#! /bin/sh
+
@ -62,8 +62,8 @@ SUSE specific kernel provides/requires scripts
+ | sed -r -ne "s/^0*([0-9a-f]+) A __crc_(.+)/ksym($flavor:\\2) = \\1/p"
+done \
+| sort -u
--- ./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
--- ./scripts/find-requires.ksyms.orig 2011-05-11 14:46:38.000000000 +0000
+++ ./scripts/find-requires.ksyms 2011-05-11 14:46:38.000000000 +0000
@@ -0,0 +1,57 @@
+#! /bin/bash
+

View File

@ -1,7 +1,5 @@
Index: scripts/find-lang.sh
===================================================================
--- scripts/find-lang.sh.orig
+++ scripts/find-lang.sh
--- ./scripts/find-lang.sh.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./scripts/find-lang.sh 2011-05-11 14:53:34.000000000 +0000
@@ -28,10 +28,10 @@ the top of the tree containing the files
PACKAGE_NAME is the %{name} of the package. This should also be
the basename of the .mo files. the output is written to
@ -42,12 +40,12 @@ Index: scripts/find-lang.sh
--with-qt )
QT=
shift
@@ -97,33 +105,49 @@ while test $# -gt 0 ; do
@@ -97,33 +105,40 @@ while test $# -gt 0 ; do
esac
done
+if ! test -s $MO_NAME ; then
+ echo "%defattr (644, root, root, 755)" > $MO_NAME
+ echo "%defattr (644, root, root, 755)" > $MO_NAME
+fi
+
+MO_NAME_NEW=$MO_NAME.tmp.$$
@ -55,21 +53,14 @@ Index: scripts/find-lang.sh
+
find $TOP_DIR -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
'"$NO_ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
-'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
-'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
+'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) %doc \1\2\3:
+'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) %doc \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' > $MO_NAME
+/^$/d' >> $MO_NAME_NEW
+
+find $TOP_DIR -type f -o -type l|sed '
+s:'"$TOP_DIR"'::
+/\/share\/locale\//d
+'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\([^/]*\)\(.*\)/LC_MESSAGES/.*\.mo$:%lang(\2) %doc \1\2\3\4:
+'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\([^/]*\)\(.*\)/LC_MESSAGES/'"$NAME"'\.mo$:%lang(\2) %doc \1\2\3\4:
+s:^\([^%].*\)::
+s:%lang(C) ::
+/^ *$/d' >> $MO_NAME_NEW
find $TOP_DIR -type d|sed '
s:'"$TOP_DIR"'::
@ -99,7 +90,7 @@ Index: scripts/find-lang.sh
find $TOP_DIR -type f|sed '
s:'"$TOP_DIR"'::
@@ -131,7 +155,7 @@ s:'"$TOP_DIR"'::
@@ -131,7 +146,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
s:^[^%].*::
s:%lang(C) ::
@ -108,7 +99,7 @@ Index: scripts/find-lang.sh
KDE3_HTML=`kde-config --expandvars --install html 2>/dev/null`
if [ x"$KDE3_HTML" != x -a -d "$TOP_DIR$KDE3_HTML" ]; then
@@ -143,7 +167,7 @@ s:'"$TOP_DIR"'::
@@ -143,7 +158,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
@ -117,7 +108,7 @@ Index: scripts/find-lang.sh
fi
KDE4_HTML=`kde4-config --expandvars --install html 2>/dev/null`
@@ -156,7 +180,7 @@ s:'"$TOP_DIR"'::
@@ -156,7 +171,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
@ -126,7 +117,7 @@ Index: scripts/find-lang.sh
fi
find $TOP_DIR -type f -o -type l|sed '
@@ -168,7 +192,7 @@ s:'"$TOP_DIR"'::
@@ -168,7 +183,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
s:^[^%].*::
s:%lang(C) ::
@ -135,7 +126,7 @@ Index: scripts/find-lang.sh
find $TOP_DIR -type d|sed '
s:'"$TOP_DIR"'::
@@ -176,17 +200,22 @@ s:'"$TOP_DIR"'::
@@ -176,17 +191,22 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
s:^\([^%].*\)::
s:%lang(C) ::

75
findsupplements.diff Normal file
View File

@ -0,0 +1,75 @@
Add support for supplements to the internal dependency
generator.
--- build/rpmfc.c.orig 2011-05-13 16:54:26.000000000 +0000
+++ build/rpmfc.c 2011-05-13 17:11:20.000000000 +0000
@@ -54,6 +54,7 @@ struct rpmfc_s {
rpmds provides; /*!< (no. provides) package provides */
rpmds requires; /*!< (no. requires) package requires */
+ rpmds supplements; /*!< (no. supplements) package supplements */
};
struct rpmfcTokens_s {
@@ -481,6 +482,14 @@ static int rpmfcHelper(rpmfc fc, unsigne
dsContext = RPMSENSE_FIND_REQUIRES;
tagN = RPMTAG_REQUIRENAME;
break;
+ case 'S':
+ if (fc->skipProv)
+ return 0;
+ depname = "supplements";
+ depsp = &fc->supplements;
+ dsContext = RPMSENSE_FIND_REQUIRES|RPMSENSE_STRONG|RPMSENSE_MISSINGOK;
+ tagN = RPMTAG_ENHANCESNAME;
+ break;
}
/* If the entire path is filtered out, there's nothing more to do */
@@ -752,6 +761,7 @@ rpmfc rpmfcFree(rpmfc fc)
fc->provides = rpmdsFree(fc->provides);
fc->requires = rpmdsFree(fc->requires);
+ fc->supplements = rpmdsFree(fc->supplements);
}
fc = _free(fc);
return NULL;
@@ -804,6 +814,7 @@ rpmRC rpmfcApply(rpmfc fc)
for (ARGV_t fattr = fc->fattrs[fc->ix]; fattr && *fattr; fattr++) {
xx += rpmfcHelper(fc, 'P', *fattr);
xx += rpmfcHelper(fc, 'R', *fattr);
+ xx += rpmfcHelper(fc, 'S', *fattr);
}
}
@@ -846,6 +857,11 @@ rpmRC rpmfcApply(rpmfc fc)
dix = rpmdsFind(fc->requires, ds);
ds = rpmdsFree(ds);
break;
+ case 'S':
+ ds = rpmdsSingle(RPMTAG_ENHANCESNAME, N, EVR, Flags);
+ dix = rpmdsFind(fc->supplements, ds);
+ ds = rpmdsFree(ds);
+ break;
}
/* XXX assertion incorrect while generating -debuginfo deps. */
@@ -1357,6 +1373,18 @@ rpmRC rpmfcGenerateDepends(const rpmSpec
}
}
+ /* Add Supplements: */
+ if (fc->supplements != NULL && rpmdsCount(fc->supplements) > 0 && !fc->skipReq) {
+ rpmds pi = rpmdsInit(fc->supplements);
+ while (rpmdsNext(pi) >= 0) {
+ rpmsenseFlags flags = rpmdsFlags(pi);
+
+ headerPutString(pkg->header, RPMTAG_ENHANCESNAME, rpmdsN(pi));
+ headerPutString(pkg->header, RPMTAG_ENHANCESVERSION, rpmdsEVR(pi));
+ headerPutUint32(pkg->header, RPMTAG_ENHANCESFLAGS, &flags, 1);
+ }
+ }
+
/* Add dependency dictionary(#dependencies) */
if (rpmtdFromArgi(&td, RPMTAG_DEPENDSDICT, fc->ddictx)) {
assert(rpmtdType(&td) == RPM_INT32_TYPE);

View File

@ -1,47 +0,0 @@
--- ./lib/fsm.c.orig 2010-06-04 13:47:57.000000000 +0000
+++ ./lib/fsm.c 2010-06-04 13:48:07.000000000 +0000
@@ -1323,6 +1323,21 @@ static const char * rpmteTypeString(rpmt
}
}
+static void removeSBITS(const char *path)
+{
+ struct stat stb;
+ if (lstat(path, &stb) == 0 && S_ISREG(stb.st_mode)) {
+ if ((stb.st_mode & 06000) != 0) {
+ (void) chmod(path, stb.st_mode & 0777);
+ }
+#if WITH_CAP
+ if (stb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) {
+ (void) cap_set_file(path, NULL);
+ }
+#endif
+ }
+}
+
#define IS_DEV_LOG(_x) \
((_x) != NULL && strlen(_x) >= (sizeof("/dev/log")-1) && \
rstreqn((_x), "/dev/log", sizeof("/dev/log")-1) && \
@@ -2027,11 +2042,8 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS
break;
case FSM_UNLINK:
- if (fsm->mapFlags & CPIO_SBIT_CHECK) {
- struct stat stb;
- if (lstat(fsm->path, &stb) == 0 && S_ISREG(stb.st_mode) && (stb.st_mode & 06000) != 0)
- chmod(fsm->path, stb.st_mode & 0777);
- }
+ if (fsm->mapFlags & CPIO_SBIT_CHECK)
+ removeSBITS(fsm->path);
rc = unlink(fsm->path);
if (_fsm_debug && (stage & FSM_SYSCALL))
rpmlog(RPMLOG_DEBUG, " %8s (%s) %s\n", cur,
@@ -2040,6 +2052,8 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS
rc = (errno == ENOENT ? CPIOERR_ENOENT : CPIOERR_UNLINK_FAILED);
break;
case FSM_RENAME:
+ if (fsm->mapFlags & CPIO_SBIT_CHECK)
+ removeSBITS(fsm->path);
rc = rename(fsm->opath, fsm->path);
#if defined(ETXTBSY) && defined(__HPUX__)
if (rc && errno == ETXTBSY) {

View File

@ -1,5 +1,5 @@
--- ./autodeps/linux.prov.orig 2010-04-08 14:52:42.000000000 +0000
+++ ./autodeps/linux.prov 2010-04-08 15:04:37.000000000 +0000
--- ./autodeps/linux.prov.orig 2011-05-11 16:39:09.000000000 +0000
+++ ./autodeps/linux.prov 2011-05-11 16:40:49.000000000 +0000
@@ -16,6 +16,8 @@ tcllist=
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
mimetypelist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(desktop)\$"))
@ -26,9 +26,9 @@
# --- Kernel module exported symbols
[ -x /usr/lib/rpm/find-provides.ksyms ] &&
printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-provides.ksyms "$@"
--- ./autodeps/linux.req.orig 2010-04-08 15:01:18.000000000 +0000
+++ ./autodeps/linux.req 2010-04-08 15:04:20.000000000 +0000
@@ -35,6 +35,7 @@ perllist=()
--- ./autodeps/linux.req.orig 2011-05-11 16:39:09.000000000 +0000
+++ ./autodeps/linux.req 2011-05-11 16:40:49.000000000 +0000
@@ -34,6 +34,7 @@ perllist=()
pythonlist=($(printf "%s\n" "${filelist[@]}" | egrep '/usr/lib[^/]*/python.\..'))
tcllist=()
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)(\\.config)?\$"))
@ -36,7 +36,7 @@
#
# --- Alpha does not mark 64bit dependencies
@@ -144,6 +145,11 @@ if [ -x $MONO_PREFIX/bin/mono -a -n "$mo
@@ -143,6 +144,11 @@ if [ -x $MONO_PREFIX/bin/mono -a -n "$mo
fi
#
@ -48,17 +48,3 @@
# --- Kernel module imported symbols
[ -x ${0%/*}/find-requires.ksyms ] &&
printf "%s\n" "${filelist[@]}" | ${0%/*}/find-requires.ksyms "$@"
--- ./scripts/fontconfig.prov.orig 2010-04-08 14:57:21.000000000 +0000
+++ ./scripts/fontconfig.prov 2010-04-08 14:57:42.000000000 +0000
@@ -12,7 +12,10 @@
fcquery=/usr/bin/fc-query
-[ -x $fcquery ] || exit 0
+[ -x $fcquery ] || {
+ cat > /dev/null
+ exit 0
+}
# filter out anything outside main fontconfig path
grep /usr/share/fonts/ |

55
headeradddb.diff Normal file
View File

@ -0,0 +1,55 @@
Add rpmtsHeaderAddDB and rpmtsHeaderRemoveDB so that
convertdb1 will build again.
--- lib/rpmts.c.orig 2011-05-12 13:21:03.000000000 +0000
+++ lib/rpmts.c 2011-05-12 13:26:25.000000000 +0000
@@ -159,6 +159,24 @@ int rpmtsVerifyDB(rpmts ts)
return rc;
}
+int rpmtsHeaderAddDB(rpmts ts, Header h)
+{
+ if (rpmtsOpenDB(ts, (O_RDWR|O_CREAT)))
+ return RPMRC_FAIL;
+ if (rpmdbAdd(rpmtsGetRdb(ts), h) != 0)
+ return RPMRC_FAIL;
+ return RPMRC_OK;
+}
+
+int rpmtsHeaderRemoveDB(rpmts ts, unsigned int hdrNum)
+{
+ if (rpmtsOpenDB(ts, (O_RDWR|O_CREAT)))
+ return RPMRC_FAIL;
+ if (rpmdbRemove(rpmtsGetRdb(ts), hdrNum) != 0)
+ return RPMRC_FAIL;
+ return RPMRC_OK;
+}
+
/* keyp might no be defined. */
rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag,
const void * keyp, size_t keylen)
--- lib/rpmts.h.orig 2011-05-12 13:21:11.000000000 +0000
+++ lib/rpmts.h 2011-05-12 13:28:32.000000000 +0000
@@ -264,6 +264,22 @@ int rpmtsRebuildDB(rpmts ts);
int rpmtsVerifyDB(rpmts ts);
/** \ingroup rpmts
+ * Add a header to the database used by the transaction.
+ * @param ts transaction set
+ * @param h header to add
+ * @return 0 on success
+ */
+int rpmtsHeaderAddDB(rpmts ts, Header h);
+
+/** \ingroup rpmts
+ * Remove a header from the database used by the transaction.
+ * @param ts transaction set
+ * @param hdrNum index of header to remove
+ * @return 0 on success
+ */
+int rpmtsHeaderRemoveDB(rpmts ts, unsigned int hdrNum);
+
+/** \ingroup rpmts
* Return transaction database iterator.
* @param ts transaction set
* @param rpmtag database index tag

View File

@ -1,7 +1,5 @@
Index: rpm-4.8.0/autodeps/linux.prov
===================================================================
--- rpm-4.8.0.orig/autodeps/linux.prov 2010-12-08 15:16:12.984842683 +0100
+++ rpm-4.8.0/autodeps/linux.prov 2010-12-08 15:16:52.530842661 +0100
--- ./autodeps/linux.prov.orig 2011-05-11 16:45:13.000000000 +0000
+++ ./autodeps/linux.prov 2011-05-11 16:51:10.000000000 +0000
@@ -107,4 +107,9 @@ fi
[ -x /usr/lib/rpm/gstreamer-provides ] &&
printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/gstreamer-provides | sort -u
@ -12,14 +10,34 @@ Index: rpm-4.8.0/autodeps/linux.prov
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/sysvinitdeps.sh -P | sort -u
+
exit 0
Index: rpm-4.8.0/scripts/sysvinitdeps.sh
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ rpm-4.8.0/scripts/sysvinitdeps.sh 2010-12-08 15:17:11.183843303 +0100
@@ -0,0 +1,13 @@
--- ./scripts/Makefile.am.orig 2011-05-11 14:46:38.000000000 +0000
+++ ./scripts/Makefile.am 2011-05-11 16:52:10.000000000 +0000
@@ -22,6 +22,7 @@ EXTRA_DIST = \
ocaml-find-requires.sh ocaml-find-provides.sh \
pkgconfigdeps.sh libtooldeps.sh \
fontconfig.prov desktop-file.prov script.req \
+ sysvinitdeps.sh \
macros.perl macros.php macros.python
rpmconfig_SCRIPTS = \
@@ -38,6 +39,7 @@ rpmconfig_SCRIPTS = \
pkgconfigdeps.sh libtooldeps.sh \
ocaml-find-requires.sh ocaml-find-provides.sh \
fontconfig.prov desktop-file.prov script.req \
+ sysvinitdeps.sh \
rpmdb_loadcvt rpm2cpio.sh tcl.req tgpg
rpmconfig_DATA = \
--- ./scripts/sysvinitdeps.sh.orig 2011-05-11 16:51:10.000000000 +0000
+++ ./scripts/sysvinitdeps.sh 2011-05-11 16:54:33.000000000 +0000
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# -P blindly assumed
+[ "$1" = '-P' -o "$1" = '--provides' ] || {
+ cat > /dev/null
+ exit 0
+}
+
+while read file; do
+ case $file in
+ */etc/init.d/*)
@ -30,15 +48,3 @@ Index: rpm-4.8.0/scripts/sysvinitdeps.sh
+ ;;
+ esac
+done
Index: rpm-4.8.0/scripts/Makefile.am
===================================================================
--- rpm-4.8.0.orig/scripts/Makefile.am 2010-12-08 15:16:12.985844013 +0100
+++ rpm-4.8.0/scripts/Makefile.am 2010-12-08 15:16:52.531842720 +0100
@@ -40,6 +40,7 @@ rpmconfig_SCRIPTS = \
pkgconfigdeps.sh libtooldeps.sh \
ocaml-find-requires.sh ocaml-find-provides.sh \
fontconfig.prov desktop-file.prov \
+ sysvinitdeps.sh \
rpmdb_loadcvt rpmdiff rpm2cpio.sh tcl.req tgpg
rpmconfig_DATA = \

View File

@ -1,6 +1,6 @@
--- ./macros.in.orig 2010-10-28 13:57:37.000000000 +0000
+++ ./macros.in 2010-10-29 12:35:39.000000000 +0000
@@ -1381,6 +1381,7 @@ EOF
--- ./macros.in.orig 2011-05-11 15:59:44.000000000 +0000
+++ ./macros.in 2011-05-11 16:45:30.000000000 +0000
@@ -1247,6 +1247,7 @@ EOF
# %files -f %{name}.lang
#
%find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot}
@ -8,8 +8,8 @@
# Commands + opts to use for retrieving remote files
# Proxy opts can be set through --httpproxy/--httpport popt aliases,
--- ./scripts/find-lang.sh.orig 2010-10-28 13:44:49.000000000 +0000
+++ ./scripts/find-lang.sh 2010-10-29 09:39:22.000000000 +0000
--- ./scripts/find-lang.sh.orig 2011-05-11 14:53:34.000000000 +0000
+++ ./scripts/find-lang.sh 2011-05-11 16:45:30.000000000 +0000
@@ -62,6 +62,8 @@ MO=
MO_NAME=$NAME.lang
ALL_NAME=#
@ -34,17 +34,15 @@
* )
MO_NAME=${1}
shift
@@ -117,6 +127,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
'"$NO_ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
@@ -117,27 +127,32 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) %doc \1\2\3:
'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) %doc \1\2\3:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -131,22 +143,25 @@ s:%lang(C) ::
find $TOP_DIR -type d|sed '
s:'"$TOP_DIR"'::
-'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir %doc \1:
@ -73,7 +71,7 @@
/^$/d' >> $MO_NAME_NEW
find $TOP_DIR -type f|sed '
@@ -154,6 +169,8 @@ s:'"$TOP_DIR"'::
@@ -145,6 +160,8 @@ s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'/'"$NAME"'-\([^/.]\+\)\.omf\):%lang(\2) \1:
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
s:^[^%].*::
@ -82,7 +80,7 @@
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -166,6 +183,8 @@ s:'"$TOP_DIR"'::
@@ -157,6 +174,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\)::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
@ -91,7 +89,7 @@
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
fi
@@ -179,6 +198,8 @@ s:'"$TOP_DIR"'::
@@ -170,6 +189,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\)::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
@ -100,7 +98,7 @@
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
fi
@@ -191,6 +212,8 @@ s:'"$TOP_DIR"'::
@@ -182,6 +203,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}_[a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
s:^[^%].*::
@ -109,7 +107,7 @@
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -199,6 +222,8 @@ s:'"$TOP_DIR"'::
@@ -190,6 +213,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/\)::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
s:^\([^%].*\)::
@ -118,7 +116,7 @@
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -206,6 +231,8 @@ find $TOP_DIR -type f -o -type l|sed '
@@ -197,6 +222,8 @@ find $TOP_DIR -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*:
s:^\([^%].*\)::

View File

@ -1,6 +1,7 @@
--- ./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
Prefer sys/vfs.h, as statvfs stats all filesystems again
--- ./configure.ac.orig 2011-05-12 12:36:32.000000000 +0000
+++ ./configure.ac 2011-05-12 12:36:42.000000000 +0000
@@ -402,25 +402,25 @@ dnl
found_struct_statfs=no
if test X$found_struct_statfs = Xno ; then
@ -33,242 +34,17 @@
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;
--- ./lib/transaction.c.orig 2011-05-12 12:36:55.000000000 +0000
+++ ./lib/transaction.c 2011-05-12 12:38:03.000000000 +0000
@@ -114,7 +114,11 @@ static rpmDiskSpaceInfo rpmtsCreateDSI(c
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;
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));
}

View File

@ -1,5 +1,8 @@
--- ./lib/tagexts.c.orig 2010-01-08 08:14:37.000000000 +0000
+++ ./lib/tagexts.c 2010-03-24 16:46:03.000000000 +0000
Convert output to the current locale. Assumes utf8 input if the
decoding works, otherwise iso-8859-1.
--- ./lib/tagexts.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./lib/tagexts.c 2011-05-10 16:05:30.000000000 +0000
@@ -2,6 +2,7 @@
* \file lib/formats.c
*/
@ -8,7 +11,7 @@
#include "system.h"
#include <rpm/rpmtypes.h>
@@ -157,6 +158,114 @@ exit:
@@ -150,6 +151,114 @@ exit:
return rc;
}
@ -121,10 +124,10 @@
+}
+
/**
* Retrieve mounted file system paths.
* Retrieve trigger info.
* @param h header
@@ -533,10 +642,41 @@ static int i18nTag(Header h, rpmTag tag,
dstring = _free(dstring);
@@ -435,10 +544,41 @@ static int i18nTag(Header h, rpmTag tag,
#endif
rc = headerGet(h, tag, td, HEADERGET_ALLOC);
+ if (rc && td->data) {
@ -165,7 +168,7 @@
* Retrieve summary text.
* @param h header
* @retval td tag data container
@@ -558,6 +698,16 @@ static int descriptionTag(Header h, rpmt
@@ -460,6 +600,16 @@ static int descriptionTag(Header h, rpmt
return i18nTag(h, RPMTAG_DESCRIPTION, td, hgflags);
}
@ -182,7 +185,7 @@
/**
* Retrieve group text.
* @param h header
@@ -791,6 +941,8 @@ static const struct headerTagFunc_s rpmH
@@ -677,6 +827,8 @@ static const struct headerTagFunc_s rpmH
{ RPMTAG_LONGARCHIVESIZE, longarchivesizeTag },
{ RPMTAG_LONGSIZE, longsizeTag },
{ RPMTAG_LONGSIGSIZE, longsigsizeTag },

View File

@ -1,55 +0,0 @@
--- ./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;
+ int chroot_done;
+ const char *rootDir;
int xx;
rpmlua lua = NULL; /* Global state. */
rpmluav var;
@@ -463,6 +465,22 @@ static rpmRC runLuaScript(rpmpsm psm, He
rpmlog(RPMLOG_DEBUG, "%s: %s running <lua> scriptlet.\n",
psm->stepName, sname);
+ chroot_done = rpmtsChrootDone(ts);
+ rootDir = rpmtsRootDir(ts);
+ if (!chroot_done) {
+ if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/') {
+ xx = chdir("/");
+ rootFd = open(".", O_RDONLY, 0);
+ if (rootFd >= 0) {
+ xx = chroot(rootDir);
+ xx = rpmtsSetChrootDone(ts, 1);
+ }
+ }
+ } else {
+ rootFd = open(".", O_RDONLY, 0);
+ }
+ xx = chdir("/");
+
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 && !rstreq(rootDir, "/") && *rootDir == '/')
+ if (!chroot_done) {
xx = chroot(".");
- xx = rpmtsSetChrootDone(ts, 0);
+ xx = rpmtsSetChrootDone(ts, 0);
+ }
+ }
+ if (!chroot_done) {
+ const char *currDir = rpmtsCurrDir(ts);
+ if (currDir != NULL)
+ xx = chdir(currDir);
}
free(sname);
#else

View File

@ -1,6 +1,6 @@
--- ./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 @@
--- ./macros.in.orig 2011-01-03 13:57:41.000000000 +0000
+++ ./macros.in 2011-05-12 14:32:18.000000000 +0000
@@ -178,22 +178,22 @@
# Template for debug information sub-package.
%debug_package \
@ -52,7 +52,7 @@
#
# Use internal dependency generator rather than external helpers?
-%_use_internal_dependency_generator 1
+%_use_internal_dependency_generator 0
+%_use_internal_dependency_generator 1
#
# Filter GLIBC_PRIVATE Provides: and Requires:
@ -79,32 +79,25 @@
+#%__find_supplements ???
+#%__find_enhances ???
#
# Path to file attribute classifications for automatic dependency
@@ -533,12 +539,12 @@ 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.
-%_dbi_config_Depends %{_dbi_htconfig} temporary private
+%_dbi_config_Depends %{_dbi_htconfig} temporary private nofsync
# Misc BDB tuning options
-%__dbi_other mp_mmapsize=128Mb mp_size=64Mb
+%__dbi_other mp_mmapsize=128Mb mp_size=64Mb
-%_dbi_config_Dirnames %{_dbi_btconfig}
-%_dbi_config_Requireversion %{_dbi_btconfig}
-%_dbi_config_Provideversion %{_dbi_btconfig}
-%_dbi_config_Installtid %{_dbi_btconfig}
-%_dbi_config_Removetid %{_dbi_btconfig}
+%_dbi_config_Dirnames %{_dbi_btconfig} nofsync
+%_dbi_config_Requireversion %{_dbi_btconfig} nofsync
+%_dbi_config_Provideversion %{_dbi_btconfig} nofsync
+%_dbi_config_Installtid %{_dbi_btconfig} nofsync
+%_dbi_config_Removetid %{_dbi_btconfig} nofsync
-%_dbi_config %{?__dbi_other}
+%_dbi_config %{?__dbi_other} nofsync
-%_dbi_config %{_dbi_htconfig}
+%_dbi_config %{_dbi_htconfig} nofsync
# "Packages" should have shared/exclusive fcntl(2) lock using "lockdbfd".
-%_dbi_config_Packages %{?_dbi_config} lockdbfd
+%_dbi_config_Packages %{?__dbi_other} lockdbfd
# XXX legacy configuration.
# Choose db interface:
@@ -991,7 +997,7 @@ print (t)\
#==============================================================================
# ---- GPG/PGP/PGP5 signature macros.
@@ -857,7 +863,7 @@ print (t)\
%_build_vendor %{_host_vendor}
%_build_os %{_host_os}
%_host @host@
@ -113,7 +106,7 @@
%_host_cpu @host_cpu@
%_host_vendor @host_vendor@
%_host_os @host_os@
@@ -1154,6 +1160,181 @@ done \
@@ -1020,6 +1026,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])")
@ -295,7 +288,7 @@
#------------------------------------------------------------------------------
# arch macro for all Intel i?86 compatibile processors
# (Note: This macro (and it's analogues) will probably be obsoleted when
@@ -1164,7 +1345,9 @@ done \
@@ -1030,7 +1211,9 @@ done \
#------------------------------------------------------------------------------
# arch macro for all supported ARM processors
@ -306,7 +299,7 @@
#------------------------------------------------------------------------------
# arch macro for all supported Sparc processors
@@ -1197,3 +1380,26 @@ done \
@@ -1070,3 +1253,26 @@ done \
# \endverbatim
#*/

31
magic_and_path.diff Normal file
View File

@ -0,0 +1,31 @@
Allow "magic_and_path" flag to configure that files must
match both regexpes to be sent to the dependency generator.
--- build/rpmfc.c.orig 2011-05-16 10:46:20.000000000 +0000
+++ build/rpmfc.c 2011-05-16 11:02:56.000000000 +0000
@@ -613,6 +613,7 @@ static void rpmfcAttributes(rpmfc fc, co
const char *path = fullpath + fc->brlen;
int is_executable = 0;
struct stat st;
+ int magic_and_path;
if (stat(fullpath, &st) == 0) {
is_executable = (S_ISREG(st.st_mode)) &&
(st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH));
@@ -630,10 +631,13 @@ static void rpmfcAttributes(rpmfc fc, co
continue;
/* Add attributes on libmagic type & path pattern matches */
- if (regMatch((*attr)->magic, ftype))
- argvAddTokens(&fc->fattrs[fc->ix], (*attr)->name);
- if (regMatch((*attr)->path, path))
- argvAddTokens(&fc->fattrs[fc->ix], (*attr)->name);
+ if ((*attr)->magic && (*attr)->path && hasAttr((*attr)->flags, "magic_and_path")) {
+ if (regMatch((*attr)->magic, ftype) && regMatch((*attr)->path, path))
+ argvAddTokens(&fc->fattrs[fc->ix], (*attr)->name);
+ } else {
+ if (regMatch((*attr)->magic, ftype) || regMatch((*attr)->path, path))
+ argvAddTokens(&fc->fattrs[fc->ix], (*attr)->name);
+ }
}
}

View File

@ -1,6 +1,8 @@
--- ./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:
support missingok dependency bit
--- ./lib/depends.c.orig 2011-02-15 13:10:59.000000000 +0000
+++ ./lib/depends.c 2011-05-10 16:06:39.000000000 +0000
@@ -448,8 +448,13 @@ retry:
}
unsatisfied:
@ -15,14 +17,14 @@
+ }
exit:
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 {
return rc;
--- ./lib/rpmds.h.orig 2011-05-10 16:09:22.000000000 +0000
+++ ./lib/rpmds.h 2011-05-10 16:08:04.000000000 +0000
@@ -68,6 +68,7 @@ typedef rpmFlags rpmsenseFlags;
RPMSENSE_SCRIPT_POSTUN | \
RPMSENSE_SCRIPT_VERIFY | \
RPMSENSE_FIND_REQUIRES | \
+ RPMSENSE_MISSINGOK | \
RPMSENSE_SCRIPT_PREP | \
RPMSENSE_SCRIPT_BUILD | \
RPMSENSE_SCRIPT_INSTALL | \
RPMSENSE_RPMLIB | \
RPMSENSE_KEYRING | \
RPMSENSE_PRETRANS | \

View File

@ -1,10 +1,6 @@
SUSE specific find-supplements, used for kernel builds
Index: macros.in
===================================================================
--- macros.in.orig
+++ macros.in
@@ -473,14 +473,18 @@ print (t)\
--- ./macros.in.orig 2011-05-11 14:57:08.000000000 +0000
+++ ./macros.in 2011-05-11 15:01:39.000000000 +0000
@@ -470,14 +470,18 @@ print (t)\
#
# Path to scripts to autogenerate package dependencies,
#
@ -25,30 +21,9 @@ Index: macros.in
+%__find_supplements %{__set_helper_env}%{_rpmconfigdir}/find-supplements %name
#%__find_enhances ???
#
Index: scripts/find-supplements
===================================================================
--- /dev/null
+++ scripts/find-supplements
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# This script reads filenames from STDIN and outputs any relevant provides
+# information that needs to be included in the package.
+IFS=$'\n'
+filelist=($(cat))
+
+#
+# --- Kernel module hardware identifiers
+# (e.g., modalias(pci:v0000109Ed00000878sv00000070sd0000FF01bc*sc*i*)
+[ -x /usr/lib/rpm/find-supplements.ksyms ] &&
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-supplements.ksyms "$@"
+
+exit 0
Index: scripts/find-supplements.ksyms
===================================================================
--- /dev/null
+++ scripts/find-supplements.ksyms
#
--- ./scripts/find-supplements.ksyms.orig 2011-05-11 15:01:39.000000000 +0000
+++ ./scripts/find-supplements.ksyms 2011-05-11 15:01:39.000000000 +0000
@@ -0,0 +1,56 @@
+#! /bin/sh
+
@ -106,3 +81,20 @@ Index: scripts/find-supplements.ksyms
+done \
+| sort -u \
+| combine_modaliases
--- ./scripts/find-supplements.orig 2011-05-11 15:01:39.000000000 +0000
+++ ./scripts/find-supplements 2011-05-11 15:01:39.000000000 +0000
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# This script reads filenames from STDIN and outputs any relevant provides
+# information that needs to be included in the package.
+IFS=$'\n'
+filelist=($(cat))
+
+#
+# --- Kernel module hardware identifiers
+# (e.g., modalias(pci:v0000109Ed00000878sv00000070sd0000FF01bc*sc*i*)
+[ -x /usr/lib/rpm/find-supplements.ksyms ] &&
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-supplements.ksyms "$@"
+
+exit 0

View File

@ -1,16 +0,0 @@
--- 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 '=':

View File

@ -1,10 +1,10 @@
Also compare the name and not only the version when checking if
two packages are the same. rh#104066
--- ./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;
--- ./lib/depends.c.orig 2011-05-12 12:20:01.000000000 +0000
+++ ./lib/depends.c 2011-05-12 12:26:25.000000000 +0000
@@ -95,6 +95,24 @@ static rpmdbMatchIterator rpmtsPrunedIte
return mi;
}
+static int rpmNameVersionCompare(Header first, Header second)
@ -12,23 +12,23 @@ two packages are the same. rh#104066
+ const char * one, * two;
+ int rc;
+
+ rc = headerGetEntry(first, RPMTAG_NAME, NULL, (void **) &one, NULL);
+ rc = headerGetEntry(second, RPMTAG_NAME, NULL, (void **) &two, NULL);
+ one = headerGetString(first, RPMTAG_NAME);
+ two = headerGetString(second, RPMTAG_NAME);
+ rc = strcmp(one, two);
+ if (rc)
+ return rc;
+ rc = headerGetEntry(first, RPMTAG_ARCH, NULL, (void **) &one, NULL);
+ rc = headerGetEntry(second, RPMTAG_ARCH, NULL, (void **) &two, NULL);
+ one = headerGetString(first, RPMTAG_ARCH);
+ two = headerGetString(second, RPMTAG_ARCH);
+ rc = strcmp(one, two);
+ if (rc)
+ return rc;
+ return rpmVersionCompare(first, second);
+}
+
int rpmtsAddInstallElement(rpmts ts, Header h,
fnpyKey key, int upgrade, rpmRelocation * relocs)
{
@@ -275,7 +293,7 @@ addheader:
#define skipColor(_tscolor, _color, _ocolor) \
((_tscolor) && (_color) && (_ocolor) && !((_color) & (_ocolor)))
@@ -111,7 +129,7 @@ static void addUpgradeErasures(rpmts ts,
continue;
/* Skip packages that contain identical NEVR. */
@ -36,18 +36,13 @@ two packages are the same. rh#104066
+ if (rpmNameVersionCompare(h, oh) == 0)
continue;
xx = removePackage(ts, oh, p);
@@ -316,11 +334,9 @@ addheader:
removePackage(ts, oh, p);
@@ -150,7 +168,7 @@ static void addObsoleteErasures(rpmts ts
* If no obsoletes version info is available, match all names.
*/
if (rpmdsEVR(obsoletes) == NULL
- || rpmdsAnyMatchesDep(oh, obsoletes, _rpmds_nopromote)) {
+ || rpmdsNVRMatchesDep(oh, obsoletes, _rpmds_nopromote)) {
- || rpmdsAnyMatchesDep(oh, obsoletes, _rpmds_nopromote)) {
+ || rpmdsNVRMatchesDep(oh, obsoletes, _rpmds_nopromote)) {
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, p);
rpmlog(RPMLOG_DEBUG, " Obsoletes: %s\t\terases %s\n",
rpmdsDNEVR(obsoletes)+2, ohNEVRA);

12
no_rep_autop.diff Normal file
View File

@ -0,0 +1,12 @@
It seems to be gone...
--- lib/Makefile.am.orig 2011-05-12 12:59:42.000000000 +0000
+++ lib/Makefile.am 2011-05-12 12:59:59.000000000 +0000
@@ -126,7 +126,6 @@ rpmdb_printlog_LDADD = \
$(top_builddir)/db3/fileops_autop.o \
$(top_builddir)/db3/hash_autop.o \
$(top_builddir)/db3/qam_autop.o \
- $(top_builddir)/db3/rep_autop.o \
$(top_builddir)/db3/txn_autop.o \
$(top_builddir)/db3/util_sig.o \
librpm.la

13
nobuildcolor.diff Normal file
View File

@ -0,0 +1,13 @@
Disable file coloring for SUSE systems
--- build/rpmfc.c.orig 2011-05-13 12:35:29.000000000 +0000
+++ build/rpmfc.c 2011-05-13 13:49:37.000000000 +0000
@@ -1312,7 +1312,7 @@ rpmRC rpmfcGenerateDepends(const rpmSpec
goto exit;
/* Add per-file colors(#files) */
- if (rpmtdFromArgi(&td, RPMTAG_FILECOLORS, fc->fcolor)) {
+ if (rpmExpandNumeric("%{?_transaction_color}") != 0 && rpmtdFromArgi(&td, RPMTAG_FILECOLORS, fc->fcolor)) {
rpm_color_t *fcolor;
assert(rpmtdType(&td) == RPM_INT32_TYPE);
/* XXX Make sure only primary (i.e. Elf32/Elf64) colors are added. */

View File

@ -1,17 +0,0 @@
Revert upstream patch that always uses %defattr(-,root,root).
Upstream should probably use a macro instead.
Index: build/files.c
===================================================================
--- build/files.c.orig
+++ build/files.c
@@ -1793,7 +1793,9 @@ static rpmRC processPackageFiles(rpmSpec
nullAttrRec(&fl.cur_ar);
nullAttrRec(&fl.def_ar);
+#if 0
dupAttrRec(&root_ar, &fl.def_ar); /* XXX assume %defattr(-,root,root) */
+#endif
fl.defVerifyFlags = RPMVERIFY_ALL;
fl.nLangs = 0;

13
nomagiccheck.diff Normal file
View File

@ -0,0 +1,13 @@
Don't let rpm complain about a missing /etc/magic.mgc file
--- build/rpmfc.c.orig 2011-05-13 16:33:20.000000000 +0000
+++ build/rpmfc.c 2011-05-13 16:33:55.000000000 +0000
@@ -896,7 +896,7 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t arg
{
ARGV_t fcav = NULL;
int xx;
- int msflags = MAGIC_CHECK | MAGIC_COMPRESS | MAGIC_NO_CHECK_TOKENS;
+ int msflags = MAGIC_COMPRESS | MAGIC_NO_CHECK_TOKENS;
magic_t ms = NULL;
rpmRC rc = RPMRC_FAIL;

View File

@ -1,20 +1,22 @@
--- ./build/parsePreamble.c.orig 2010-04-07 14:52:57.000000000 +0000
+++ ./build/parsePreamble.c 2010-04-07 14:53:51.000000000 +0000
@@ -748,7 +748,7 @@ static struct PreambleRec_s const preamb
Not deprecated for SUSE builds.
--- ./build/parsePreamble.c.orig 2011-05-11 15:59:08.000000000 +0000
+++ ./build/parsePreamble.c 2011-05-11 16:35:47.000000000 +0000
@@ -891,7 +891,7 @@ static struct PreambleRec_s const preamb
{RPMTAG_ICON, 0, 0, LEN_AND_STR("icon")},
{RPMTAG_PROVIDEFLAGS, 0, 0, LEN_AND_STR("provides")},
{RPMTAG_REQUIREFLAGS, 1, 0, LEN_AND_STR("requires")},
- {RPMTAG_PREREQ, 1, 1, LEN_AND_STR("prereq")},
+ {RPMTAG_PREREQ, 1, 0, LEN_AND_STR("prereq")},
{RPMTAG_REQUIREFLAGS, 2, 0, LEN_AND_STR("requires")},
- {RPMTAG_PREREQ, 2, 1, LEN_AND_STR("prereq")},
+ {RPMTAG_PREREQ, 2, 0, LEN_AND_STR("prereq")},
{RPMTAG_CONFLICTFLAGS, 0, 0, LEN_AND_STR("conflicts")},
{RPMTAG_OBSOLETEFLAGS, 0, 0, LEN_AND_STR("obsoletes")},
{RPMTAG_PREFIXES, 0, 0, LEN_AND_STR("prefixes")},
@@ -757,7 +757,7 @@ static struct PreambleRec_s const preamb
@@ -900,7 +900,7 @@ static struct PreambleRec_s const preamb
{RPMTAG_BUILDARCHS, 0, 0, LEN_AND_STR("buildarchitectures")},
{RPMTAG_BUILDARCHS, 0, 0, LEN_AND_STR("buildarch")},
{RPMTAG_BUILDCONFLICTS, 0, 0, LEN_AND_STR("buildconflicts")},
- {RPMTAG_BUILDPREREQ, 1, 1, LEN_AND_STR("buildprereq")},
+ {RPMTAG_BUILDPREREQ, 1, 0, LEN_AND_STR("buildprereq")},
{RPMTAG_BUILDREQUIRES, 1, 0, LEN_AND_STR("buildrequires")},
- {RPMTAG_BUILDPREREQ, 0, 1, LEN_AND_STR("buildprereq")},
+ {RPMTAG_BUILDPREREQ, 0, 0, LEN_AND_STR("buildprereq")},
{RPMTAG_BUILDREQUIRES, 0, 0, LEN_AND_STR("buildrequires")},
{RPMTAG_AUTOREQPROV, 0, 0, LEN_AND_STR("autoreqprov")},
{RPMTAG_AUTOREQ, 0, 0, LEN_AND_STR("autoreq")},

View File

@ -1,23 +0,0 @@
Do not load keyring if signature checking is disabled.
--- ./lib/package.c.orig 2010-04-09 09:56:42.000000000 +0000
+++ ./lib/package.c 2010-04-09 09:57:50.000000000 +0000
@@ -760,12 +760,16 @@ exit:
rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
{
rpmRC rc;
- rpmKeyring keyring = rpmtsGetKeyring(ts, 1);
rpmVSFlags vsflags = rpmtsVSFlags(ts);
+ rpmKeyring keyring = 0;
+
+ if ((vsflags & _RPMVSF_NOSIGNATURES) != _RPMVSF_NOSIGNATURES)
+ keyring = rpmtsGetKeyring(ts, 1);
rc = rpmpkgRead(keyring, vsflags, fd, fn, hdrp);
- rpmKeyringFree(keyring);
+ if (keyring)
+ rpmKeyringFree(keyring);
return rc;
}

View File

@ -1,36 +0,0 @@
rpm does not allow headerPutUint32 on internal tags, so use
headerPut instead. (Maybe NOSOURCE/NOPATCH should not be internal
at all, though.)
--- ./build/files.c.orig 2010-04-08 16:23:42.000000000 +0000
+++ ./build/files.c 2010-04-08 16:23:44.000000000 +0000
@@ -2088,15 +2088,25 @@ int processSourceFiles(rpmSpec spec)
if (srcPtr->flags & RPMBUILD_ISSOURCE) {
headerPutString(spec->sourceHeader, RPMTAG_SOURCE, srcPtr->source);
if (srcPtr->flags & RPMBUILD_ISNO) {
- headerPutUint32(spec->sourceHeader, RPMTAG_NOSOURCE,
- &srcPtr->num, 1);
+ struct rpmtd_s td;
+ rpmtdReset(&td);
+ td.tag = RPMTAG_NOSOURCE;
+ td.type = RPM_INT32_TYPE;
+ td.data = &srcPtr->num;
+ td.count = 1;
+ headerPut(spec->sourceHeader, &td, HEADERPUT_APPEND);
}
}
if (srcPtr->flags & RPMBUILD_ISPATCH) {
headerPutString(spec->sourceHeader, RPMTAG_PATCH, srcPtr->source);
if (srcPtr->flags & RPMBUILD_ISNO) {
- headerPutUint32(spec->sourceHeader, RPMTAG_NOSOURCE,
- &srcPtr->num, 1);
+ struct rpmtd_s td;
+ rpmtdReset(&td);
+ td.tag = RPMTAG_NOPATCH;
+ td.type = RPM_INT32_TYPE;
+ td.data = &srcPtr->num;
+ td.count = 1;
+ headerPut(spec->sourceHeader, &td, HEADERPUT_APPEND);
}
}

View File

@ -1,13 +1,13 @@
Index: scripts/perl.prov
===================================================================
--- scripts/perl.prov.orig
+++ scripts/perl.prov
@@ -167,7 +167,7 @@ sub process_file {
$version= $1;
Support a "first version wins" semantics.
--- ./scripts/perl.prov.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./scripts/perl.prov 2011-05-11 15:32:39.000000000 +0000
@@ -170,7 +170,7 @@ sub process_file {
$version = $1;
}
- $require{$package}=$version;
- $require{$package} = $version;
+ $require{$package} ||= $version;
}
# Allow someone to have a variable that defines virtual packages

View File

@ -1,27 +0,0 @@
Index: ./scripts/pkgconfigdeps.sh
===================================================================
--- ./scripts/pkgconfigdeps.sh
+++ ./scripts/pkgconfigdeps.sh
@@ -11,6 +11,13 @@ test -x $pkgconfig || {
exit 0
}
+`$pkgconfig --exists "pkg-config >= 0.24" 2> /dev/null`
+if [ $? -eq 0 ]; then
+ PRINT_REQUIRES="--print-requires --print-requires-private"
+else
+ PRINT_REQUIRES="--print-requires"
+fi
+
case $1 in
-P|--provides)
while read filename ; do
@@ -39,7 +46,7 @@ case $1 in
[ $i -eq 1 ] && echo "$pkgconfig"
DIR="`dirname ${filename}`"
export PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
- $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do
+ $pkgconfig $PRINT_REQUIRES "$filename" 2> /dev/null | while read n r v ; do
[ -n "$n" ] || continue
echo -n "pkgconfig($n) "
[ -n "$r" ] && [ -n "$v" ] && echo -n "$r" "$v"

View File

@ -1,9 +1,7 @@
SUSE specific platform changes.
Index: platform.in
===================================================================
--- platform.in.orig
+++ platform.in
--- ./platform.in.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./platform.in 2011-05-11 15:02:03.000000000 +0000
@@ -21,7 +21,7 @@
%_exec_prefix @exec_prefix@
%_bindir @bindir@
@ -22,7 +20,7 @@ Index: platform.in
# Deprecated misspelling, present for backwards compatibility.
%_initrddir %{_initddir}
@@ -146,3 +146,21 @@
@@ -143,3 +143,21 @@
@mandrake@%_gamesdir games
@mandrake@%_gamesbindir %{_prefix}/%{_gamesdir}
@mandrake@%_gamesdatadir %{_datadir}/%{_gamesdir}

View File

@ -1,5 +1,5 @@
--- ./autodeps/linux.prov.orig 2010-04-08 13:32:56.000000000 +0000
+++ ./autodeps/linux.prov 2010-04-08 13:38:44.000000000 +0000
--- ./autodeps/linux.prov.orig 2011-05-11 15:59:31.000000000 +0000
+++ ./autodeps/linux.prov 2011-05-11 16:39:09.000000000 +0000
@@ -11,7 +11,7 @@ filelist=($(printf "%s\n" "${filelist[@]
solist=($(printf "%s\n" "${filelist[@]}" | grep "\\.so" | grep -v "^/lib/ld.so" | \
tr '\n' '\0' | xargs -0 -r file -L | grep "ELF.*shared object" | \
@ -20,9 +20,9 @@
#
# --- Tcl modules.
--- ./autodeps/linux.req.orig 2010-04-08 13:36:47.000000000 +0000
+++ ./autodeps/linux.req 2010-04-08 13:40:25.000000000 +0000
@@ -32,7 +32,7 @@ liblist=($(printf "%s\0" "${filelist[@]}
--- ./autodeps/linux.req.orig 2011-05-11 14:28:45.000000000 +0000
+++ ./autodeps/linux.req 2011-05-11 16:39:09.000000000 +0000
@@ -31,7 +31,7 @@ liblist=($(printf "%s\0" "${filelist[@]}
interplist=()
perllist=()
@ -31,7 +31,7 @@
tcllist=()
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)(\\.config)?\$"))
@@ -128,8 +128,8 @@ done | sort -u
@@ -127,8 +127,8 @@ done | sort -u
#
# --- Python modules.
@ -42,28 +42,3 @@
#
# --- Tcl modules.
--- ./scripts/pythondeps.sh.orig 2010-04-08 13:40:34.000000000 +0000
+++ ./scripts/pythondeps.sh 2010-04-08 13:42:19.000000000 +0000
@@ -5,17 +5,17 @@
exit 0
}
-PYVER=`python -c "import sys; v=sys.version_info[:2]; print '%d.%d'%v"`
case $1 in
-P|--provides)
shift
- grep "/usr/bin/python\*\$" >& /dev/null && echo "python(abi) = ${PYVER}"
- exit 0
+ grep "/usr/bin/python.\..$" \
+ | sed -e "s|.*/usr/bin/python\(.\..\)|python(abi) = \1|"
;;
-R|--requires)
shift
- grep "/usr/lib[^/]*/python${PYVER}/" >& /dev/null && echo "python(abi) = ${PYVER}"
- exit 0
+ grep "/usr/lib[^/]*/python.\../.*" \
+ | sed -e "s|.*/usr/lib[^/]*/python\(.\..\)/.*|python(abi) = \1|g" \
+ | sort | uniq
;;
esac

View File

@ -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);

View File

@ -1,19 +1,17 @@
Also test architecture in "refresh" test when not colored. This allows
updates to different architecture possible again.
updates to different architectures.
Index: lib/psm.c
===================================================================
--- lib/psm.c.orig
+++ lib/psm.c
@@ -1202,6 +1202,7 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage s
--- ./lib/psm.c.orig 2010-12-21 09:50:23.000000000 +0000
+++ ./lib/psm.c 2011-05-11 12:47:13.000000000 +0000
@@ -723,6 +723,7 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
psm->scriptArg = psm->npkgs_installed + 1;
+ /* this must match rpmNameVersionCompare in depends.c */
mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmteN(psm->te), 0);
mi = rpmtsInitIterator(ts, RPMDBI_NAME, rpmteN(psm->te), 0);
xx = rpmdbSetIteratorRE(mi, RPMTAG_EPOCH, RPMMIRE_STRCMP,
rpmteE(psm->te));
@@ -1209,9 +1210,9 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage s
@@ -730,9 +731,9 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
rpmteV(psm->te));
xx = rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_STRCMP,
rpmteR(psm->te));

View File

@ -3,16 +3,14 @@ Subject: remove references to removed brp scripts
Some brp-scripts are not used in openSUSE, remove references
to it
Index: platform.in
===================================================================
--- platform.in.orig
+++ platform.in
--- ./platform.in.orig 2011-05-11 15:02:03.000000000 +0000
+++ ./platform.in 2011-05-11 15:38:05.000000000 +0000
@@ -55,8 +55,6 @@
%__os_install_post \
%{_rpmconfigdir}/brp-compress \
%{_rpmconfigdir}/brp-strip \
- %{_rpmconfigdir}/brp-strip-static-archive \
- %{_rpmconfigdir}/brp-strip-comment-note \
%{_rpmconfigdir}/brp-strip %{__strip} \
- %{_rpmconfigdir}/brp-strip-static-archive %{__strip} \
- %{_rpmconfigdir}/brp-strip-comment-note %{__strip} %{__objdump} \
%{nil}
%__spec_install_post\

View File

@ -1,5 +1,5 @@
--- scripts/find-lang.sh 2011-01-13 13:44:01.000000000 +0100
+++ scripts/find-lang.sh 2011-01-13 13:44:39.770439219 +0100
--- ./scripts/find-lang.sh.orig 2011-05-11 16:45:30.000000000 +0000
+++ ./scripts/find-lang.sh 2011-05-11 16:55:14.000000000 +0000
@@ -122,6 +122,17 @@ fi
MO_NAME_NEW=$MO_NAME.tmp.$$
rm -f $MO_NAME_NEW
@ -17,4 +17,4 @@
+
find $TOP_DIR -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) %doc \1\2\3:

View File

@ -1,14 +1,16 @@
--- ./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) {
Don't complain about a bad md5 sum for repackaged rpms.
--- ./lib/psm.c.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./lib/psm.c 2011-05-11 16:32:11.000000000 +0000
@@ -811,6 +811,7 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
case PSM_PROCESS:
if (psm->goal == PKG_INSTALL) {
FD_t payload = NULL;
+ rpmtransFlags oldtsflags;
if (rpmtsFlags(ts) & RPMTRANS_FLAG_JUSTDB) break;
@@ -1343,6 +1344,9 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage s
@@ -828,6 +829,9 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
break;
}
@ -18,7 +20,7 @@
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
@@ -835,6 +839,8 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
(void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_DIGEST),
fdOp(payload, FDSTAT_DIGEST));
xx = fsmTeardown(rpmfiFSM(fi));

View File

@ -1,8 +1,6 @@
Index: macros.in
===================================================================
--- macros.in.orig
+++ macros.in
@@ -1182,7 +1182,8 @@ done \
--- ./macros.in.orig 2011-05-11 15:36:05.000000000 +0000
+++ ./macros.in 2011-05-11 15:38:44.000000000 +0000
@@ -1027,7 +1027,8 @@ done \
# %{perl_sitearch}/Image
# %dir %{perl_sitearch}/auto/Image
#

View File

@ -1,55 +0,0 @@
--- ./build/files.c.orig 2010-04-07 14:27:54.000000000 +0000
+++ ./build/files.c 2010-04-07 14:51:11.000000000 +0000
@@ -561,8 +561,13 @@ static rpmRC parseForAttr(const char * b
}
ar->ar_fmode = ui;
} else {
- ar->ar_fmodestr = fl->def_ar.ar_fmodestr;
- ar->ar_fmode = fl->def_ar.ar_fmode;
+ if (ret_ar == &(fl->def_ar)) {
+ ar->ar_fmodestr = NULL;
+ ar->ar_fmode = 0;
+ } else {
+ ar->ar_fmodestr = fl->def_ar.ar_fmodestr;
+ ar->ar_fmode = fl->def_ar.ar_fmode;
+ }
}
if (ar->ar_dmodestr && !isAttrDefault(ar->ar_dmodestr)) {
@@ -574,15 +579,30 @@ static rpmRC parseForAttr(const char * b
}
ar->ar_dmode = ui;
} else {
- ar->ar_dmodestr = fl->def_ar.ar_dmodestr;
- ar->ar_dmode = fl->def_ar.ar_dmode;
+ if (ret_ar == &(fl->def_ar)) {
+ ar->ar_dmodestr = NULL;
+ ar->ar_dmode = 0;
+ } else {
+ ar->ar_dmodestr = fl->def_ar.ar_dmodestr;
+ ar->ar_dmode = fl->def_ar.ar_dmode;
+ }
}
- if (!(ar->ar_user && !isAttrDefault(ar->ar_user)))
- ar->ar_user = fl->def_ar.ar_user;
+ if (!(ar->ar_user && !isAttrDefault(ar->ar_user))) {
+ if (ret_ar == &(fl->def_ar)) {
+ ar->ar_user = NULL;
+ } else {
+ ar->ar_user = fl->def_ar.ar_user;
+ }
+ }
- if (!(ar->ar_group && !isAttrDefault(ar->ar_group)))
- ar->ar_group = fl->def_ar.ar_group;
+ if (!(ar->ar_group && !isAttrDefault(ar->ar_group))) {
+ if (ret_ar == &(fl->def_ar)) {
+ ar->ar_group = 0;
+ } else {
+ ar->ar_group = fl->def_ar.ar_group;
+ }
+ }
dupAttrRec(ar, ret_ar);

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1226a5eeee069402b8dddfde652e2b0a44b64a193078b3c7276d97b1b5f756cb
size 5271325

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a3b4bb2d78eaf1f5200fdcd51372ca9cedce64e030046372e6a13e361cb82b64
size 3692408

3
rpm-4.9.0.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9af1a56b05fc2c54935062e04a3e02999110c74d00bfd5b5c5ff3a03dde61688
size 3410799

View File

@ -1,17 +1,5 @@
--- ./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
-rpm_LDADD = build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
+rpm_LDADD = lib/librpm.la rpmio/librpmio.la
+rpm_LDADD += build/.libs/spec.o build/.libs/misc.o build/.libs/names.o build/.libs/expression.o build/.libs/reqprov.o build/.libs/poptBT.o build/.libs/parse*.o
rpm_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
rpmbuild_SOURCES = build.c rpmqv.c build.h debug.h system.h
--- ./config.h.in.orig 2010-01-08 08:35:12.000000000 +0000
+++ ./config.h.in 2010-03-24 15:39:14.000000000 +0000
--- ./config.h.in.orig 2011-03-02 06:46:47.000000000 +0000
+++ ./config.h.in 2011-05-10 15:54:41.000000000 +0000
@@ -13,6 +13,9 @@
/* Define to 1 if you have the `basename' function. */
#undef HAVE_BASENAME
@ -22,16 +10,16 @@
/* Define as 1 if you bzip2 1.0 */
#undef HAVE_BZ2_1_0
@@ -110,7 +113,7 @@
/* Define as 1 if <netdb.h> defines h_errno */
#undef HAVE_HERRNO
@@ -77,7 +80,7 @@
/* Define as 1 if your zlib has gzseek() */
#undef HAVE_GZSEEK
-/* Define if you have the iconv() function. */
+/* Define if you have the iconv() function and it works. */
#undef HAVE_ICONV
/* Define to 1 if you have the `inet_aton' function. */
@@ -359,6 +362,10 @@
/* Define to 1 if you have the <inttypes.h> header file. */
@@ -224,6 +227,10 @@
*/
#undef LT_OBJDIR
@ -42,7 +30,7 @@
/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
*/
#undef MAJOR_IN_MKDEV
@@ -456,6 +463,9 @@
@@ -308,6 +315,9 @@
/* Build with acl support? */
#undef WITH_ACL
@ -52,9 +40,9 @@
/* Build with capability support? */
#undef WITH_CAP
--- ./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], [
--- ./configure.ac.orig 2011-03-02 06:46:20.000000000 +0000
+++ ./configure.ac 2011-05-10 15:54:41.000000000 +0000
@@ -246,12 +246,43 @@ AC_CHECK_HEADERS([dwarf.h], [
AM_CONDITIONAL(LIBDWARF,[test "$WITH_LIBDWARF" = yes])
#=================
@ -98,7 +86,7 @@
AC_CHECK_HEADERS([nspr.h nss.h sechash.h], [], [
AC_MSG_ERROR([missing required NSPR / NSS header])
])
@@ -313,6 +344,7 @@ AC_CHECK_LIB(nss3, NSS_NoDB_Init, [
@@ -260,6 +291,7 @@ AC_CHECK_LIB(nss3, NSS_NoDB_Init, [
], [
AC_MSG_ERROR([missing required NSS library 'nss3'])
])
@ -106,8 +94,8 @@
AC_SUBST(WITH_NSS_INCLUDE)
AC_SUBST(WITH_NSS_LIB)
--- ./rpmio/Makefile.am.orig 2009-12-07 14:36:49.000000000 +0000
+++ ./rpmio/Makefile.am 2010-03-24 15:42:04.000000000 +0000
--- ./rpmio/Makefile.am.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./rpmio/Makefile.am 2011-05-10 15:56:13.000000000 +0000
@@ -2,6 +2,7 @@
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
@ -116,7 +104,7 @@
AM_CPPFLAGS += @WITH_LUA_INCLUDE@
AM_CPPFLAGS += @WITH_POPT_INCLUDE@
AM_CPPFLAGS += -I$(top_srcdir)/misc
@@ -19,10 +20,17 @@ librpmio_la_SOURCES = \
@@ -18,10 +19,17 @@ librpmio_la_SOURCES = \
rpmstring.c rpmfileutil.c \
rpmkeyring.c
@ -126,7 +114,7 @@
+librpmio_la_SOURCES += digest_nss.c
+endif
+
librpmio_la_LDFLAGS = -version-info 1:0:0
librpmio_la_LDFLAGS = -version-info 2:0:0
librpmio_la_LIBADD = \
../misc/libmisc.la \
@WITH_NSS_LIB@ \
@ -134,7 +122,7 @@
@WITH_LUA_LIB@ \
@WITH_BZ2_LIB@ \
@WITH_ZLIB_LIB@ \
@@ -31,6 +39,15 @@ librpmio_la_LIBADD = \
@@ -30,6 +38,15 @@ librpmio_la_LIBADD = \
@WITH_LZMA_LIB@ \
-lpthread
@ -150,8 +138,8 @@
if WITH_LUAEXT
AM_CPPFLAGS += -I$(top_srcdir)/luaext/
librpmio_la_LIBADD += $(top_builddir)/luaext/libluaext.la
--- ./rpmio/base64.c.orig 2009-12-07 14:36:49.000000000 +0000
+++ ./rpmio/base64.c 2010-03-24 15:39:14.000000000 +0000
--- ./rpmio/base64.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./rpmio/base64.c 2011-05-10 15:54:41.000000000 +0000
@@ -4,8 +4,11 @@
#include <arpa/inet.h>
#include <stdlib.h>
@ -169,9 +157,9 @@
#endif
+#endif /* WITH_BEECRYPT */
--- ./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 @@
--- ./rpmio/digest.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./rpmio/digest.c 2011-05-10 16:00:19.000000000 +0000
@@ -4,25 +4,12 @@
#include "system.h"
@ -194,13 +182,12 @@
-struct DIGEST_CTX_s {
- rpmDigestFlags flags; /*!< Bit(s) to control digest operation. */
- HASHContext *hashctx; /*!< Internal NSS hash context. */
- pgpHashAlgo algo; /*!< Used hash algorithm */
- int 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
@@ -109,138 +96,3 @@ DIGEST_CTX rpmDigestBundleDupCtx(rpmDige
return dup;
}
@ -219,7 +206,7 @@
-}
-
-RPM_GNUC_PURE
-static HASH_HashType getHashType(pgpHashAlgo hashalgo)
-static HASH_HashType getHashType(int hashalgo)
-{
- switch (hashalgo) {
- case PGPHASHALGO_MD5:
@ -250,13 +237,13 @@
-}
-
-size_t
-rpmDigestLength(pgpHashAlgo hashalgo)
-rpmDigestLength(int hashalgo)
-{
- return HASH_ResultLen(getHashType(hashalgo));
-}
-
-DIGEST_CTX
-rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags)
-rpmDigestInit(int hashalgo, rpmDigestFlags flags)
-{
- HASH_HashType type = getHashType(hashalgo);
- HASHContext *hashctx = NULL;
@ -339,8 +326,8 @@
- return 0;
-}
-
--- ./rpmio/digest.h.orig 2009-12-07 14:36:49.000000000 +0000
+++ ./rpmio/digest.h 2010-03-24 15:56:12.000000000 +0000
--- ./rpmio/digest.h.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./rpmio/digest.h 2011-05-10 15:54:41.000000000 +0000
@@ -1,11 +1,6 @@
#ifndef _RPMDIGEST_H
#define _RPMDIGEST_H
@ -374,8 +361,8 @@
+int pgpVerifyDSA(pgpDig dig, uint8_t *hash, size_t hashlen);
+
#endif /* _RPMDIGEST_H */
--- ./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
--- ./rpmio/digest_beecrypt.c.orig 2011-05-10 15:54:41.000000000 +0000
+++ ./rpmio/digest_beecrypt.c 2011-05-10 15:54:41.000000000 +0000
@@ -0,0 +1,493 @@
+#include "system.h"
+
@ -698,7 +685,7 @@
+ */
+struct DIGEST_CTX_s {
+ rpmDigestFlags flags; /*!< Bit(s) to control digest operation. */
+ pgpHashAlgo algo; /*!< Used hash algorithm */
+ int 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. */
@ -721,7 +708,7 @@
+}
+
+size_t
+rpmDigestLength(pgpHashAlgo hashalgo)
+rpmDigestLength(int hashalgo)
+{
+ switch (hashalgo) {
+ case PGPHASHALGO_MD5:
@ -742,7 +729,7 @@
+}
+
+DIGEST_CTX
+rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags)
+rpmDigestInit(int hashalgo, rpmDigestFlags flags)
+{
+ DIGEST_CTX ctx = xcalloc(1, sizeof(*ctx));
+ int xx;
@ -870,8 +857,8 @@
+ free(ctx);
+ return 0;
+}
--- ./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
--- ./rpmio/digest_nss.c.orig 2011-05-10 15:54:41.000000000 +0000
+++ ./rpmio/digest_nss.c 2011-05-10 15:54:41.000000000 +0000
@@ -0,0 +1,500 @@
+#include <nss.h>
+#include <sechash.h>
@ -1238,7 +1225,7 @@
+struct DIGEST_CTX_s {
+ rpmDigestFlags flags; /*!< Bit(s) to control digest operation. */
+ HASHContext *hashctx; /*!< Internal NSS hash context. */
+ pgpHashAlgo algo; /*!< Used hash algorithm */
+ int algo; /*!< Used hash algorithm */
+};
+
+DIGEST_CTX
@ -1255,7 +1242,7 @@
+}
+
+RPM_GNUC_PURE
+static HASH_HashType getHashType(pgpHashAlgo hashalgo)
+static HASH_HashType getHashType(int hashalgo)
+{
+ switch (hashalgo) {
+ case PGPHASHALGO_MD5:
@ -1286,13 +1273,13 @@
+}
+
+size_t
+rpmDigestLength(pgpHashAlgo hashalgo)
+rpmDigestLength(int hashalgo)
+{
+ return HASH_ResultLen(getHashType(hashalgo));
+}
+
+DIGEST_CTX
+rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags)
+rpmDigestInit(int hashalgo, rpmDigestFlags flags)
+{
+ HASH_HashType type;
+ HASHContext *hashctx = NULL;
@ -1373,8 +1360,8 @@
+ free(ctx);
+ return 0;
+}
--- ./rpmio/rpmpgp.c.orig 2009-12-07 14:36:49.000000000 +0000
+++ ./rpmio/rpmpgp.c 2010-03-24 16:26:00.000000000 +0000
--- ./rpmio/rpmpgp.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./rpmio/rpmpgp.c 2011-05-10 16:01:58.000000000 +0000
@@ -20,9 +20,6 @@ static int _debug = 0;
static int _print = 0;
@ -1382,10 +1369,10 @@
-static int _crypto_initialized = 0;
-static int _new_process = 1;
-
static struct pgpValTbl_s const pgpSigTypeTbl[] = {
{ PGPSIGTYPE_BINARY, "Binary document signature" },
{ PGPSIGTYPE_TEXT, "Text document signature" },
@@ -291,89 +288,6 @@ int pgpValTok(pgpValTbl vs, const char *
typedef const struct pgpValTbl_s {
int val;
char const * const str;
@@ -315,89 +312,6 @@ int pgpValTok(pgpValTbl vs, const char *
} while ((++vs)->val != -1);
return vs->val;
}
@ -1393,12 +1380,12 @@
- * @return 0 on success
- */
-static int pgpMpiSet(const char * pre, unsigned int lbits,
- void *dest, const uint8_t * p, const uint8_t * pend)
- uint8_t *dest, const uint8_t * p, const uint8_t * pend)
-{
- unsigned int mbits = pgpMpiBits(p);
- unsigned int nbits;
- size_t nbytes;
- char *t = dest;
- uint8_t *t = dest;
- unsigned int ix;
-
- if ((p + ((mbits+7) >> 3)) > pend)
@ -1475,7 +1462,7 @@
/** \ingroup rpmpgp
* Is buffer at beginning of an OpenPGP packet?
@@ -569,29 +483,16 @@ static int pgpPrtSigParams(pgpTag tag, u
@@ -593,29 +507,16 @@ static int pgpPrtSigParams(pgpTag tag, u
{
const uint8_t * pend = h + hlen;
size_t i;
@ -1507,7 +1494,7 @@
}
pgpPrtStr("", pgpSigRSA[i]);
} else if (pubkey_algo == PGPPUBKEYALGO_DSA) {
@@ -599,30 +500,8 @@ static int pgpPrtSigParams(pgpTag tag, u
@@ -623,30 +524,8 @@ static int pgpPrtSigParams(pgpTag tag, u
if (_dig &&
(sigtype == PGPSIGTYPE_BINARY || sigtype == PGPSIGTYPE_TEXT))
{
@ -1540,7 +1527,7 @@
}
pgpPrtStr("", pgpSigDSA[i]);
} else {
@@ -814,49 +693,11 @@ static const uint8_t * pgpPrtPubkeyParam
@@ -838,49 +717,11 @@ static const uint8_t * pgpPrtPubkeyParam
char * mpi;
if (pubkey_algo == PGPPUBKEYALGO_RSA) {
if (i >= 2) break;
@ -1592,7 +1579,7 @@
pgpPrtStr("", pgpPublicDSA[i]);
} else if (pubkey_algo == PGPPUBKEYALGO_ELGAMAL_ENCRYPT) {
if (i >= 3) break;
@@ -1241,15 +1082,7 @@ void pgpCleanDig(pgpDig dig)
@@ -1265,15 +1106,7 @@ void pgpCleanDig(pgpDig dig)
memset(&dig->signature, 0, sizeof(dig->signature));
memset(&dig->pubkey, 0, sizeof(dig->pubkey));
@ -1609,7 +1596,7 @@
}
return;
}
@@ -1291,39 +1124,6 @@ int pgpPrtPkts(const uint8_t * pkts, siz
@@ -1315,39 +1148,6 @@ int pgpPrtPkts(const uint8_t * pkts, siz
return 0;
}
@ -1649,7 +1636,7 @@
char *pgpIdentItem(pgpDigParams digp)
{
char *id = NULL;
@@ -1372,30 +1172,12 @@ rpmRC pgpVerifySig(pgpDig dig, DIGEST_CT
@@ -1396,30 +1196,12 @@ rpmRC pgpVerifySig(pgpDig dig, DIGEST_CT
/* Compare leading 16 bits of digest for quick check. */
if (hash && memcmp(hash, sigp->signhash16, 2) == 0) {
@ -1686,7 +1673,7 @@
}
}
@@ -1580,50 +1362,3 @@ char * pgpArmorWrap(int atype, const uns
@@ -1607,50 +1389,3 @@ char * pgpArmorWrap(int atype, const uns
return val;
}

View File

@ -25,8 +25,8 @@ BuildRequires: libacl-devel libcap-devel python-devel xz-devel zlib-devel
License: GPLv2+
Group: System/Packages
Summary: Python Bindings for Manipulating RPM Packages
Version: 4.8.0
Release: 21
Version: 4.9.0
Release: 1
Requires: rpm = %{version}
%py_requires
Source99: rpm.spec

View File

@ -1,29 +1,10 @@
Index: build/parseChangelog.c
===================================================================
--- build/parseChangelog.c.orig
+++ build/parseChangelog.c
@@ -167,6 +167,11 @@ static rpmRC addChangelog(Header h, Stri
return RPMRC_FAIL;
}
+ /* workaround old suse oddity */
+ if (*s == '-' && s[1] == ' ') {
+ s += 2;
+ }
+
/* name */
name = s;
while (*s != '\0') s++;
Index: build/pack.c
===================================================================
--- build/pack.c.orig
+++ build/pack.c
@@ -707,6 +707,64 @@ rpmRC checkPackages(char *pkgcheck)
--- ./build/pack.c.orig 2011-02-15 13:03:56.000000000 +0000
+++ ./build/pack.c 2011-05-11 15:35:07.000000000 +0000
@@ -671,6 +671,63 @@ static rpmRC checkPackages(char *pkgchec
return RPMRC_OK;
}
+static void
+trimChangelog(Header h)
+static void trimChangelog(Header h)
+{
+ static int oneshot;
+ static int cuttime, minnum, maxnum;
@ -80,10 +61,10 @@ Index: build/pack.c
+ free(texts);
+}
+
rpmRC packageBinaries(rpmSpec spec)
rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
{
struct cpioSourceArchive_s csabuf;
@@ -716,6 +774,7 @@ rpmRC packageBinaries(rpmSpec spec)
@@ -680,6 +737,7 @@ rpmRC packageBinaries(rpmSpec spec, cons
Package pkg;
char *pkglist = NULL;
@ -91,3 +72,17 @@ Index: build/pack.c
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
char *fn;
--- ./build/parseChangelog.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./build/parseChangelog.c 2011-05-11 15:33:22.000000000 +0000
@@ -168,6 +168,11 @@ static rpmRC addChangelog(Header h, ARGV
return RPMRC_FAIL;
}
+ /* workaround old suse oddity */
+ if (*s == '-' && s[1] == ' ') {
+ s += 2;
+ }
+
/* name */
name = s;
while (*s != '\0') s++;

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon May 16 14:45:05 CEST 2011 - mls@suse.de
- update to rpm-4.9.0:
* use internal dependency generator
* pluggable autodeps generators
* update to berkeleydb 4.8.30
* fixed dependency match corner cases
* experimental collection implementation
-------------------------------------------------------------------
Wed May 4 12:42:33 UTC 2011 - mmarek@novell.com

159
rpm.spec
View File

@ -20,7 +20,7 @@
Name: rpm
License: GPLv2+
Group: System/Packages
BuildRequires: file-devel libbz2-devel libelf-devel libselinux-devel lua-devel ncurses-devel xz-devel zlib-devel
BuildRequires: file-devel libbz2-devel libelf-devel libselinux-devel libsemanage-devel lua-devel ncurses-devel xz-devel zlib-devel
BuildRequires: popt-devel
BuildRequires: libacl-devel libcap-devel
#!BuildIgnore: rpmlint-Factory
@ -28,8 +28,8 @@ Provides: rpminst
PreReq: %insserv_prereq %fillup_prereq permissions
AutoReqProv: on
Summary: The RPM Package Manager
Version: 4.8.0
Release: 32
Version: 4.9.0
Release: 1
Source: rpm-%{version}.tar.bz2
Source1: RPM-HOWTO.tar.bz2
Source2: RPM-Tips.html.tar.bz2
@ -39,7 +39,7 @@ Source6: symset-table
Source8: rpmconfigcheck
Source9: sysconfig.services-rpm
Source10: beecrypt-4.1.2.tar.bz2
Source11: rpm-4.4.2.3-db.tar.bz2
Source11: db-4.8.30.tar.bz2
Source12: baselibs.conf
Patch1: beecrypt-4.1.2.diff
Patch2: db.diff
@ -52,74 +52,69 @@ Patch14: nameversioncompare.diff
Patch15: chownwarn.diff
Patch16: dbfsync.diff
Patch17: dbrointerruptable.diff
Patch18: diskspace.diff
Patch19: extcond.diff
Patch20: nodefattr.diff
Patch21: luaroot.diff
Patch22: refreshtestarch.diff
Patch23: rpmrctests.diff
Patch24: suspendlock.diff
Patch25: waitlock.diff
Patch26: dbprivate.diff
Patch27: weakdeps.diff
Patch28: autodeps.diff
Patch29: brp.diff
Patch30: brpcombress.diff
Patch31: checkfilesnoinfodir.diff
Patch32: finddebuginfo.diff
Patch33: findksyms.diff
Patch34: findlang.diff
Patch35: macrosin.diff
Patch36: modalias.diff
Patch37: platformin.diff
Patch38: rpmpopt.diff
Patch39: rpmrc.diff
Patch40: taggedfileindex.diff
Patch41: rpmqpack.diff
Patch42: convertdb1static.diff
Patch43: build.diff
Patch44: modalias-kernel_module.diff
Patch45: files.diff
Patch46: debugedit-comp-dir.diff
Patch47: perlprov.diff
Patch48: rpm-shorten-changelog.diff
Patch49: debugsource-package.diff
Patch50: whatrequires-doc.diff
Patch51: remove-brp-strips.diff
Patch52: requires-ge-macro.diff
Patch53: mimetype.diff
Patch54: debugedit-canon-fix.diff
Patch55: finddebuginfo-absolute-links.diff
Patch56: firmware.diff
Patch57: specfilemacro.diff
Patch58: modalias-encode.diff
Patch59: disttag-macro.diff
Patch60: buildidprov.diff
Patch61: debugsubpkg.diff
Patch62: debuglink.diff
Patch63: debuginfo-mono.patch
Patch64: allowufdio.diff
Patch65: lazystatfs.diff
Patch66: defclean.diff
Patch67: readlineofi.diff
Patch68: rpmdb-no-svc.diff
Patch69: modemuncher.diff
Patch70: repackage-nomd5.diff
Patch71: safeugid.diff
Patch72: resetdefattr.diff
Patch73: noprereqdeprec.diff
Patch74: tarrecordsize.diff
Patch75: backport.diff
Patch76: pythondeps.diff
Patch77: fontprovides.diff
Patch78: nosource.diff
Patch79: nosignature.diff
Patch80: fixsbits.diff
Patch81: pkgconfig-0.24.diff
Patch82: rpm-gst-provides.patch
Patch83: langnoc.diff
Patch84: initscriptsprov.diff
Patch85: remove-translations.diff
Patch18: extcond.diff
Patch19: refreshtestarch.diff
Patch20: rpmrctests.diff
Patch21: waitlock.diff
Patch22: suspendlock.diff
Patch23: weakdeps.diff
Patch24: autodeps.diff
Patch25: brp.diff
Patch26: brpcompress.diff
Patch27: checkfilesnoinfodir.diff
Patch28: finddebuginfo.diff
Patch29: findksyms.diff
Patch30: findlang.diff
Patch31: macrosin.diff
Patch32: modalias.diff
Patch33: platformin.diff
Patch34: rpmpopt.diff
Patch35: rpmrc.diff
Patch36: taggedfileindex.diff
Patch37: rpmqpack.diff
Patch38: convertdb1static.diff
Patch39: build.diff
Patch40: modalias-kernel_module.diff
Patch41: files.diff
Patch42: debugedit-comp-dir.diff
Patch43: perlprov.diff
Patch44: rpm-shorten-changelog.diff
Patch45: debugsource-package.diff
Patch46: whatrequires-doc.diff
Patch47: remove-brp-strips.diff
Patch48: requires-ge-macro.diff
Patch49: mimetype.diff
Patch50: debugedit-canon-fix.diff
Patch51: finddebuginfo-absolute-links.diff
Patch52: firmware.diff
Patch53: specfilemacro.diff
Patch54: modalias-encode.diff
Patch55: disttag-macro.diff
Patch56: buildidprov.diff
Patch57: debugsubpkg.diff
Patch58: debuglink.diff
Patch59: debuginfo-mono.patch
Patch60: lazystatfs.diff
Patch61: repackage-nomd5.diff
Patch62: safeugid.diff
Patch63: noprereqdeprec.diff
Patch64: pythondeps.diff
Patch65: fontprovides.diff
Patch66: rpm-gst-provides.patch
Patch67: langnoc.diff
Patch68: initscriptsprov.diff
Patch69: remove-translations.diff
Patch70: no_rep_autop.diff
Patch71: headeradddb.diff
Patch72: rpmdb_get_open_flags.diff
Patch73: verify_p.diff
Patch74: dbprivate.diff
Patch75: nobuildcolor.diff
Patch76: fileattrs.diff
Patch77: emptyprep.diff
Patch78: nomagiccheck.diff
Patch79: findsupplements.diff
Patch80: magic_and_path.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#
# avoid bootstrapping problem
@ -168,7 +163,9 @@ rm -rf sqlite
rm -rf beecrypt
tar xjf %{SOURCE10}
tar xjf %{SOURCE11}
ln -s db-4.8.30 db
ln -s beecrypt-4.1.2 beecrypt
chmod -R u+w db/*
#tar xjf %{SOURCE12}
#ln -s neon-0.24.7 neon
# will get linked from db3
@ -181,8 +178,7 @@ rm -f rpmdb/db.h
%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 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79
%patch -P 80 -P 81 -P 82 -P 83 -P 85
%patch84 -p1
%patch -P 80
#chmod 755 scripts/find-supplements{,.ksyms}
#chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms
#chmod 755 scripts/firmware.prov
@ -193,6 +189,8 @@ if [ -s /etc/rpm/suse_macros ]; then
cp -a /etc/rpm/suse_macros %{SOURCE4}
fi
cp -a %{SOURCE4} suse_macros
rm -f m4/libtool.m4
rm -f m4/lt*.m4
%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -ffunction-sections"
@ -203,14 +201,14 @@ export CFLAGS="-g -O0 -fno-strict-aliasing"
#cp -p /usr/share/gettext/config.rpath .
cp autogen.sh beecrypt
pushd beecrypt
./autogen.sh --with-pic
./autogen.sh --with-pic --without-python
make %{?_smp_mflags}
popd
./autogen.sh --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
--libdir=%{_libdir} --sysconfdir=/etc --localstatedir=/var --with-lua \
--with-selinux --with-internal-beecrypt --with-acl --with-cap --enable-shared %{?with_python: --enable-python}
rm po/de.gmo
make %{?_smp_mflags}
make #%{?_smp_mflags}
make convertdb1
%install
@ -283,6 +281,7 @@ popd
gzip -9 CHANGES
rm -rf $RPM_BUILD_ROOT/%{_libdir}/python%{py_ver}
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/rpm-plugins/*.la
sh $RPM_BUILD_ROOT/usr/lib/rpm/find-lang.sh $RPM_BUILD_ROOT rpm
%clean
@ -298,9 +297,8 @@ if test -s var/lib/rpm/packages.rpm ; then
mv -f var/lib/rpm/packages.rpm var/lib/rpm/packages.rpm3
rm -f var/lib/rpm/conflictsindex.rpm var/lib/rpm/fileindex.rpm var/lib/rpm/groupindex.rpm var/lib/rpm/nameindex.rpm var/lib/rpm/providesindex.rpm var/lib/rpm/requiredby.rpm var/lib/rpm/triggerindex.rpm
fi
if test -s var/lib/rpm/Filemd5s -a ! -e var/lib/rpm/Filedigests ; then
ln var/lib/rpm/Filemd5s var/lib/rpm/Filedigests
fi
# delete no longer maintained databases
rm -f var/lib/rpm/Filemd5s var/lib/rpm/Filedigests var/lib/rpm/Requireversion var/lib/rpm/Provideversion
%postun
%{insserv_cleanup}
@ -319,9 +317,11 @@ fi
/etc/init.d/rpmconfigcheck
/usr/sbin/rcrpmconfigcheck
/usr/lib/rpm
%{_libdir}/rpm-plugins
%{_libdir}/librpm.so.*
%{_libdir}/librpmbuild.so.*
%{_libdir}/librpmio.so.*
%{_libdir}/librpmsign.so.*
%doc %{_mandir}/man[18]/*.[18]*
%dir /var/lib/rpm
%verify(not mode) %dir %attr(755,root,root) /usr/src/packages/BUILD
@ -339,6 +339,7 @@ fi
%{_libdir}/librpm.so
%{_libdir}/librpmbuild.so
%{_libdir}/librpmio.so
%{_libdir}/librpmsign.so
%{_libdir}/pkgconfig/rpm.pc
%changelog

View File

@ -1,19 +0,0 @@
--- 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 = \

13
rpmdb_get_open_flags.diff Normal file
View File

@ -0,0 +1,13 @@
Suppress berkeleydb error messages when doing 'rpm --verifydb'.
--- lib/rpmdb.c.orig 2011-05-12 14:08:07.000000000 +0000
+++ lib/rpmdb.c 2011-05-12 14:09:06.000000000 +0000
@@ -165,7 +165,7 @@ static dbiIndex rpmdbOpenIndex(rpmdb db,
uintId, uintCmp, NULL);
}
/* If primary got created, we can safely run without fsync */
- if ((dbiFlags(dbi) & DBI_CREATED) || db->cfg.db_no_fsync) {
+ if ((!verifyonly && (dbiFlags(dbi) & DBI_CREATED)) || db->cfg.db_no_fsync) {
rpmlog(RPMLOG_DEBUG, "disabling fsync on database\n");
db->cfg.db_no_fsync = 1;
dbSetFSync(db->db_dbenv, 0);

View File

@ -1,14 +1,8 @@
---
rpmpopt.in | 47 ++++++++++++++++++++++-------------------------
1 file changed, 22 insertions(+), 25 deletions(-)
Index: rpmpopt.in
===================================================================
--- rpmpopt.in.orig
+++ rpmpopt.in
@@ -91,7 +91,8 @@ Signature : %|DSAHEADER?{%{DSAHEADER:p
%|PACKAGER?{Packager : %{PACKAGER}\n}|\
--- ./rpmpopt.in.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./rpmpopt.in 2011-05-11 15:02:34.000000000 +0000
@@ -101,7 +101,8 @@ Relocations : %|PREFIXES?{[%{PREFIXES} ]
%|URL?{URL : %{URL}\n}|\
%|BUGURL?{Bug URL : %{BUGURL}\n}|\
Summary : %{SUMMARY}\n\
-Description :\n%{DESCRIPTION}\n' \
+Description :\n%{DESCRIPTION}\n\

View File

@ -1,13 +1,11 @@
Provide rpmqpack, a fast way to list all installed packages are
check if some package is installed. This is a hack.
Index: Makefile.am
===================================================================
--- Makefile.am.orig
+++ Makefile.am
@@ -139,6 +139,10 @@ check_PROGRAMS += rpmsort
rpmsort_SOURCES = tools/rpmsort.c
rpmsort_LDADD = lib/librpm.la
--- ./Makefile.am.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./Makefile.am 2011-05-11 15:15:27.000000000 +0000
@@ -170,6 +170,10 @@ rpmgraph_LDADD = lib/librpm.la rpmio/lib
dist_bin_SCRIPTS = scripts/gendiff
+bin_PROGRAMS += rpmqpack
+rpmqpack_SOURCES = rpmqpack.c
@ -16,23 +14,19 @@ Index: Makefile.am
rpmconfig_DATA = rpmrc
rpmrc: $(top_srcdir)/rpmrc.in
@$(SED) \
Index: doc/Makefile.am
===================================================================
--- doc/Makefile.am.orig
+++ doc/Makefile.am
@@ -7,7 +7,7 @@ man_man1_DATA = gendiff.1
EXTRA_DIST += $(man_man1_DATA)
--- ./doc/Makefile.am.orig 2011-01-05 08:11:09.000000000 +0000
+++ ./doc/Makefile.am 2011-05-11 15:16:24.000000000 +0000
@@ -8,7 +8,7 @@ EXTRA_DIST += $(man_man1_DATA)
man_man8dir = $(mandir)/man8
-man_man8_DATA = rpm.8 rpmbuild.8 rpmdeps.8 rpmgraph.8 rpm2cpio.8
+man_man8_DATA = rpm.8 rpmbuild.8 rpmdeps.8 rpmgraph.8 rpm2cpio.8 rpmqpack.8
man_man8_DATA = rpm.8 rpmbuild.8 rpmdeps.8 rpmgraph.8 rpm2cpio.8
-man_man8_DATA += rpmdb.8 rpmkeys.8 rpmsign.8 rpmspec.8
+man_man8_DATA += rpmdb.8 rpmkeys.8 rpmsign.8 rpmspec.8 rpmqpack.8
EXTRA_DIST += $(man_man8_DATA)
man_fr_man8dir = $(mandir)/fr/man8
Index: doc/rpmqpack.8
===================================================================
--- /dev/null
+++ doc/rpmqpack.8
--- ./doc/rpmqpack.8.orig 2011-05-11 15:15:27.000000000 +0000
+++ ./doc/rpmqpack.8 2011-05-11 15:15:27.000000000 +0000
@@ -0,0 +1,25 @@
+.TH RPMQPACK 8 "Mar 2002"
+.SH NAME
@ -59,10 +53,8 @@ Index: doc/rpmqpack.8
+
+.SH AUTHOR
+Michael Schroeder <mls@suse.de>
Index: rpmqpack.c
===================================================================
--- /dev/null
+++ rpmqpack.c
--- ./rpmqpack.c.orig 2011-05-11 15:15:27.000000000 +0000
+++ ./rpmqpack.c 2011-05-11 15:15:27.000000000 +0000
@@ -0,0 +1,59 @@
+#include <sys/types.h>
+#include <limits.h>
@ -88,7 +80,7 @@ Index: rpmqpack.c
+ perror("db_create");
+ exit(1);
+ }
+ if (db->open(db, 0, "/var/lib/rpm/Name", 0, DB_HASH, DB_RDONLY, 0664))
+ if (db->open(db, 0, "/var/lib/rpm/Name", 0, DB_UNKNOWN, DB_RDONLY, 0664))
+ {
+ perror("db->open");
+ exit(1);

View File

@ -1,9 +1,7 @@
Patch machine detection code: detect transmeta, rename parisc to hppa. [#52713]
Index: lib/rpmrc.c
===================================================================
--- lib/rpmrc.c.orig
+++ lib/rpmrc.c
--- ./lib/rpmrc.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./lib/rpmrc.c 2011-05-11 12:48:02.000000000 +0000
@@ -1,9 +1,6 @@
#include "system.h"
@ -12,9 +10,9 @@ Index: lib/rpmrc.c
-#include <setjmp.h>
-#endif
#include <ctype.h> /* XXX for /etc/rpm/platform contents */
@@ -784,6 +781,14 @@ static inline int RPMClass(void)
#if HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
@@ -788,6 +785,14 @@ static inline int RPMClass(void)
cpu = (tfms>>8)&15;
@ -29,7 +27,7 @@ Index: lib/rpmrc.c
sigaction(SIGILL, &oldsa, NULL);
if (cpu < 6)
@@ -920,15 +925,6 @@ static int is_geode()
@@ -924,15 +929,6 @@ static int is_geode()
}
#endif
@ -45,7 +43,7 @@ Index: lib/rpmrc.c
/**
*/
static void defaultMachine(const char ** arch,
@@ -1055,6 +1051,11 @@ static void defaultMachine(const char **
@@ -1059,6 +1055,11 @@ static void defaultMachine(const char **
/* big endian */
strcpy(un.machine, "mips");
# endif

View File

@ -1,50 +1,33 @@
--- 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_safe(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"
Work around glibc/nscd caching problems when doing 'rpm --root'.
--- ./lib/rpmchroot.c.orig 2011-05-12 08:26:10.000000000 +0000
+++ ./lib/rpmchroot.c 2011-05-12 08:28:32.000000000 +0000
@@ -66,6 +66,7 @@ int rpmChrootIn(void)
} else if (rootState.chrootDone == 0) {
if (chdir("/") == 0 && chroot(rootState.rootDir) == 0) {
rootState.chrootDone = 1;
+ rpmugChroot(1);
} else {
rpmlog(RPMLOG_ERR, _("Unable to change root directory: %m\n"));
rc = -1;
@@ -91,6 +92,7 @@ int rpmChrootOut(void)
} else if (rootState.chrootDone == 1) {
if (chroot(".") == 0 && fchdir(rootState.cwd) == 0) {
rootState.chrootDone = 0;
+ rpmugChroot(0);
} else {
rpmlog(RPMLOG_ERR, _("Unable to restore root directory: %m\n"));
rc = -1;
--- ./lib/rpmug.c.orig 2011-05-12 08:13:52.000000000 +0000
+++ ./lib/rpmug.c 2011-05-12 08:33:28.000000000 +0000
@@ -35,6 +35,47 @@ const char * rpmugStashStr(const char *s
return ret;
}
+#if defined(__GLIBC__)
+
+static int inchroot;
+
+/*
+ * Unfortunatelly glibc caches nss/nscd data and there is no
+ * good way to flush those caches when we did a chroot(). Thus
@ -80,50 +63,30 @@
+ fclose(fp);
+ return -1;
+}
+#endif
+
/* 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;
/*
* These really ought to use hash tables. I just made the
* guess that most files would be owned by root or the same person/group
@@ -68,17 +109,28 @@ int rpmugUid(const char * thisUname, uid
lastUnameAlloced = thisUnameLen + 10;
lastUname = xrealloc(lastUname, lastUnameAlloced); /* XXX memory leak */
}
strcpy(lastUname, thisUname);
- strcpy(lastUname, thisUname);
- pwent = getpwnam(thisUname);
- if (pwent == NULL) {
- /* FIX: shrug */
- endpwent();
+ if (safe) {
+ int uid = safe_lookup("/etc/passwd", thisUname);
+#if defined(__GLIBC__)
+ if (inchroot) {
+ int uid = safe_lookup("/etc/passwd", thisUname);
+ if (uid < 0)
+ return -1;
+ lastUid = (uid_t)uid;
+ } else {
+ lastUid = uid;
+ } else
+#endif
+ {
pwent = getpwnam(thisUname);
- if (pwent == NULL) return -1;
+ if (pwent == NULL) {
@ -134,103 +97,117 @@
+ }
+ lastUid = pwent->pw_uid;
}
-
- lastUid = pwent->pw_uid;
+ strcpy(lastUname, thisUname);
+ lastUnameLen = thisUnameLen;
}
*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;
@@ -111,18 +163,29 @@ int rpmugGid(const char * thisGname, gid
lastGnameAlloced = thisGnameLen + 10;
lastGname = xrealloc(lastGname, lastGnameAlloced); /* XXX memory leak */
}
strcpy(lastGname, thisGname);
- strcpy(lastGname, thisGname);
- grent = getgrnam(thisGname);
- if (grent == NULL) {
- /* FIX: shrug */
- endgrent();
+ if (safe) {
+ int gid = safe_lookup("/etc/group", thisGname);
+#if defined(__GLIBC__)
+ if (inchroot) {
+ int gid = safe_lookup("/etc/group", thisGname);
+ if (gid < 0)
+ return -1;
+ lastGid = (gid_t)gid;
+ } else {
+ lastGid = gid;
+ } else
+#endif
+ {
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;
+ strcpy(lastGname, thisGname);
+ lastGnameLen = thisGnameLen;
}
*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)
@@ -134,7 +197,7 @@ const char * rpmugUname(uid_t uid)
{
static uid_t lastUid = (uid_t) -1;
static char * lastUname = NULL;
- static size_t lastUnameLen = 0;
+ static size_t lastUnameAlloced = 0;
if (uid == (uid_t) -1) {
lastUid = (uid_t) -1;
@@ -151,9 +214,9 @@ const char * rpmugUname(uid_t uid)
lastUid = uid;
len = strlen(pwent->pw_name);
- if (lastUnameLen < len + 1) {
- lastUnameLen = len + 20;
- lastUname = xrealloc(lastUname, lastUnameLen);
+ if (lastUnameAlloced < len + 1) {
+ lastUnameAlloced = len + 20;
+ lastUname = xrealloc(lastUname, lastUnameAlloced);
}
strcpy(lastUname, pwent->pw_name);
@@ -165,7 +228,7 @@ const char * rpmugGname(gid_t gid)
{
static gid_t lastGid = (gid_t) -1;
static char * lastGname = NULL;
- static size_t lastGnameLen = 0;
+ static size_t lastGnameAlloced = 0;
if (gid == (gid_t) -1) {
lastGid = (gid_t) -1;
@@ -182,9 +245,9 @@ const char * rpmugGname(gid_t gid)
lastGid = gid;
len = strlen(grent->gr_name);
- if (lastGnameLen < len + 1) {
- lastGnameLen = len + 20;
- lastGname = xrealloc(lastGname, lastGnameLen);
+ if (lastGnameAlloced < len + 1) {
+ lastGnameAlloced = len + 20;
+ lastGname = xrealloc(lastGname, lastGnameAlloced);
}
strcpy(lastGname, grent->gr_name);
@@ -200,3 +263,16 @@ void rpmugFree(void)
rpmugGname(-1);
strStash = strCacheFree(strStash);
}
+
+void rpmugChroot(int in)
+{
+ /* tell libc to drop caches / file descriptors */
+ endpwent();
+ endgrent();
+ /* drop our own caches */
+ rpmugUid(NULL, NULL);
+ rpmugGid(NULL, NULL);
+#if defined(__GLIBC__)
+ inchroot = in;
+#endif
+}
--- ./lib/rpmug.h.orig 2011-05-12 08:13:52.000000000 +0000
+++ ./lib/rpmug.h 2011-05-12 08:26:56.000000000 +0000
@@ -15,4 +15,6 @@ const char * rpmugGname(gid_t gid);
void rpmugFree(void);
+void rpmugChroot(int in);
+
#endif /* _RPMUG_H */

View File

@ -1,8 +1,6 @@
Index: build/parseSpec.c
===================================================================
--- build/parseSpec.c.orig
+++ build/parseSpec.c
@@ -425,6 +425,7 @@ int parseSpec(rpmts ts, const char *spec
--- ./build/parseSpec.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./build/parseSpec.c 2011-05-11 15:58:37.000000000 +0000
@@ -519,6 +519,7 @@ static rpmSpec parseSpec(const char *spe
spec = newSpec();
spec->specFile = rpmGetPath(specFile, NULL);

View File

@ -2,35 +2,39 @@ Suspend exclusive database lock when scriptlets get called, allowing
read access in scriptlets. Only needed for DB_PRIVATE (aka global)
locking.
I hijacked the dbiSync function for this because I did not want
to change the ABI.
--- ./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:
--- ./lib/backend/db3.c.orig 2011-05-12 10:24:20.000000000 +0000
+++ ./lib/backend/db3.c 2011-05-12 10:26:14.000000000 +0000
@@ -640,3 +640,59 @@ int dbiOpen(rpmdb rdb, rpmDbiTagVal rpmt
return rc;
}
+static int db3SuspendResumeLock(dbiIndex dbi, int mode);
+
static int db3sync(dbiIndex dbi, unsigned int flags)
{
DB * db = dbi->dbi_db;
int rc = 0;
+ if (flags == (unsigned int)-1)
+ return db3SuspendResumeLock(dbi, 0);
+ if (flags == (unsigned int)-2)
+ return db3SuspendResumeLock(dbi, 1);
if (db != NULL) {
rc = db->sync(db, flags);
rc = cvtdberr(dbi, "db->sync", rc, _debug);
@@ -848,6 +854,48 @@ static int db3open(rpmdb rpmdb, rpmTag r
return rc;
}
+static int
+db3SuspendResumeLock(dbiIndex dbi, int mode)
+int dbiSuspendDBLock(dbiIndex dbi, unsigned int flags)
+{
+ struct flock l;
+ int rc = 0;
+ int fdno = -1;
+
+ if (!dbi->dbi_lockdbfd)
+ return 0;
+ if (!(dbi->dbi_rpmdb->db_mode & (O_RDWR|O_WRONLY)))
+ return 0;
+ if (_lockdbfd == 0)
+ return 0;
+ if (!(dbi->dbi_db->fd(dbi->dbi_db, &fdno) == 0 && fdno >= 0))
+ return 1;
+ memset(&l, 0, sizeof(l));
+ l.l_whence = 0;
+ l.l_start = 0;
+ l.l_len = 0;
+ l.l_type = F_RDLCK;
+ rc = fcntl(fdno, F_SETLK, (void *)&l);
+ if (rc)
+ rpmlog(RPMLOG_WARNING, _("could not suspend database lock\n"));
+ return rc;
+}
+
+int dbiResumeDBLock(dbiIndex dbi, unsigned int flags)
+{
+ struct flock l;
+ int rc = 0;
@ -39,88 +43,87 @@ to change the ABI.
+
+ if (!dbi->dbi_lockdbfd)
+ return 0;
+ if (!(dbi->dbi_mode & (O_RDWR|O_WRONLY)))
+ if (!(dbi->dbi_rpmdb->db_mode & (O_RDWR|O_WRONLY)))
+ return 0;
+ if (dbi->dbi_use_dbenv && _lockdbfd == 0)
+ if (_lockdbfd == 0)
+ return 0;
+ if (!(dbi->dbi_db->fd(dbi->dbi_db, &fdno) == 0 && fdno >= 0))
+ return 1;
+ if (mode == 0) {
+ for (tries = 0; tries < 2; tries++) {
+ memset(&l, 0, sizeof(l));
+ l.l_whence = 0;
+ l.l_start = 0;
+ l.l_len = 0;
+ l.l_type = F_RDLCK;
+ rc = fcntl(fdno, F_SETLK, (void *) &l);
+ if (rc)
+ rpmlog(RPMLOG_WARNING, _("could not suspend database lock\n"));
+ } else {
+ for (tries = 0; tries < 2; tries++) {
+ memset(&l, 0, sizeof(l));
+ l.l_whence = 0;
+ l.l_start = 0;
+ l.l_len = 0;
+ l.l_type = F_WRLCK;
+ rc = fcntl(fdno, tries ? F_SETLKW : F_SETLK, (void *) &l);
+ if (!rc)
+ break;
+ if (tries == 0)
+ rpmlog(RPMLOG_WARNING, _("waiting to reestablish exclusive database lock\n"));
+ }
+ l.l_type = F_WRLCK;
+ rc = fcntl(fdno, tries ? F_SETLKW : F_SETLK, (void *)&l);
+ if (!rc)
+ break;
+ if (tries == 0)
+ rpmlog(RPMLOG_WARNING, _("waiting to reestablish exclusive database lock\n"));
+ }
+ return rc;
+}
+
/** \ingroup db3
*/
--- ./lib/backend/dbi.h.orig 2010-12-21 09:48:21.000000000 +0000
+++ ./lib/backend/dbi.h 2011-05-12 10:24:57.000000000 +0000
@@ -263,6 +263,24 @@ int dbiFlags(dbiIndex dbi);
RPM_GNUC_INTERNAL
--- ./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;
}
const char * dbiName(dbiIndex dbi);
+/** \ingroup dbi
+ * Suspend the exclusive lock on the dbi
+ * @param dbi index database handle
+ * @param flags (unused)
+ * @return 0 on success
+ */
+RPM_GNUC_INTERNAL
+int dbiSuspendDBLock(dbiIndex dbi, unsigned int flags);
+
+/** \ingroup dbi
+ * Reacquire an exclusive lock on the dbi
+ * @param dbi index database handle
+ * @param flags (unused)
+ * @return 0 on success
+ */
+RPM_GNUC_INTERNAL
+int dbiResumeDBLock(dbiIndex dbi, unsigned int flags);
+
#ifdef __cplusplus
}
#endif
--- ./lib/psm.c.orig 2011-05-12 10:23:47.000000000 +0000
+++ ./lib/psm.c 2011-05-12 10:24:57.000000000 +0000
@@ -412,10 +412,12 @@ static rpmRC runScript(rpmpsm psm, ARGV_
script->tag != RPMTAG_VERIFYSCRIPT);
int selinux = !(rpmtsFlags(psm->ts) & RPMTRANS_FLAG_NOCONTEXTS);
+ 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);
rpmswEnter(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0);
rc = rpmScriptRun(script, arg1, arg2, rpmtsScriptFd(psm->ts),
prefixes, warn_only, selinux);
rpmswExit(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0);
+ 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;
/*
* Notify callback for all errors. "total" abused for warning/error,
--- ./lib/rpmdb.c.orig 2011-05-12 10:23:47.000000000 +0000
+++ ./lib/rpmdb.c 2011-05-12 10:24:57.000000000 +0000
@@ -674,6 +674,12 @@ int rpmdbSync(rpmdb db)
return dbiForeach(db->_dbi, dbiSync, 0);
}
+int rpmdbSuspendResumeDBLock(rpmdb db, int mode)
+{
+ int dbix;
+ int rc = 0;
+ if (db == NULL) return 0;
+ for (dbix = 0; dbix < db->db_ndbi; dbix++) {
+ int xx;
+ if (db->_dbi[dbix] == NULL)
+ continue;
+ xx = dbiSync(db->_dbi[dbix], mode ? -2 : -1);
+ if (xx && rc == 0) rc = xx;
+ }
+ return rc;
+ return dbiForeach(db->_dbi, mode ? dbiResumeDBLock : dbiSuspendDBLock, 0);
+}
+
/* 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)
static rpmdb newRpmdb(const char * root, const char * home,
int mode, int perms, int flags)
{
--- ./lib/rpmts.c.orig 2010-12-22 11:17:20.000000000 +0000
+++ ./lib/rpmts.c 2011-05-12 10:24:57.000000000 +0000
@@ -95,6 +95,11 @@ int rpmtsOpenDB(rpmts ts, int dbmode)
return rc;
}
@ -131,16 +134,14 @@ to change the ABI.
+
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);
rpmlock lock = rpmtsAcquireLock(ts);
--- ./lib/rpmts.h.orig 2010-12-21 09:50:50.000000000 +0000
+++ ./lib/rpmts.h 2011-05-12 10:24:57.000000000 +0000
@@ -423,6 +423,8 @@ 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 @*/;
+int rpmtsSuspendResumeDBLock(rpmts ts, int mode);
+
/** \ingroup rpmts
* Return number of (ordered) transaction set elements.

View File

@ -1,181 +1,14 @@
The taggedfileindex patch. Speeds up database searches, but breaks
fingerprint semantics.
rh#103204
--- ./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;
}
+static inline unsigned int taghash(const char *s)
+{
+ int c;
+ unsigned int r = 0;
+ while ((c = *(const unsigned char *)s++) != 0)
+ if (c != '/')
+ r += (r << 3) + c;
+ return ((r & 0x7fff) | 0x8000) << 16;
+}
+
/**
* Find file matches in database.
* @param db rpm database
@@ -1181,6 +1191,11 @@ static int rpmdbFindByFile(rpmdb db, con
if (rc == 0)
(void) dbt2set(dbi, data, &allMatches);
+ /* strip off directory tags */
+ if (allMatches != NULL)
+ for (i = 0; i < allMatches->count; i++)
+ if (allMatches->recs[i].tagNum & 0x80000000)
+ allMatches->recs[i].tagNum &= 0x0000ffff;
xx = dbiCclose(dbi, dbcursor, 0);
dbcursor = NULL;
} else
@@ -2182,7 +2197,7 @@ void rpmdbSortIterator(rpmdbMatchIterato
}
}
-static int rpmdbGrowIterator(rpmdbMatchIterator mi)
+static int rpmdbGrowIterator(rpmdbMatchIterator mi, unsigned int tag)
{
DBC * dbcursor;
DBT * key;
@@ -2232,6 +2247,27 @@ static int rpmdbGrowIterator(rpmdbMatchI
dbcursor = NULL;
#endif
+ if (tag) {
+ int i, j;
+ /* prune the set against the tag */
+ for (i = j = 0; i < set->count; i++) {
+ if (set->recs[i].tagNum & 0x80000000) {
+ /* tagged entry */
+ if ((set->recs[i].tagNum & 0xffff0000) != tag)
+ continue;
+ set->recs[i].tagNum &= 0x0000ffff;
+ }
+ if (i != j)
+ set->recs[j] = set->recs[i];
+ j++;
+ }
+ set->count = j;
+ if (j == 0) {
+ set = dbiFreeIndexSet(set);
+ return DB_NOTFOUND;
+ }
+ }
+
if (mi->mi_set == NULL) {
mi->mi_set = set;
} else {
@@ -2413,7 +2449,15 @@ int rpmdbExtendIterator(rpmdbMatchIterat
{
mi->mi_key.data = (void *) keyp;
mi->mi_key.size = keylen ? keylen : strlen(keyp);
- return rpmdbGrowIterator(mi);
+ return rpmdbGrowIterator(mi, 0);
+}
+
+int rpmdbExtendIteratorDirtag(rpmdbMatchIterator mi,
+ const void * keyp, size_t keylen, const char *dirname)
+{
+ mi->mi_key.data = (void *) keyp;
+ mi->mi_key.size = keylen ? keylen : strlen(keyp);
+ return rpmdbGrowIterator(mi, dirname ? taghash(dirname) : 0);
}
/*
@@ -2808,8 +2852,16 @@ int rpmdbAdd(rpmdb db, int iid, Header h
if (hdrNum)
{
+ struct rpmtd_s dn, di;
+ const char ** dirNames;
+ uint32_t * dirIndexes;
dbiIndexItem rec = dbiIndexNewItem(hdrNum, 0);
+ headerGet(h, RPMTAG_DIRNAMES, &dn, HEADERGET_MINMEM);
+ headerGet(h, RPMTAG_DIRINDEXES, &di, HEADERGET_MINMEM);
+ dirNames = dn.data;
+ dirIndexes = di.data;
+
if (dbiTags.tags != NULL)
for (dbix = 0; dbix < dbiTags.max; dbix++) {
rpmTag rpmtag;
@@ -2901,6 +2953,10 @@ int rpmdbAdd(rpmdb db, int iid, Header h
*/
i = rec->tagNum = rpmtdGetIndex(&tagdata);
switch (rpmtag) {
+ case RPMTAG_BASENAMES:
+ if (i < 0x010000)
+ rec->tagNum |= taghash(dirNames[dirIndexes[i]]);
+ break;
case RPMTAG_REQUIRENAME: {
/* Filter out install prerequisites. */
rpm_flag_t *rflag = rpmtdNextUint32(&reqflags);
@@ -2986,6 +3042,9 @@ cont:
if (ret == 0) {
headerSetInstance(h, hdrNum);
This used to be the taggedfileindex patch, but it's gone.
The remaining part just strips off the tag.
--- ./lib/rpmdb.c.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./lib/rpmdb.c 2011-05-11 15:14:39.000000000 +0000
@@ -257,6 +257,9 @@ static int dbt2set(dbiIndex dbi, DBT * d
_DBSWAP(hdrNum);
_DBSWAP(tagNum);
}
+ /* remove tagged directory info */
+ if (tagNum.ui & 0x80000000)
+ tagNum.ui &= 0x0000ffff;
set->recs[i].hdrNum = hdrNum.ui;
set->recs[i].tagNum = tagNum.ui;
}
+
+ rpmtdFreeData(&dn);
+ rpmtdFreeData(&di);
}
exit:
--- ./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);
+int rpmdbExtendIteratorDirtag(rpmdbMatchIterator mi,
+ const void * keyp, size_t keylen, const char *);
+
/** \ingroup rpmdb
* sort the iterator by (recnum, filenum)
* Return database iterator.
--- ./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 xx;
const char * baseName;
+ const char * dirName;
+#if 0
rpmStringSet baseNames = rpmStringSetCreate(fileCount,
hashFunctionString, strcmp, NULL);
+#endif
mi = rpmdbInitIterator(rpmtsGetRdb(ts), RPMTAG_BASENAMES, NULL, 0);
@@ -868,18 +871,25 @@ rpmdbMatchIterator rpmFindBaseNamesInDB(
while (rpmfiNext(fi) >= 0) {
size_t keylen;
baseName = rpmfiBN(fi);
+ dirName = rpmfiDN(fi);
+#if 0
if (rpmStringSetHasEntry(baseNames, baseName))
continue;
+#endif
keylen = strlen(baseName);
if (keylen == 0)
keylen++; /* XXX "/" fixup. */
- xx = rpmdbExtendIterator(mi, baseName, keylen);
+ xx = rpmdbExtendIteratorDirtag(mi, baseName, keylen, dirName);
+#if 0
rpmStringSetAddEntry(baseNames, baseName);
+#endif
}
}
pi = rpmtsiFree(pi);
+#if 0
rpmStringSetFree(baseNames);
+#endif
rpmdbSortIterator(mi);
/* iterator is now sorted by (recnum, filenum) */

View File

@ -1,17 +0,0 @@
--- ./build.c.orig 2010-04-07 14:56:36.000000000 +0000
+++ ./build.c 2010-04-07 14:58:52.000000000 +0000
@@ -126,7 +126,13 @@ static char * getTarSpec(const char *arg
if (!(fp = popen(cmd, "r"))) {
rpmlog(RPMLOG_ERR, _("Failed to open tar pipe: %m\n"));
} else {
- char *fok = fgets(tarbuf, sizeof(tarbuf) - 1, fp);
+ char *fok;
+ for (;;) {
+ fok = fgets(tarbuf, sizeof(tarbuf) - 1, fp);
+ /* tar sometimes prints "tar: Record size = 16" messages */
+ if (!fok || strncmp(fok, "tar: ", 5) != 0)
+ break;
+ }
pclose(fp);
gotspec = (fok != NULL) && isSpecFile(tmpSpecFile);
}

49
verify_p.diff Normal file
View File

@ -0,0 +1,49 @@
Make 'rpm -Vp <rpm>' work again.
--- ./lib/rpmte.c.orig 2011-05-12 15:22:06.000000000 +0000
+++ ./lib/rpmte.c 2011-05-12 15:23:39.000000000 +0000
@@ -905,15 +905,19 @@ int rpmteProcess(rpmte te, pkgGoal goal)
}
}
- rpmteRunAllCollections(te, PLUGINHOOK_COLL_PRE_REMOVE);
-
- if (rpmteOpen(te, reset_fi)) {
+ if (goal == PKG_VERIFY) {
failed = rpmpsmRun(te->ts, te, goal);
- rpmteClose(te, reset_fi);
- }
+ } else {
+ rpmteRunAllCollections(te, PLUGINHOOK_COLL_PRE_REMOVE);
+
+ if (rpmteOpen(te, reset_fi)) {
+ failed = rpmpsmRun(te->ts, te, goal);
+ rpmteClose(te, reset_fi);
+ }
- rpmteRunAllCollections(te, PLUGINHOOK_COLL_POST_ADD);
- rpmteRunAllCollections(te, PLUGINHOOK_COLL_POST_ANY);
+ rpmteRunAllCollections(te, PLUGINHOOK_COLL_POST_ADD);
+ rpmteRunAllCollections(te, PLUGINHOOK_COLL_POST_ANY);
+ }
/* XXX should %pretrans failure fail the package install? */
if (failed && !scriptstage) {
--- ./lib/verify.c.orig 2011-05-12 15:22:01.000000000 +0000
+++ ./lib/verify.c 2011-05-12 15:22:49.000000000 +0000
@@ -267,11 +267,11 @@ static int rpmVerifyScript(rpmts ts, Hea
if (headerIsEntry(h, RPMTAG_VERIFYSCRIPT)) {
/* fake up a erasure transaction element */
- (void) rpmtsAddEraseElement(ts, h, -1);
-
- rc = (rpmteProcess(rpmtsElement(ts, 0), PKG_VERIFY) != RPMRC_OK);
-
+ rpmte p = rpmteNew(ts, h, TR_REMOVED, NULL, NULL);
+ rpmteSetHeader(p, h);
+ rc = (rpmteProcess(p, PKG_VERIFY) != RPMRC_OK);
/* clean up our fake transaction bits */
+ rpmteFree(p);
rpmtsEmpty(ts);
}

View File

@ -1,97 +1,104 @@
Fix global (DB_PRIVATE) lock code: fix recursion counter, retry
failed lock operations for up to 3 minutes.
--- ./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
--- ./lib/backend/db3.c.orig 2011-03-02 06:40:10.000000000 +0000
+++ ./lib/backend/db3.c 2011-05-12 10:24:20.000000000 +0000
@@ -432,6 +432,8 @@ int dbiVerify(dbiIndex dbi, unsigned int
return rc;
}
+static int _lockdbfd = 0;
+
static int db3close(dbiIndex dbi, unsigned int flags)
int dbiClose(dbiIndex dbi, unsigned int flags)
{
rpmdb rpmdb = dbi->dbi_rpmdb;
@@ -414,6 +416,9 @@ static int db3close(dbiIndex dbi, unsign
rpmdb rdb = dbi->dbi_rpmdb;
@@ -451,6 +453,8 @@ int dbiClose(dbiIndex dbi, unsigned int
rpmlog(RPMLOG_DEBUG, "closed db index %s/%s\n",
dbhome, dbi->dbi_file);
+ if (dbi->dbi_lockdbfd &&
+ _lockdbfd)
+ if (dbi->dbi_lockdbfd && _lockdbfd)
+ _lockdbfd--;
}
if (rpmdb->db_dbenv != NULL && dbi->dbi_use_dbenv) {
@@ -645,8 +651,6 @@ static int db3open(rpmdb rpmdb, rpmTag r
}
xx = db_fini(rdb, dbhome ? dbhome : "");
@@ -490,6 +494,7 @@ static int dbiFlock(dbiIndex dbi, int mo
rc = 1;
} else {
const char *dbhome = rpmdbHome(dbi->dbi_rpmdb);
+ int tries;
struct flock l;
memset(&l, 0, sizeof(l));
l.l_whence = 0;
@@ -499,20 +504,38 @@ static int dbiFlock(dbiIndex dbi, int mo
? F_RDLCK : F_WRLCK;
l.l_pid = 0;
if (rc == 0) {
- static int _lockdbfd = 0;
-
rc = db_create(&db, dbenv, dbi->dbi_cflags);
rc = cvtdberr(dbi, "db_create", rc, _debug);
if (rc == 0 && db != NULL) {
@@ -810,6 +814,7 @@ static int db3open(rpmdb rpmdb, rpmTag r
if (!(db->fd(db, &fdno) == 0 && fdno >= 0)) {
rc = 1;
} else {
+ int tries;
struct flock l;
memset(&l, 0, sizeof(l));
l.l_whence = 0;
@@ -819,24 +824,39 @@ static int db3open(rpmdb rpmdb, rpmTag r
? F_RDLCK : F_WRLCK;
l.l_pid = 0;
- rc = fcntl(fdno, F_SETLK, (void *) &l);
- if (rc) {
- /* Warning iff using non-private CDB locking. */
- rc = ((dbi->dbi_use_dbenv &&
- (dbi->dbi_eflags & DB_INIT_CDB) &&
- !(dbi->dbi_eflags & DB_PRIVATE))
- ? 0 : 1);
- rpmlog( (rc ? RPMLOG_ERR : RPMLOG_WARNING),
- _("cannot get %s lock on %s/%s\n"),
- ((dbi->dbi_mode & O_ACCMODE) == O_RDONLY)
- ? _("shared") : _("exclusive"),
- dbhome, dbi->dbi_file);
- } else {
- rpmlog(RPMLOG_DEBUG,
- "locked db index %s/%s\n",
- 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, dbi->dbi_file);
+ ts.tv_sec = (time_t)0;
+ ts.tv_nsec = 100000000;
+ if (tries < 10*60*3) {
+ nanosleep(&ts, (struct timespec *)0);
+ continue;
+ }
+ }
+ rpmlog( (rc ? RPMLOG_ERR : RPMLOG_WARNING),
+ _("cannot get %s lock on %s/%s\n"),
+ ((dbi->dbi_mode & O_ACCMODE) == O_RDONLY)
+ ? _("shared") : _("exclusive"),
+ dbhome, dbi->dbi_file);
+ } else {
+ rpmlog(RPMLOG_DEBUG,
+ "locked db index %s/%s\n",
+ dbhome, dbi->dbi_file);
+ }
+ break;
}
}
+ if (rc && dbi->dbi_use_dbenv)
+ _lockdbfd--;
}
- rc = fcntl(fdno, F_SETLK, (void *) &l);
- if (rc) {
- uint32_t eflags = db_envflags(db);
- /* Warning iff using non-private CDB locking. */
- rc = (((eflags & DB_INIT_CDB) && !(eflags & DB_PRIVATE)) ? 0 : 1);
- rpmlog( (rc ? RPMLOG_ERR : RPMLOG_WARNING),
- _("cannot get %s lock on %s/%s\n"),
- ((mode & O_ACCMODE) == O_RDONLY)
- ? _("shared") : _("exclusive"),
- dbhome, dbi->dbi_file);
- } else {
- rpmlog(RPMLOG_DEBUG,
- "locked db index %s/%s\n",
- dbhome, dbi->dbi_file);
+ for (tries = 0; ; tries++) {
+ rc = fcntl(fdno, F_SETLK, (void *) &l);
+ if (rc) {
+ uint32_t eflags = db_envflags(db);
+ /* Warning iff using non-private CDB locking. */
+ rc = (((eflags & DB_INIT_CDB) && !(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"),
+ ((mode & O_ACCMODE) == O_RDONLY)
+ ? _("shared") : _("exclusive"),
+ dbhome, dbi->dbi_file);
+ ts.tv_sec = (time_t)0;
+ ts.tv_nsec = 100000000; /* .1 seconds */
+ if (tries < 10*60*3) { /* 3 minutes */
+ nanosleep(&ts, (struct timespec *)0);
+ continue;
+ }
+ }
+ rpmlog( (rc ? RPMLOG_ERR : RPMLOG_WARNING),
+ _("cannot get %s lock on %s/%s\n"),
+ ((mode & O_ACCMODE) == O_RDONLY)
+ ? _("shared") : _("exclusive"),
+ dbhome, dbi->dbi_file);
+ } else {
+ rpmlog(RPMLOG_DEBUG,
+ "locked db index %s/%s\n",
+ dbhome, dbi->dbi_file);
+ }
+ break;
}
}
return rc;
@@ -529,7 +552,6 @@ int dbiOpen(rpmdb rdb, rpmDbiTagVal rpmt
DB * db = NULL;
DBTYPE dbtype = DB_UNKNOWN;
uint32_t oflags;
- static int _lockdbfd = 0;
if (dbip)
*dbip = NULL;
@@ -603,7 +625,10 @@ int dbiOpen(rpmdb rdb, rpmDbiTagVal rpmt
dbi->dbi_db = db;
dbi->dbi_oflags = oflags;
- if (!verifyonly && rc == 0 && dbi->dbi_lockdbfd && _lockdbfd++ == 0) {
+ if (verifyonly)
+ dbi->dbi_lockdbfd = 0; /* disable locking in verify mode */
+
+ if (rc == 0 && dbi->dbi_lockdbfd && _lockdbfd++ == 0) {
rc = dbiFlock(dbi, rdb->db_mode);
}

View File

@ -14,27 +14,18 @@ B) use RPMSENSE_STRONG to support a "strong" version, "Recommends"
Needs extcond.diff for query operations.
--- ./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 },
--- ./build/parsePreamble.c.orig 2011-01-25 13:52:28.000000000 +0000
+++ ./build/parsePreamble.c 2011-05-11 14:09:07.000000000 +0000
@@ -310,6 +310,8 @@ static struct tokenBits_s const installS
{ "verify", RPMSENSE_SCRIPT_VERIFY },
+ { "hint", RPMSENSE_MISSINGOK },
+ { "strong", RPMSENSE_STRONG },
{ "pretrans", RPMSENSE_PRETRANS },
{ "posttrans", RPMSENSE_POSTTRANS },
+ { "hint", RPMSENSE_MISSINGOK },
+ { "strong", RPMSENSE_STRONG },
{ NULL, 0 }
};
@@ -134,6 +136,8 @@ static const struct tokenBits_s const bu
{ "build", RPMSENSE_SCRIPT_BUILD },
{ "install", RPMSENSE_SCRIPT_INSTALL },
{ "clean", RPMSENSE_SCRIPT_CLEAN },
+ { "hint", RPMSENSE_MISSINGOK },
+ { "strong", RPMSENSE_STRONG },
{ NULL, 0 }
};
@@ -649,6 +653,18 @@ static int handlePreambleTag(rpmSpec spe
@@ -790,6 +792,18 @@ static int handlePreambleTag(rpmSpec spe
if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags)))
return rc;
break;
@ -53,10 +44,10 @@ Needs extcond.diff for query operations.
case RPMTAG_EXCLUDEARCH:
case RPMTAG_EXCLUSIVEARCH:
case RPMTAG_EXCLUDEOS:
@@ -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")},
@@ -895,6 +909,14 @@ static struct PreambleRec_s const preamb
{RPMTAG_BUGURL, 0, 0, LEN_AND_STR("bugurl")},
{RPMTAG_COLLECTIONS, 0, 0, LEN_AND_STR("collections")},
{RPMTAG_ORDERFLAGS, 2, 0, LEN_AND_STR("orderwithrequires")},
+ {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("recommends")},
+ {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("suggests")},
+ {RPMTAG_ENHANCESFLAGS, 0, 0, LEN_AND_STR("supplements")},
@ -68,45 +59,51 @@ Needs extcond.diff for query operations.
{0, 0, 0, 0}
};
--- ./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;
--- ./build/parseReqs.c.orig 2010-12-13 14:01:56.000000000 +0000
+++ ./build/parseReqs.c 2011-05-11 14:16:43.000000000 +0000
@@ -95,6 +95,20 @@ rpmRC parseRCPOT(rpmSpec spec, Package p
nametag = RPMTAG_CONFLICTNAME;
h = spec->buildRestrictions;
break;
+ case RPMTAG_SUGGESTSFLAGS:
+ nametag = RPMTAG_SUGGESTSNAME;
+ break;
+ case RPMTAG_ENHANCESFLAGS:
+ h = pkg->header;
+ nametag = RPMTAG_ENHANCESNAME;
+ break;
+ case RPMTAG_BUILDSUGGESTS:
+ nametag = RPMTAG_SUGGESTSNAME;
+ h = spec->buildRestrictions;
+ break;
+ case RPMTAG_BUILDENHANCES:
+ h = spec->buildRestrictions;
+ break;
default:
case RPMTAG_REQUIREFLAGS:
tagflags |= RPMSENSE_ANY;
--- ./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;
+ nametag = RPMTAG_ENHANCESNAME;
+ h = spec->buildRestrictions;
+ break;
}
for (r = field; *r != '\0'; r = re) {
--- ./build/reqprov.c.orig 2010-12-13 14:01:56.000000000 +0000
+++ ./build/reqprov.c 2011-05-11 14:15:02.000000000 +0000
@@ -75,6 +75,16 @@ int addReqProv(Header h, rpmTagVal tagN,
indextag = RPMTAG_TRIGGERINDEX;
extra = Flags & RPMSENSE_TRIGGER;
+ } else if (tagN == RPMTAG_SUGGESTSFLAGS || tagN == RPMTAG_BUILDSUGGESTS) {
+ nametag = RPMTAG_SUGGESTSNAME;
break;
+ case RPMTAG_SUGGESTSNAME:
+ versiontag = RPMTAG_SUGGESTSVERSION;
+ flagtag = RPMTAG_SUGGESTSFLAGS;
+ extra = Flags & _ALL_REQUIRES_MASK;
+ } else if (tagN == RPMTAG_ENHANCESFLAGS || tagN == RPMTAG_BUILDENHANCES) {
+ nametag = RPMTAG_ENHANCESNAME;
+ break;
+ case RPMTAG_ENHANCESNAME:
+ versiontag = RPMTAG_ENHANCESVERSION;
+ flagtag = RPMTAG_ENHANCESFLAGS;
+ extra = Flags & _ALL_REQUIRES_MASK;
} else {
nametag = RPMTAG_REQUIRENAME;
versiontag = RPMTAG_REQUIREVERSION;
--- ./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[] = {
+ break;
case RPMTAG_REQUIRENAME:
default:
tagN = RPMTAG_REQUIRENAME;
--- ./build/rpmfc.c.orig 2011-02-28 09:57:21.000000000 +0000
+++ ./build/rpmfc.c 2011-05-11 13:58:33.000000000 +0000
@@ -1075,6 +1075,12 @@ static struct DepMsg_s depMsgs[] = {
{ "Obsoletes", { "%{?__find_obsoletes}", NULL, NULL, NULL },
RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OBSOLETEFLAGS,
0, -1 },
@ -119,7 +116,7 @@ Needs extcond.diff for query operations.
{ NULL, { NULL, NULL, NULL, NULL }, 0, 0, 0, 0, 0 }
};
@@ -1490,6 +1496,14 @@ static int rpmfcGenerateDependsHelper(co
@@ -1160,6 +1166,14 @@ static rpmRC rpmfcGenerateDependsHelper(
failnonzero = 0;
tagflags = RPMSENSE_FIND_REQUIRES;
break;
@ -134,9 +131,9 @@ Needs extcond.diff for query operations.
default:
continue;
break;
--- ./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
--- ./lib/formats.c.orig 2011-01-25 13:52:28.000000000 +0000
+++ ./lib/formats.c 2011-05-11 14:02:09.000000000 +0000
@@ -560,6 +560,24 @@ static char * depflagsFormat(rpmtd td, c
return val;
}
@ -161,16 +158,17 @@ Needs extcond.diff for query operations.
/**
* Return tag container array size.
* @param td tag data container
@@ -738,5 +756,6 @@ static const struct headerFormatFunc_s r
{ RPMTD_FORMAT_ARRAYSIZE, "arraysize", arraysizeFormat },
{ RPMTD_FORMAT_FSTATE, "fstate", fstateFormat },
@@ -672,6 +690,7 @@ static const struct headerFormatFunc_s r
{ RPMTD_FORMAT_VFLAGS, "vflags", vflagsFormat },
{ RPMTD_FORMAT_EXPAND, "expand", expandFormat },
{ RPMTD_FORMAT_FSTATUS, "fstatus", fstatusFormat },
+ { RPMTD_FORMAT_DEPFLAG_STRONG, "depflag_strong", depflag_strongFormat },
{ -1, NULL, NULL }
};
--- ./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,
--- ./lib/rpmds.c.orig 2011-02-15 13:04:04.000000000 +0000
+++ ./lib/rpmds.c 2011-05-11 13:58:33.000000000 +0000
@@ -69,6 +69,10 @@ static int dsType(rpmTagVal tag,
t = "Trigger";
evr = RPMTAG_TRIGGERVERSION;
f = RPMTAG_TRIGGERFLAGS;
@ -181,28 +179,28 @@ Needs extcond.diff for query operations.
} 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 {
--- ./lib/rpmds.h.orig 2011-05-11 09:15:33.000000000 +0000
+++ ./lib/rpmds.h 2011-05-11 14:01:07.000000000 +0000
@@ -48,7 +48,7 @@ enum rpmsenseFlags_e {
RPMSENSE_RPMLIB = (1 << 24), /*!< rpmlib(feature) dependency. */
RPMSENSE_TRIGGERPREIN = (1 << 25), /*!< %triggerprein dependency. */
RPMSENSE_KEYRING = (1 << 26),
- RPMSENSE_PATCHES = (1 << 27),
+ RPMSENSE_STRONG = (1 << 27),
- /* bit 27 unused */
+ RPMSENSE_STRONG = (1 << 27),
RPMSENSE_CONFIG = (1 << 28)
} rpmsenseFlags;
};
@@ -74,6 +74,7 @@ typedef enum rpmsenseFlags_e {
@@ -69,6 +69,7 @@ typedef rpmFlags rpmsenseFlags;
RPMSENSE_SCRIPT_VERIFY | \
RPMSENSE_FIND_REQUIRES | \
RPMSENSE_MISSINGOK | \
+ RPMSENSE_STRONG | \
RPMSENSE_SCRIPT_PREP | \
RPMSENSE_SCRIPT_BUILD | \
RPMSENSE_SCRIPT_INSTALL | \
--- ./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 {
RPMSENSE_RPMLIB | \
RPMSENSE_KEYRING | \
RPMSENSE_PRETRANS | \
--- ./lib/rpmtag.h.orig 2010-12-13 14:01:56.000000000 +0000
+++ ./lib/rpmtag.h 2011-05-11 13:58:33.000000000 +0000
@@ -217,14 +217,14 @@ typedef enum rpmTag_e {
RPMTAG_PRETRANSPROG = 1153, /* s */
RPMTAG_POSTTRANSPROG = 1154, /* s */
RPMTAG_DISTTAG = 1155, /* s */
@ -225,49 +223,48 @@ Needs extcond.diff for query operations.
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) */
--- ./lib/rpmtd.h.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./lib/rpmtd.h 2011-05-11 14:00:06.000000000 +0000
@@ -220,6 +220,7 @@ typedef enum rpmtdFormats_e {
RPMTD_FORMAT_VFLAGS = 17, /* file verify flags (int types) */
+ RPMTD_FORMAT_DEPFLAG_STRONG = 18, /* strong dependency */
RPMTD_FORMAT_EXPAND = 18, /* macro expansion (string types) */
RPMTD_FORMAT_FSTATUS = 19, /* file verify status (int types) */
+ RPMTD_FORMAT_DEPFLAG_STRONG = 20, /* strong dependency (int types) */
} 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)
--- ./python/rpmmodule.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./python/rpmmodule.c 2011-05-11 14:19:37.000000000 +0000
@@ -376,6 +376,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
--- ./rpmpopt.in.orig 2011-01-11 07:04:51.000000000 +0000
+++ ./rpmpopt.in 2011-05-11 14:18: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 \
+rpm alias --suggests --qf \
+ "[%|SUGGESTSFLAGS:depflag_strong?{}:{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package suggests"
+
+rpm alias --recommends --qf \
+rpm alias --recommends --qf \
+ "[%|SUGGESTSFLAGS:depflag_strong?{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package recommends"
+
+rpm alias --enhances --qf \
+rpm alias --enhances --qf \
+ "[%|ENHANCESFLAGS:depflag_strong?{}:{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package enhances"
+
+rpm alias --supplements --qf \
+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\
rpm alias --info --qf '\
Name : %{NAME}\n\
%|EPOCH?{Epoch : %{EPOCH}\n}|\

View File

@ -1,8 +1,6 @@
Index: doc/rpm.8
===================================================================
--- doc/rpm.8.orig
+++ doc/rpm.8
@@ -572,6 +572,11 @@ Query all packages that provide the \fIC
--- ./doc/rpm.8.orig 2011-01-05 08:11:09.000000000 +0000
+++ ./doc/rpm.8 2011-05-11 15:36:18.000000000 +0000
@@ -564,6 +564,11 @@ Query all packages that provide the \fIC
.TP
\fB--whatrequires \fICAPABILITY\fB\fR
Query all packages that require \fICAPABILITY\fR for proper functioning.