Compare commits

...

11 Commits
master ... f7

Author SHA1 Message Date
Fedora Release Engineering 78b53b146d dist-git conversion 2010-07-29 11:36:12 +00:00
Panu Matilainen 01324eb886 - remember to bump popt version too .. SIGH 2007-10-12 07:27:31 +00:00
Panu Matilainen aa06ebf47f Update sources.. 2007-10-12 06:15:46 +00:00
Panu Matilainen 2ff6cda16a - improved matchpathcon patch (#259421) 2007-10-12 06:14:08 +00:00
Panu Matilainen 259de268e1 - rebase to 4.4.2.2
- remove no longer needed spec hacks eVS:
    ----------------------------------------------------------------------
2007-10-03 14:05:53 +00:00
Panu Matilainen 202a76e2c8 - further license clarification per fedora guidelines 2007-10-03 13:50:15 +00:00
Panu Matilainen e403a61579 - pull in updated config.guess to get _host macro correct (#259761)
- explicitly buildrequire redhat-rpm-config for the config.guess hack
2007-10-03 13:42:32 +00:00
Panu Matilainen db9aa25ce0 - add bunch of previously implicit dependencies for rpm-build (#316201) 2007-10-03 13:10:12 +00:00
Panu Matilainen 1f37ba6cfb - remember to add new patches... 2007-08-13 07:12:46 +00:00
Panu Matilainen 712c6d85a1 - rebase to rpm-4.4.2.1 + selected patches from rawhide
- remove now unnecessary patches + sources
2007-08-13 07:07:33 +00:00
Bill Nottingham fd6b0f5227 Initialize branch F-7 for rpm 2007-05-18 09:34:48 +00:00
57 changed files with 834 additions and 3791 deletions

View File

@ -1,3 +0,0 @@
rpm-4.3.3.tar.gz
rpm-4.4.1.tar.gz
rpm-4.4.2.tar.gz

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
rpm-4.4.2.2.tar.gz

View File

@ -1,6 +0,0 @@
# Makefile for source rpm: rpm
# $Id$
NAME := rpm
SPECFILE = $(firstword $(wildcard *.spec))
include ../common/Makefile.common

View File

@ -1,42 +0,0 @@
#!/bin/bash
#
# mono-find-provides
#
# Authors:
# Ben Maurer (bmaurer@ximian.com)
#
# (C) 2005 Novell (http://www.novell.com)
#
# Args: builddir buildroot libdir
IFS=$'\n'
filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
# If monodis is in the package being installed, use that one
# This is to support building mono
build_bindir="$2/usr/bin"
build_libdir="$2$3"
if [ -x $build_bindir/monodis ]; then
monodis="$build_bindir/monodis"
export LD_LIBRARY_PATH=$build_libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
elif [ -x /usr/bin/monodis ]; then
monodis="/usr/bin/monodis"
else
exit 0;
fi
export MONO_SHARED_DIR=$1
for i in "${monolist[@]}"; do
($monodis --assembly $i | awk '
BEGIN { LIBNAME=""; VERSION=""; }
/^Version:/ { VERSION=$2 }
/^Name:/ { LIBNAME=$2 }
END {
if (VERSION && LIBNAME)
print "mono(" LIBNAME ") = " VERSION
}
') 2>/dev/null
done

View File

@ -1,86 +0,0 @@
#!/bin/bash
#
# mono-find-requires
#
# Authors:
# Ben Maurer (bmaurer@ximian.com)
#
# (C) 2005 Novell (http://www.novell.com)
#
# Args: builddir buildroot libdir
IFS=$'\n'
filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
# If monodis is in the package being installed, use that one
# This is to support building mono
build_bindir="$2/usr/bin"
build_libdir="$2$3"
if [ -x $build_bindir/monodis ]; then
monodis="$build_bindir/monodis"
export LD_LIBRARY_PATH=$build_libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
elif [ -x /usr/bin/monodis ]; then
monodis="/usr/bin/monodis"
else
exit 0;
fi
export MONO_SHARED_DIR=$1
REQUIRES=$(
for i in "${monolist[@]}"; do
($monodis --assemblyref $i | awk '
BEGIN { START=0; LIBNAME=""; VERSION=""; }
(START==0) && /^[0-9]+: Version=/ {
START=1;
sub(/Version=/, "", $2);
VERSION=$2
}
(START==1) && /^\tName=/ {
sub(/Name=/, "", $1);
LIBNAME=$1
print "mono(" LIBNAME ") = " VERSION
START=0
}
') 2> /dev/null
done
)
PROVIDES=$(
for i in "${monolist[@]}"; do
($monodis --assembly $i | awk '
BEGIN { LIBNAME=""; VERSION=""; }
/^Version:/ { VERSION=$2 }
/^Name:/ { LIBNAME=$2 }
END {
if (VERSION && LIBNAME)
print "mono(" LIBNAME ") = " VERSION
}
') 2>/dev/null
done
)
#
# This is a little magic trick to get all REQUIRES that are not
# in PROVIDES. While RPM functions correctly when such deps exist,
# they make the metadata a bit bloated.
#
# Filter out dups from both lists
REQUIRES=$(echo "$REQUIRES" | sort | uniq)
PROVIDES=$(echo "$PROVIDES" | sort | uniq)
#
# Get a list of elements that exist in exactly one of PROVIDES or REQUIRES
#
UNIQ=$(echo "$PROVIDES
$REQUIRES" | sort | uniq -u)
#
# Of those, only chose the ones that are in REQUIRES
#
echo "$UNIQ
$REQUIRES" | sort | uniq -d

View File

@ -1,12 +0,0 @@
--- rpm-4.4.1/lib/poptI.c.conflicts 2005-03-21 10:19:45.000000000 +0000
+++ rpm-4.4.1/lib/poptI.c 2005-03-21 10:19:52.000000000 +0000
@@ -16,8 +16,7 @@
/*@unchecked@*/
struct rpmInstallArguments_s rpmIArgs = {
0, /* transFlags */
- /* probFilter */
- (RPMPROB_FILTER_REPLACEOLDFILES | RPMPROB_FILTER_REPLACENEWFILES),
+ 0, /* probFilter */
0, /* installInterfaceFlags */
0, /* eraseInterfaceFlags */
0, /* qva_flags */

View File

@ -1,13 +0,0 @@
--- rpm-4.4.1/macros.in.fedora 2005-03-07 11:37:37.000000000 -0500
+++ rpm-4.4.1/macros.in 2005-03-07 11:37:48.000000000 -0500
@@ -658,8 +658,8 @@
# Horowitz Key Protocol server configuration
#
-%_hkp_keyserver hkp://pgp.mit.edu
-%_hkp_keyserver_query %{_hkp_keyserver}/pks/lookup?op=get&search=0x
+#%_hkp_keyserver hkp://pgp.mit.edu
+#%_hkp_keyserver_query %{_hkp_keyserver}/pks/lookup?op=get&search=0x
#==============================================================================
# ---- Transaction macros.

View File

@ -1,48 +0,0 @@
--- rpm-4.4.1/build/rpmfc.c.noconfig 2005-04-26 11:59:59.000000000 +0200
+++ rpm-4.4.1/build/rpmfc.c 2005-04-26 12:02:31.000000000 +0200
@@ -1511,11 +1511,13 @@
fi = rpmfiInit(fi, 0);
if (fi != NULL)
while ((c = rpmfiNext(fi)) >= 0) {
+#ifdef RPM_WITH_CONFIG_DEPENDENCY
rpmfileAttrs fileAttrs;
/* Does package have any %config files? */
fileAttrs = rpmfiFFlags(fi);
genConfigDeps |= (fileAttrs & RPMFILE_CONFIG);
+#endif
av[c] = xstrdup(rpmfiFN(fi));
}
@@ -1537,6 +1539,7 @@
xx = headerRemoveEntry(pkg->header, RPMTAG_PROVIDEVERSION);
xx = headerRemoveEntry(pkg->header, RPMTAG_PROVIDEFLAGS);
+#ifdef RPM_WITH_CONFIG_DEPENDENCY
/* Add config dependency, Provides: config(N) = EVR */
if (genConfigDeps) {
N = rpmdsN(pkg->ds);
@@ -1549,6 +1552,7 @@
xx = rpmdsMerge(&fc->provides, ds);
ds = rpmdsFree(ds);
}
+#endif
}
if (!fc->skipReq) {
@@ -1559,6 +1563,7 @@
xx = headerRemoveEntry(pkg->header, RPMTAG_REQUIREVERSION);
xx = headerRemoveEntry(pkg->header, RPMTAG_REQUIREFLAGS);
+#ifdef RPM_WITH_CONFIG_DEPENDENCY
/* Add config dependency, Requires: config(N) = EVR */
if (genConfigDeps) {
N = rpmdsN(pkg->ds);
@@ -1571,6 +1576,7 @@
xx = rpmdsMerge(&fc->requires, ds);
ds = rpmdsFree(ds);
}
+#endif
}
/* Build file class dictionary. */

View File

@ -1,11 +0,0 @@
--- rpm-4.4.1/lib/rpmal.c~ 2005-04-26 16:29:57.000000000 -0400
+++ rpm-4.4.1/lib/rpmal.c 2005-04-27 00:01:59.000000000 -0400
@@ -744,7 +744,7 @@
/*@-branchstate@*/ /* FIX: ret is a problem */
for (found = 0, ret = NULL;
- die <= al->dirs + al->numDirs && dieCompare(die, dieNeedle) == 0;
+ die < al->dirs + al->numDirs && dieCompare(die, dieNeedle) == 0;
die++)
{

View File

@ -1,17 +0,0 @@
--- rpm-4.4.1/lib/rpminstall.c.ordererase 2004-11-28 20:52:43.000000000 +0000
+++ rpm-4.4.1/lib/rpminstall.c 2005-04-27 15:56:11.000000000 +0100
@@ -835,14 +835,12 @@
ps = rpmpsFree(ps);
}
-#ifdef NOTYET
if (!stopUninstall && !(ia->installInterfaceFlags & INSTALL_NOORDER)) {
if (rpmtsOrder(ts)) {
numFailed += numPackages;
stopUninstall = 1;
}
}
-#endif
if (!stopUninstall) {
(void) rpmtsSetFlags(ts, (rpmtsFlags(ts) | RPMTRANS_FLAG_REVERSE));

View File

@ -1,19 +0,0 @@
--- rpm-4.4.1/lib/depends.c.prepostun 2004-12-07 14:09:16.000000000 +0000
+++ rpm-4.4.1/lib/depends.c 2005-04-26 14:12:23.000000000 +0100
@@ -1294,14 +1294,12 @@
switch (rpmteType(p)) {
case TR_REMOVED:
/* Skip if not %preun/%postun requires or legacy prereq. */
- if (isInstallPreReq(Flags)
- || !( isErasePreReq(Flags) || isLegacyPreReq(Flags) ) )
+ if (!( isErasePreReq(Flags) || isLegacyPreReq(Flags) ) )
/*@innercontinue@*/ continue;
/*@switchbreak@*/ break;
case TR_ADDED:
/* Skip if not %pre/%post requires or legacy prereq. */
- if (isErasePreReq(Flags)
- || !( isInstallPreReq(Flags) || isLegacyPreReq(Flags) ) )
+ if (!( isInstallPreReq(Flags) || isLegacyPreReq(Flags) ) )
/*@innercontinue@*/ continue;
/*@switchbreak@*/ break;
}

View File

@ -1,22 +0,0 @@
--- rpm-4.4.2/gendiff.cdiff 2002-07-13 20:54:36.000000000 +0100
+++ rpm-4.4.2/gendiff 2007-04-16 12:48:09.000000000 +0100
@@ -6,14 +6,16 @@
exit 1
}
+: ${DIFF:=diff -p}
+
find $1 \( -name "*$2" -o -name ".*$2" \) -print |
while read f; do
U=-u
[ "`basename $f`" = "ChangeLog$2" ] && U=-U0
-# diff ${U} $f `echo $f | sed s/$2\$//`
+# ${DIFF} ${U} $f `echo $f | sed s/$2\$//`
if [ -r "$f" ]; then
- diff ${U} "${f}" "${f%$2}"
+ ${DIFF} ${U} "${f}" "${f%$2}"
else
- diff ${U} /dev/null "${f%$2}"
+ ${DIFF} ${U} /dev/null "${f%$2}"
fi
done

View File

@ -1,37 +0,0 @@
--- rpm-4.4.2/lib/verify.c.contextverify 2005-09-22 13:24:09.000000000 -0400
+++ rpm-4.4.2/lib/verify.c 2005-09-22 13:38:17.000000000 -0400
@@ -122,24 +122,29 @@
*/
/*@-branchstate@*/
if (selinuxEnabled == 1 && (flags & RPMVERIFY_CONTEXTS)) {
- security_context_t con;
+ security_context_t con = NULL;
rc = lgetfilecon(fn, &con);
if (rc == -1)
*res |= (RPMVERIFY_LGETFILECONFAIL|RPMVERIFY_CONTEXTS);
else {
- security_context_t fcontext;
+ security_context_t fcontext = NULL;
/* Get file security context from patterns. */
if (matchpathcon(fn,fmode,&fcontext) != 0) {
/* Get file security context from package. */
- fcontext = rpmfiFContext(fi);
+ char * ficontext = NULL;
+ ficontext = rpmfiFContext(fi);
+ fcontext = xmalloc(sizeof(ficontext));
+ strncpy(fcontext, ficontext, sizeof(ficontext));
}
if (fcontext == NULL || strcmp(fcontext, con))
*res |= RPMVERIFY_CONTEXTS;
- freecon(con);
- freecon(fcontext);
+ if (con != NULL)
+ freecon(con);
+ if (fcontext != NULL)
+ freecon(fcontext);
}
}

View File

@ -1,9 +0,0 @@
--- rpm-4.4.2/scripts/rpm.daily.cronpath 2005-12-01 11:58:28.000000000 -0500
+++ rpm-4.4.2/scripts/rpm.daily 2005-12-01 11:58:46.000000000 -0500
@@ -1,4 +1,4 @@
#!/bin/sh
-rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' 2>&1 \
- | sort > /var/log/rpmpkgs
+/bin/rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' 2>&1 \
+ | /bin/sort > /var/log/rpmpkgs

View File

@ -1,11 +0,0 @@
--- rpm-4.4.2/db3/configure.param 2003-12-27 11:02:18.000000000 -0500
+++ rpm-4.4.2/db3/configure 2005-08-26 10:08:48.000000000 -0400
@@ -8,7 +8,7 @@
rm -f config.cache
# XXX edit CFLAGS= ... out of invocation args ???
-ARGS="`echo $* | sed -e 's% [^ ]*CFLAGS=[^ ]*%%' -e 's% -[^-][^ ]*%%g' -e 's%--cache-file=.*$%%'`"
+ARGS="`echo $* | sed -e 's% [^ ]*CFLAGS=[^ ]*%%' -e 's% -[^-][^ ]*%%g' -e 's% --param=[^ ]*%%g' -e 's%--cache-file=.*$%%'`"
CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure $ARGS \
--enable-shared --enable-static --enable-rpc \

View File

@ -1,63 +0,0 @@
--- tools/debugedit.c.jj 2007-03-14 14:11:04.000000000 +0100
+++ tools/debugedit.c 2007-03-14 15:39:34.000000000 +0100
@@ -372,38 +372,43 @@ canonicalize_path (const char *s, char *
if (s[0] == '.' && (s[1] == 0 || IS_DIR_SEPARATOR (s[1])))
{
s ++;
- if (*s)
- s++;
- else if (d > droot)
+ if (!*s && d > droot)
d--;
}
else if (s[0] == '.' && s[1] == '.'
&& (s[2] == 0 || IS_DIR_SEPARATOR (s[2])))
{
- char *pre = d-1; /* includes slash */
+ char *pre = d - 1; /* includes slash */
while (droot < pre && IS_DIR_SEPARATOR (*pre))
pre--;
if (droot <= pre && ! IS_DIR_SEPARATOR (*pre))
{
- d = pre;
- while (droot < d && ! IS_DIR_SEPARATOR (*d))
- d--;
- /* d now points to the slash */
- if (droot < d)
- d++;
- s += 2;
- if (*s)
- s++;
- else if (d > droot)
- d--;
+ while (droot < pre && ! IS_DIR_SEPARATOR (*pre))
+ pre--;
+ /* pre now points to the slash */
+ if (droot < pre)
+ pre++;
+ if (pre + 3 == d && pre[0] == '.' && pre[1] == '.')
+ {
+ *d++ = *s++;
+ *d++ = *s++;
+ }
+ else
+ {
+ d = pre;
+ s += 2;
+ if (*s)
+ while (IS_DIR_SEPARATOR (*s))
+ s++;
+ else if (d > droot)
+ d--;
+ }
}
else
{
*d++ = *s++;
*d++ = *s++;
- if (*s)
- *d++ = *s++;
}
}

View File

@ -1,11 +0,0 @@
--- tools/debugedit.c 20 May 2004 21:30:00 -0000 2.8
+++ tools/debugedit.c 19 Jul 2006 19:17:49 -0000
@@ -1034,7 +1034,7 @@ edit_dwarf2 (DSO *dso)
break;
case EM_PPC:
case EM_PPC64:
- if (rtype != R_PPC_ADDR32 || rtype != R_PPC_UADDR32)
+ if (rtype != R_PPC_ADDR32 && rtype != R_PPC_UADDR32)
goto fail;
break;
case EM_S390:

View File

@ -1,89 +0,0 @@
--- rpm-4.4.2/tools/debugedit.c.dbgopt 2006-10-31 09:29:53.000000000 +0000
+++ rpm-4.4.2/tools/debugedit.c 2006-10-31 09:29:59.000000000 +0000
@@ -724,37 +724,57 @@
}
}
- if (t->attr[i].attr == DW_AT_comp_dir) {
- if (form == DW_FORM_strp &&
- debug_sections[DEBUG_STR].data)
- {
- char *dir;
-
- dir = debug_sections[DEBUG_STR].data
- + do_read_32_relocated (ptr);
- free (comp_dir);
- comp_dir = strdup (dir);
+ if (t->attr[i].attr == DW_AT_comp_dir)
+ {
+ if ( form == DW_FORM_string )
+ {
+ free (comp_dir);
+ comp_dir = strdup (ptr);
+
+ if (phase == 1 && dest_dir && has_prefix (ptr, base_dir))
+ {
+ base_len = strlen (base_dir);
+ dest_len = strlen (dest_dir);
+
+ memcpy (ptr, dest_dir, dest_len);
+ if (dest_len < base_len)
+ {
+ memset(ptr + dest_len, '/',
+ base_len - dest_len);
+
+ }
+ elf_flagdata (debug_sections[DEBUG_INFO].elf_data,
+ ELF_C_SET, ELF_F_DIRTY);
+ }
+ }
+
+ else if (form == DW_FORM_strp &&
+ debug_sections[DEBUG_STR].data)
+ {
+ char *dir;
- if (phase == 1 && dest_dir && has_prefix (dir, base_dir))
- {
- base_len = strlen (base_dir);
- dest_len = strlen (dest_dir);
+ dir = debug_sections[DEBUG_STR].data
+ + do_read_32_relocated (ptr);
+
+ free (comp_dir);
+ comp_dir = strdup (dir);
+
+ if (phase == 1 && dest_dir && has_prefix (dir, base_dir))
+ {
+ base_len = strlen (base_dir);
+ dest_len = strlen (dest_dir);
- memcpy (dir, dest_dir, dest_len);
- if (dest_len < base_len)
- {
- memmove (dir + dest_len, dir + base_len,
- strlen (dir + base_len) + 1);
- }
- elf_flagdata (debug_sections[DEBUG_STR].elf_data,
- ELF_C_SET, ELF_F_DIRTY);
- }
- }
- else if (form == DW_FORM_string) {
- free(comp_dir);
- comp_dir = strdup (ptr);
- }
- }
+ memcpy (dir, dest_dir, dest_len);
+ if (dest_len < base_len)
+ {
+ memmove (dir + dest_len, dir + base_len,
+ strlen (dir + base_len) + 1);
+ }
+ elf_flagdata (debug_sections[DEBUG_STR].elf_data,
+ ELF_C_SET, ELF_F_DIRTY);
+ }
+ }
+ }
else if ((t->tag == DW_TAG_compile_unit
|| t->tag == DW_TAG_partial_unit)
&& t->attr[i].attr == DW_AT_name

View File

@ -1,117 +0,0 @@
--- rpm-4.4.2/scripts/find-debuginfo.sh.dbgpaths 2005-07-14 16:52:31.000000000 +0100
+++ rpm-4.4.2/scripts/find-debuginfo.sh 2006-09-07 11:27:08.000000000 +0100
@@ -13,6 +13,11 @@
echo -n > $SOURCEFILE
+strip_to_debug()
+{
+ eu-strip --remove-comment -f "$1" "$2" || :
+}
+
# Strip ELF binaries
for f in `find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p'`
@@ -35,16 +40,16 @@
mkdir -p "${debugdn}"
if test -w "$f"; then
- eu-strip -f "${debugfn}" "$f" || :
+ strip_to_debug "${debugfn}" "$f"
else
chmod u+w "$f"
- eu-strip -f "${debugfn}" "$f" || :
+ strip_to_debug "${debugfn}" "$f"
chmod u-w "$f"
fi
done
mkdir -p ${RPM_BUILD_ROOT}/usr/src/debug
-cat $SOURCEFILE | (cd $RPM_BUILD_DIR; LANG=C sort -z -u | cpio -pd0m ${RPM_BUILD_ROOT}/usr/src/debug)
+cat $SOURCEFILE | (cd $RPM_BUILD_DIR; LANG=C sort -z -u | cpio -pd0mL ${RPM_BUILD_ROOT}/usr/src/debug)
# stupid cpio creates new directories in mode 0700, fixup
find ${RPM_BUILD_ROOT}/usr/src/debug -type d -print0 | xargs -0 chmod a+rx
--- rpm-4.4.2/tools/debugedit.c.dbgpaths 2006-09-07 11:21:33.000000000 +0100
+++ rpm-4.4.2/tools/debugedit.c 2006-09-07 11:26:56.000000000 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003 Red Hat, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2005 Red Hat, Inc.
Written by Alexander Larsson <alexl@redhat.com>, 2002
Based on code by Jakub Jelinek <jakub@redhat.com>, 2001.
@@ -343,13 +343,11 @@
#define IS_DIR_SEPARATOR(c) ((c)=='/')
static char *
-canonicalize_path (char *s, char *d)
+canonicalize_path (const char *s, char *d)
{
char *rv = d;
- char *sroot, *droot;
-
- if (d == 0)
- rv = d = s;
+ const char *sroot;
+ char *droot;
if (IS_DIR_SEPARATOR (*s))
{
@@ -600,6 +598,7 @@
unsigned char *srcptr, *buf = NULL;
size_t base_len = strlen (base_dir);
size_t dest_len = strlen (dest_dir);
+ size_t shrank = 0;
if (dest_len == base_len)
abs_file_cnt = 0;
@@ -611,27 +610,40 @@
}
else
ptr = srcptr = dir;
+ unsigned char *srcstart=srcptr;
while (*srcptr != 0)
{
size_t len = strlen (srcptr) + 1;
+ const unsigned char *readptr = srcptr;
if (*srcptr == '/' && has_prefix (srcptr, base_dir))
{
- memcpy (ptr, dest_dir, dest_len);
if (dest_len < base_len)
- {
- memmove (ptr + dest_len, srcptr + base_len,
- len - base_len);
- ptr += dest_len - base_len;
++abs_dir_cnt;
+ memcpy (ptr, dest_dir, dest_len);
+ ptr += dest_len;
+ readptr += base_len;
}
+ srcptr += len;
+
+ shrank += srcptr - readptr;
+ canonicalize_path (readptr, ptr);
+ len = strlen (ptr) + 1;
+ shrank -= len;
+ ptr += len;
+
elf_flagdata (debug_sections[DEBUG_STR].elf_data,
ELF_C_SET, ELF_F_DIRTY);
}
- else if (ptr != srcptr)
- memmove (ptr, srcptr, len);
- srcptr += len;
- ptr += len;
+
+ if (shrank > 0)
+ {
+ if (--shrank == 0)
+ error (EXIT_FAILURE, 0,
+ "canonicalization unexpectedly shrank by one character");
+ memset (ptr, 'X', shrank);
+ ptr += shrank;
+ *ptr++ = '\0';
}
if (abs_dir_cnt + abs_file_cnt != 0)

View File

@ -1,11 +0,0 @@
--- rpm-4.4.2/build/files.c.docflags 2007-04-16 16:15:42.000000000 +0100
+++ rpm-4.4.2/build/files.c 2007-04-16 16:16:24.000000000 +0100
@@ -2124,7 +2124,7 @@
fl.isDir = 0;
fl.inFtw = 0;
fl.currentFlags = 0;
- fl.currentVerifyFlags = 0;
+ fl.currentVerifyFlags = fl.defVerifyFlags;
fl.noGlob = 0;
fl.devtype = 0;

View File

@ -1,10 +0,0 @@
--- rpm-4.4.2/Doxyfile.in.doxy 2006-04-12 14:36:03.000000000 -0400
+++ rpm-4.4.2/Doxyfile.in 2006-04-12 14:36:15.000000000 -0400
@@ -599,7 +599,6 @@
@top_srcdir@/python/rpmte-py.h \
@top_srcdir@/python/rpmts-py.c \
@top_srcdir@/python/rpmts-py.h \
- @top_srcdir@/tools/dump.c \
@top_srcdir@/tools/dumpdb.c \
@top_srcdir@/tools/javadeps.c \
@top_srcdir@/tools/rpmcache.c \

View File

@ -1,60 +0,0 @@
--- rpm-4.4.2/rpmdb/fprint.h.exclude 2003-05-08 16:39:31.000000000 -0400
+++ rpm-4.4.2/rpmdb/fprint.h 2005-11-29 11:40:29.000000000 -0500
@@ -79,6 +79,12 @@
/*@modifies db, *matchList, rpmGlobalMacroContext,
fileSystem, internalState @*/;
+int rpmdbFindFpListExclude(/*@null@*/ rpmdb db, fingerPrint * fpList,
+ /*@out@*/ dbiIndexSet * matchList, int numItems, unsigned int exclude)
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies db, *matchList, rpmGlobalMacroContext,
+ fileSystem, internalState @*/;
+
/* Be carefull with the memory... assert(*fullName == '/' || !scareMemory) */
/**
--- rpm-4.4.2/rpmdb/rpmdb.c.exclude 2005-02-15 22:18:19.000000000 -0500
+++ rpm-4.4.2/rpmdb/rpmdb.c 2005-11-29 11:47:10.000000000 -0500
@@ -3388,11 +3388,17 @@
return 0;
}
-/* XXX transaction.c */
-/*@-compmempass@*/
int rpmdbFindFpList(rpmdb db, fingerPrint * fpList, dbiIndexSet * matchList,
int numItems)
{
+ return rpmdbFindFpListExclude(db, fpList, matchList, numItems, 0);
+}
+
+/* XXX transaction.c */
+/*@-compmempass@*/
+int rpmdbFindFpListExclude(rpmdb db, fingerPrint * fpList, dbiIndexSet * matchList,
+ int numItems, unsigned int exclude)
+{
DBT * key;
DBT * data;
HGE_t hge = (HGE_t)headerGetEntryMinMemory;
@@ -3424,7 +3430,10 @@
key->size = strlen((char *)key->data);
if (key->size == 0) key->size++; /* XXX "/" fixup. */
- if (skipDir(fpList[i].entry->dirName))
+ /* HACK HACK HACK: don't skip dirs while removing
+ * packages as we will loose files on conflicts.
+ * exclude is not zero when removing */
+ if (!exclude && skipDir(fpList[i].entry->dirName))
continue;
xx = rpmdbGrowIterator(mi, i);
--- rpm-4.4.2/lib/transaction.c.exclude 2005-11-29 11:40:29.000000000 -0500
+++ rpm-4.4.2/lib/transaction.c 2005-11-29 11:40:29.000000000 -0500
@@ -1750,7 +1750,7 @@
(void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0);
/* Extract file info for all files in this package from the database. */
matches = xcalloc(fc, sizeof(*matches));
- if (rpmdbFindFpList(rpmtsGetRdb(ts), fi->fps, matches, fc)) {
+ if (rpmdbFindFpListExclude(rpmtsGetRdb(ts), fi->fps, matches, fc, rpmteType(p) == TR_REMOVED ? fi->record : 0)) {
ps = rpmpsFree(ps);
rpmtsFreeLock(lock);
return 1; /* XXX WTFO? */

View File

@ -1,11 +0,0 @@
--- rpm-4.4.2/build/files.c.excludedsize 2005-11-29 16:21:12.000000000 -0500
+++ rpm-4.4.2/build/files.c 2005-11-29 16:21:21.000000000 -0500
@@ -1678,7 +1678,7 @@
} else
i = fl->fileListRecsUsed;
- if (S_ISREG(flp->fl_mode) && i >= fl->fileListRecsUsed)
+ if (!(flp->flags & RPMFILE_EXCLUDE) && S_ISREG(flp->fl_mode) && i >= fl->fileListRecsUsed)
fl->totalFileSize += flp->fl_size;
}

View File

@ -1,290 +0,0 @@
--- rpm-4.4.2/file/src/softmagic.c 2005-07-16 19:14:21.000000000 -0400
+++ rpm/file/src/softmagic.c 2005-11-15 19:06:51.000000000 -0500
@@ -1,3 +1,8 @@
+/*@-compdef@*/
+/*@-evalorder@*/
+/*@-sizeoftype@*/
+/*@-uniondef@*/
+/*@-usereleased@*/
/*
* Copyright (c) Ian F. Darwin 1986-1995.
* Software written by Ian F. Darwin and others;
@@ -39,7 +44,7 @@
#ifndef lint
-FILE_RCSID("@(#)$Id: softmagic.c,v 1.73 2005/03/06 05:58:22 christos Exp $")
+FILE_RCSID("@(#)$Id: softmagic.c,v 1.76 2005/10/17 19:04:36 christos Exp $")
#endif /* lint */
private int match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
@@ -47,10 +52,10 @@
/*@globals fileSystem @*/
/*@modifies ms, magic, fileSystem @*/;
private int mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s,
- struct magic *m, size_t nbytes, int)
+ struct magic *m, size_t nbytes, unsigned int cont_level)
/*@globals fileSystem @*/
/*@modifies ms, p, m, fileSystem @*/;
-private int mcheck(struct magic_set *ms, union VALUETYPE *p, struct magic *m)
+private int mymcheck(struct magic_set *ms, union VALUETYPE *p, struct magic *m)
/*@globals fileSystem @*/
/*@modifies ms, p, m, fileSystem @*/;
private int32_t mprint(struct magic_set *ms, union VALUETYPE *p, struct magic *m)
@@ -133,7 +138,7 @@
if (flush) {
if (magic[magindex].reln == '!') flush = 0;
} else {
- switch (mcheck(ms, &p, &magic[magindex])) {
+ switch (mymcheck(ms, &p, &magic[magindex])) {
case -1:
return -1;
case 0:
@@ -195,7 +200,7 @@
if (flush && magic[magindex].reln != '!')
goto done;
- switch (flush ? 1 : mcheck(ms, &p, &magic[magindex])) {
+ switch (flush ? 1 : mymcheck(ms, &p, &magic[magindex])) {
case -1:
return -1;
case 0:
@@ -639,25 +644,26 @@
* (starting at 1), not as bytes-from start-of-file
*/
char *b, *c, *last = NULL;
- if ((p->buf = strdup((const char *)s)) == NULL) {
+ if ((p->search.buf = strdup((const char *)s)) == NULL) {
file_oomem(ms);
return -1;
}
- for (b = p->buf; offset &&
- ((b = strchr(c = b, '\n')) || (b = strchr(c, '\r')));
+ for (b = p->search.buf; offset &&
+ ((b = strchr(c = b, '\n')) != NULL || (b = strchr(c, '\r')) != NULL);
offset--, b++) {
last = b;
if (b[0] == '\r' && b[1] == '\n') b++;
}
if (last != NULL)
*last = '\0';
+ p->search.buflen = last - p->search.buf;
return 0;
}
if (indir == 0 && (type == FILE_BESTRING16 || type == FILE_LESTRING16))
{
- const char *src = s + offset;
- const char *esrc = s + nbytes;
+ const unsigned char *src = s + offset;
+ const unsigned char *esrc = s + nbytes;
char *dst = p->s, *edst = &p->s[sizeof(p->s) - 1];
if (type == FILE_BESTRING16)
@@ -691,13 +697,14 @@
* might even cause problems
*/
if (nbytes < sizeof(*p))
- (void)memset(((char *)p) + nbytes, '\0', sizeof(*p) - nbytes);
+ (void)memset(((char *)(void *)p) + nbytes, '\0',
+ sizeof(*p) - nbytes);
return 0;
}
private int
mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s,
- struct magic *m, size_t nbytes, int cont_level)
+ struct magic *m, size_t nbytes, unsigned int cont_level)
{
uint32_t offset = m->offset;
@@ -713,7 +720,7 @@
int off = m->in_offset;
if (m->in_op & FILE_OPINDIRECT) {
const union VALUETYPE *q =
- ((const union VALUETYPE *)(s + offset + off));
+ ((const void *)(s + offset + off));
switch (m->in_type) {
case FILE_BYTE:
off = q->b;
@@ -1148,12 +1155,18 @@
}
if (m->type == FILE_SEARCH) {
- p->buf = malloc(m->mask + m->vallen);
- if (p->buf == NULL) {
+ size_t mlen = m->mask + m->vallen;
+ size_t flen = nbytes - offset;
+ if (flen < mlen)
+ mlen = flen;
+ p->search.buflen = mlen;
+ p->search.buf = malloc(mlen + 1);
+ if (p->search.buf == NULL) {
file_error(ms, errno, "Cannot allocate search buffer");
return 0;
}
- (void)memcpy(p->buf, s + offset, m->mask + m->vallen);
+ (void)memcpy(p->search.buf, s + offset, mlen);
+ p->search.buf[mlen] = '\0';
}
if (!mconvert(ms, p, m))
return 0;
@@ -1161,7 +1174,7 @@
}
private int
-mcheck(struct magic_set *ms, union VALUETYPE *p, struct magic *m)
+mymcheck(struct magic_set *ms, union VALUETYPE *p, struct magic *m)
{
uint32_t l = m->value.l;
uint32_t v;
@@ -1250,20 +1263,23 @@
regex_t rx;
char errmsg[512];
+ if (p->search.buf == NULL)
+ return 0;
+
rc = regcomp(&rx, m->value.s,
REG_EXTENDED|REG_NOSUB|REG_NEWLINE|
((m->mask & STRING_IGNORE_LOWERCASE) ? REG_ICASE : 0));
if (rc) {
- free(p->buf);
- regerror(rc, &rx, errmsg, sizeof(errmsg));
+ free(p->search.buf);
+ p->search.buf = NULL;
+ (void) regerror(rc, &rx, errmsg, sizeof(errmsg));
file_error(ms, 0, "regex error %d, (%s)", rc, errmsg);
return -1;
} else {
-/*@-immediatetrans -moduncon -noeffectuncon @*/ /* regfree annotate bogus only @*/
- rc = regexec(&rx, p->buf, 0, 0, 0);
- regfree(&rx);
-/*@=immediatetrans =moduncon =noeffectuncon @*/
- free(p->buf);
+/*@i@*/ rc = regexec(&rx, p->search.buf, 0, 0, 0);
+/*@i@*/ regfree(&rx);
+ free(p->search.buf);
+ p->search.buf = NULL;
return !rc;
}
}
@@ -1273,23 +1289,31 @@
* search for a string in a certain range
*/
unsigned char *a = (unsigned char*)m->value.s;
- unsigned char *b = (unsigned char*)p->buf;
- int len = m->vallen;
- int range = 0;
+ unsigned char *b = (unsigned char*)p->search.buf;
+ size_t len, slen = m->vallen;
+ size_t range = 0;
+ if (slen > sizeof(m->value.s))
+ slen = sizeof(m->value.s);
l = 0;
v = 0;
+ if (b == NULL)
+ return 0;
+ len = slen;
while (++range <= m->mask) {
while (len-- > 0 && (v = *b++ - *a++) == 0)
/*@innercontinue@*/ continue;
if (!v) {
- m->offset += range-1;
+ m->offset += range - 1;
/*@loopbreak@*/ break;
}
- len = m->vallen;
+ if (range + slen >= p->search.buflen)
+ /*@loopbreak@*/ break;
+ len = slen;
a = (unsigned char*)m->value.s;
- b = (unsigned char*)p->buf + range;
+ b = (unsigned char*)p->search.buf + range;
}
- free(p->buf);
+ free(p->search.buf);
+ p->search.buf = NULL;
break;
}
default:
@@ -1374,3 +1398,8 @@
return matched;
}
+/*@=usereleased@*/
+/*@=uniondef@*/
+/*@=sizeoftype@*/
+/*@=evalorder@*/
+/*@=compdef@*/
--- rpm-4.4.2/file/src/file.h 2005-07-16 19:14:21.000000000 -0400
+++ rpm/file/src/file.h 2005-11-15 19:06:51.000000000 -0500
@@ -27,7 +27,7 @@
*/
/*
* file.h - definitions for file(1) program
- * @(#)$Id: file.h,v 1.68 2005/06/25 15:52:14 christos Exp $
+ * @(#)$Id: file.h,v 1.72 2005/10/17 15:36:22 christos Exp $
*/
#ifndef __file_h__
@@ -39,6 +39,7 @@
#include <stdio.h> /* Include that here, to make sure __P gets defined */
#include <errno.h>
+#include <fcntl.h> /* For open and flags */
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
@@ -194,8 +195,11 @@
uint16_t h;
uint32_t l;
char s[MAXstring];
+ struct {
/*@relnull@*/
- char *buf;
+ char *buf;
+ size_t buflen;
+ } search;
uint8_t hs[2]; /* 2 bytes of a fixed-endian "short" */
uint8_t hl[4]; /* 4 bytes of a fixed-endian "long" */
} value; /* either number or string */
@@ -240,6 +244,7 @@
size_t len;
size_t size;
/* Printable buffer */
+/*@only@*/
char *pbuf;
size_t psize;
} o;
@@ -295,9 +300,9 @@
/*@modifies ms @*/;
protected void file_oomem(struct magic_set *ms)
/*@modifies ms @*/;
-protected void file_error(struct magic_set *ms, int, const char *, ...)
+protected void file_error(struct magic_set *ms, int, /*@null@*/ const char *, ...)
/*@modifies ms @*/;
-protected void file_magwarn(struct magic_set *ms, const char *, ...)
+protected void file_magwarn(struct magic_set *ms, /*@null@*/ const char *, ...)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
protected void file_mdump(struct magic *m)
@@ -323,10 +328,18 @@
#define strtoul(a, b, c) strtol(a, b, c)
#endif
+#if 0 /* HACK -- we have snprintf and I don't want to plumb the autofoo */
+int snprintf(char *, size_t, const char *, ...);
+#endif
+
#if defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) && !defined(QUICK)
#define QUICK
#endif
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
#define FILE_RCSID(id) \
static const char *rcsid(const char *p) { \
return rcsid(p = id); \

View File

@ -1,40 +0,0 @@
Print error message if scriptlet fork fails instead if silently
dying. [#152779]
Index: lib/psm.c
===================================================================
--- lib/psm.c.orig
+++ lib/psm.c
@@ -910,6 +910,12 @@ static rpmRC runScript(rpmpsm psm, Heade
}
/*@=branchstate@*/
+ if (psm->sq.child == (pid_t)-1) {
+ rpmError(RPMERR_FORK, _("Couldn't fork %s: %s\n"), sln, strerror(errno));
+ rc = RPMRC_FAIL;
+ goto exit;
+ }
+
(void) psmWait(psm);
/* XXX filter order dependent multilib "other" arch helper error. */
@@ -934,6 +940,7 @@ static rpmRC runScript(rpmpsm psm, Heade
}
}
+exit:
if (freePrefixes) prefixes = hfd(prefixes, ipt);
xx = Fclose(out); /* XXX dup'd STDOUT_FILENO */
Index: rpmio/rpmsq.c
===================================================================
--- rpmio/rpmsq.c.orig
+++ rpmio/rpmsq.c
@@ -407,6 +407,7 @@ fprintf(stderr, " Enable(%p): %p\n",
pid = fork();
if (pid < (pid_t) 0) { /* fork failed. */
+ sq->child = (pid_t)-1;
/*@-bounds@*/
xx = close(sq->pipes[0]);
xx = close(sq->pipes[1]);

View File

@ -1,55 +0,0 @@
--- rpm-4.4.2/build/rpmfc.c.gnuhash 2006-07-14 16:59:43.000000000 -0400
+++ rpm-4.4.2/build/rpmfc.c 2006-07-14 17:01:40.000000000 -0400
@@ -12,6 +12,11 @@
#if HAVE_GELF_H
#include <gelf.h>
+
+#if !defined(DT_GNU_HASH)
+#define DT_GNU_HASH 0x6ffffef5
+#endif
+
#endif
#include "debug.h"
@@ -879,6 +884,8 @@
int isDSO;
int gotSONAME = 0;
int gotDEBUG = 0;
+ int gotHASH = 0;
+ int gotGNUHASH = 0;
static int filter_GLIBC_PRIVATE = 0;
static int oneshot = 0;
@@ -1051,6 +1058,12 @@
default:
/*@innercontinue@*/ continue;
/*@notreached@*/ /*@switchbreak@*/ break;
+ case DT_HASH:
+ gotHASH= 1;
+ /*@innercontinue@*/ continue;
+ case DT_GNU_HASH:
+ gotGNUHASH= 1;
+ /*@innercontinue@*/ continue;
case DT_DEBUG:
gotDEBUG = 1;
/*@innercontinue@*/ continue;
@@ -1107,6 +1120,18 @@
}
/*@=branchstate =uniondef @*/
+ /* For DSOs which use the .gnu_hash section and don't have a .hash
+ * section, we need to ensure that we have a new enough glibc. */
+ if (gotGNUHASH && !gotHASH) {
+ ds = rpmdsSingle(RPMTAG_REQUIRENAME, "rtld(GNU_HASH)", "",
+ RPMSENSE_FIND_REQUIRES);
+ rpmdsMerge(&fc->requires, ds);
+ buf[0] = '\0';
+ t = buf;
+ rpmfcSaveArg(&fc->ddict, rpmfcFileDep(t, fc->ix, ds));
+ ds = rpmdsFree(ds);
+ }
+
/* For DSO's, provide the basename of the file if DT_SONAME not found. */
if (!fc->skipProv && isDSO && !gotDEBUG && !gotSONAME) {
depsp = &fc->provides;

View File

@ -1,10 +0,0 @@
--- rpm-4.4.2/installplatform.ia32e 2006-04-27 11:30:58.000000000 -0400
+++ rpm-4.4.2/installplatform 2006-04-27 11:28:37.000000000 -0400
@@ -35,6 +35,7 @@
sparc*) SUBSTS='s_sparc\(64\|v9\)_sparc_ s_sparc64_sparcv9_;s_sparc\([^v]\|$\)_sparcv9\1_ s_sparcv9_sparc64_;s_sparc\([^6]\|$\)_sparc64\1_' ;;
powerpc*|ppc*) SUBSTS='s_ppc64_ppc_ s_ppc\([^6ip]\|$\)_ppc64\1_ s_ppc\([^6ip]\|$\)_ppciseries_ s_ppc\([^6ip]\|$\)_ppcpseries_ s_ppc\([^6ip]\|$\)_ppc64iseries_ s_ppc\([^6ip]\|$\)_ppc64pseries_' ;;
s390*) SUBSTS='s_s390x_s390_ s_s390\([^x]\|$\)_s390x\1_' ;;
+ x86_64|amd64|ia32e) SUBSTS='s_x86_64_ia32e_ s_x86_64_amd64_' ;;
*) SUBSTS=y___ ;;
esac

View File

@ -1,55 +0,0 @@
--- rpm-4.4.2/macros.in.mono 2005-11-15 17:45:13.000000000 -0500
+++ rpm-4.4.2/macros.in 2005-11-15 17:45:44.000000000 -0500
@@ -438,6 +438,9 @@
%__python_provides @RPMCONFIGDIR@/pythondeps.sh --provides
%__python_requires @RPMCONFIGDIR@/pythondeps.sh --requires
+%__mono_provides @RPMCONFIGDIR@/mono-find-provides %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
+%__mono_requires @RPMCONFIGDIR@/mono-find-requires %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
+
#
# fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
# These macros are necessary only for legacy compatibility, and have moved
--- rpm-4.4.2/build/rpmfc.h.mono 2005-11-15 17:09:26.000000000 -0500
+++ rpm-4.4.2/build/rpmfc.h 2005-11-15 17:10:04.000000000 -0500
@@ -77,6 +77,7 @@
RPMFC_PYTHON = (1 << 26),
RPMFC_PHP = (1 << 27),
RPMFC_TCL = (1 << 28),
+ RPMFC_MONO = (1 << 6),
RPMFC_WHITE = (1 << 29),
RPMFC_INCLUDE = (1 << 30),
--- rpm-4.4.2/build/rpmfc.c.mono 2005-11-15 16:04:46.000000000 -0500
+++ rpm-4.4.2/build/rpmfc.c 2005-11-15 17:07:20.000000000 -0500
@@ -458,6 +458,10 @@
/* XXX "python 2.3 byte-compiled" */
{ "python ", RPMFC_PYTHON|RPMFC_INCLUDE },
+ /* XXX .NET executables and libraries. file(1) cannot differ from win32
+ * executables unfortunately :( */
+ { "PE executable", RPMFC_MONO|RPMFC_INCLUDE },
+
{ "current ar archive", RPMFC_STATIC|RPMFC_LIBRARY|RPMFC_ARCHIVE|RPMFC_INCLUDE },
{ "Zip archive data", RPMFC_COMPRESSED|RPMFC_ARCHIVE|RPMFC_INCLUDE },
@@ -731,6 +735,11 @@
#endif
xx = rpmfcHelper(fc, 'R', "python");
}
+ if (fc->fcolor->vals[fc->ix] & RPMFC_MONO) {
+ xx = rpmfcHelper(fc, 'P', "mono");
+ if (is_executable)
+ xx = rpmfcHelper(fc, 'R', "mono");
+ }
return 0;
}
@@ -1059,6 +1068,7 @@
{ rpmfcELF, RPMFC_ELF },
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL) },
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PYTHON) },
+ { rpmfcSCRIPT, RPMFC_MONO },
{ NULL, 0 }
};

View File

@ -1,979 +0,0 @@
--- rpm-4.4.2/rpmdb/legacy.h.digests 2003-05-08 16:39:31.000000000 -0400
+++ rpm-4.4.2/rpmdb/legacy.h 2006-07-05 14:18:15.000000000 -0400
@@ -18,7 +18,20 @@
#endif
/**
- * Return MD5 sum and size of a file.
+ * Return digest and size of a file.
+ * @param fn file name
+ * @retval digest address of md5sum
+ * @param asAscii return md5sum as ascii string?
+ * @retval *fsizep file size pointer (or NULL)
+ * @return 0 on success, 1 on error
+ */
+int dodigest(int digestalgo, const char * fn, /*@out@*/ unsigned char * digest,
+ int asAscii, /*@null@*/ /*@out@*/ size_t *fsizep)
+ /*@globals h_errno, fileSystem, internalState @*/
+ /*@modifies digest, *fsizep, fileSystem, internalState @*/;
+
+/**
+ * Return MD5 digest and size of a file.
* @param fn file name
* @retval digest address of md5sum
* @param asAscii return md5sum as ascii string?
--- rpm-4.4.2/rpmdb/legacy.c.digests 2006-07-05 14:18:15.000000000 -0400
+++ rpm-4.4.2/rpmdb/legacy.c 2006-07-05 14:18:15.000000000 -0400
@@ -145,12 +145,12 @@
return fdno;
}
-int domd5(const char * fn, unsigned char * digest, int asAscii, size_t *fsizep)
+int dodigest(int digestalgo, const char * fn, unsigned char * digest, int asAscii, size_t *fsizep)
{
const char * path;
urltype ut = urlPath(fn, &path);
- unsigned char * md5sum = NULL;
- size_t md5len;
+ unsigned char * dsum = NULL;
+ size_t dlen;
unsigned char buf[32*BUFSIZ];
FD_t fd;
size_t fsize = 0;
@@ -193,10 +193,10 @@
#endif
}
- ctx = rpmDigestInit(PGPHASHALGO_MD5, RPMDIGEST_NONE);
+ ctx = rpmDigestInit(digestalgo, RPMDIGEST_NONE);
if (fsize)
xx = rpmDigestUpdate(ctx, mapped, fsize);
- xx = rpmDigestFinal(ctx, (void **)&md5sum, &md5len, asAscii);
+ xx = rpmDigestFinal(ctx, (void **)&dsum, &dlen, asAscii);
if (fsize)
xx = munmap(mapped, fsize);
xx = close(fdno);
@@ -219,11 +219,11 @@
break;
}
- fdInitDigest(fd, PGPHASHALGO_MD5, 0);
+ fdInitDigest(fd, digestalgo, 0);
fsize = 0;
while ((rc = Fread(buf, sizeof(buf[0]), sizeof(buf), fd)) > 0)
fsize += rc;
- fdFiniDigest(fd, PGPHASHALGO_MD5, (void **)&md5sum, &md5len, asAscii);
+ fdFiniDigest(fd, digestalgo, (void **)&dsum, &dlen, asAscii);
if (Ferror(fd))
rc = 1;
@@ -244,13 +244,18 @@
if (fsizep)
*fsizep = fsize;
if (!rc)
- memcpy(digest, md5sum, md5len);
+ memcpy(digest, dsum, dlen);
/*@=boundswrite@*/
- md5sum = _free(md5sum);
+ dsum = _free(dsum);
return rc;
}
+int domd5(const char * fn, unsigned char * digest, int asAscii, size_t *fsizep)
+{
+ return dodigest(PGPHASHALGO_MD5, fn, digest, asAscii, fsizep);
+}
+
/*@-exportheadervar@*/
/*@unchecked@*/
int _noDirTokens = 0;
--- rpm-4.4.2/macros.in.digests 2006-07-05 14:18:15.000000000 -0400
+++ rpm-4.4.2/macros.in 2006-07-05 14:18:15.000000000 -0400
@@ -455,6 +455,17 @@
#%_fixperms %{__chmod} -Rf @FIXPERMS@
#
+#
+# Choose metadata file digest algorithm:
+# 1 MD5
+# 2 SHA1
+# 8 SHA256
+# 9 SHA384
+# 10 SHA512
+#
+# Note: choosing anything but MD5 introduces instant legacy incompatibility.
+%_build_file_digest_algo 1
+
#==============================================================================
# ---- Database configuration macros.
# Macros used to configure Berkley db parameters.
--- rpm-4.4.2/build/files.c.digests 2006-07-05 14:18:15.000000000 -0400
+++ rpm-4.4.2/build/files.c 2006-07-05 14:18:15.000000000 -0400
@@ -30,7 +30,7 @@
#include "buildio.h"
-#include "legacy.h" /* XXX domd5, expandFileList, compressFileList */
+#include "legacy.h" /* XXX dodigest, expandFileList, compressFileList */
#include "misc.h"
#include "debug.h"
@@ -1280,12 +1280,37 @@
* RPM_INT32_TYPE, &(flp->fl_gid), 1);
*/
+ { static uint_32 dalgo = 0;
+ static int oneshot = 0;
+ if (!oneshot) {
+ dalgo = rpmExpandNumeric("%{?_build_file_digest_algo}");
+ switch (dalgo) {
+ case PGPHASHALGO_MD5:
+ case PGPHASHALGO_SHA1:
+ case PGPHASHALGO_SHA256:
+ case PGPHASHALGO_SHA384:
+ case PGPHASHALGO_SHA512:
+ break;
+ case PGPHASHALGO_RIPEMD160:
+ case PGPHASHALGO_MD2:
+ case PGPHASHALGO_TIGER192:
+ case PGPHASHALGO_HAVAL_5_160:
+ default:
+ dalgo = PGPHASHALGO_MD5;
+ break;
+ }
+ oneshot++;
+ }
+
buf[0] = '\0';
if (S_ISREG(flp->fl_mode))
- (void) domd5(flp->diskURL, buf, 1, NULL);
+ (void) dodigest(dalgo, flp->diskURL, (unsigned char *)buf, 1, NULL);
s = buf;
- (void) headerAddOrAppendEntry(h, RPMTAG_FILEMD5S, RPM_STRING_ARRAY_TYPE,
+ (void) headerAddOrAppendEntry(h, RPMTAG_FILEDIGESTS, RPM_STRING_ARRAY_TYPE,
&s, 1);
+ (void) headerAddOrAppendEntry(h, RPMTAG_FILEDIGESTALGOS, RPM_INT32_TYPE,
+ &dalgo, 1);
+ }
buf[0] = '\0';
if (S_ISLNK(flp->fl_mode)) {
--- rpm-4.4.2/lib/cpio.c.digests 2003-12-25 18:00:45.000000000 -0500
+++ rpm-4.4.2/lib/cpio.c 2006-07-05 14:18:15.000000000 -0400
@@ -233,7 +233,7 @@
case CPIOERR_HDR_SIZE: s = _("Header size too big"); break;
case CPIOERR_UNKNOWN_FILETYPE: s = _("Unknown file type"); break;
case CPIOERR_MISSING_HARDLINK: s = _("Missing hard link(s)"); break;
- case CPIOERR_MD5SUM_MISMATCH: s = _("MD5 sum mismatch"); break;
+ case CPIOERR_DIGEST_MISMATCH: s = _("File digest mismatch"); break;
case CPIOERR_INTERNAL: s = _("Internal error"); break;
case CPIOERR_UNMAPPED_FILE: s = _("Archive file not in header"); break;
case CPIOERR_ENOENT: s = strerror(ENOENT); break;
--- rpm-4.4.2/lib/rpmfi.h.digests 2005-02-10 03:30:28.000000000 -0500
+++ rpm-4.4.2/lib/rpmfi.h 2006-07-05 14:18:15.000000000 -0400
@@ -45,7 +45,9 @@
const char ** dnl; /*!< Directory name(s) (from header) */
/*@only@*/ /*@relnull@*/
- const char ** fmd5s; /*!< File MD5 sum(s) (from header) */
+ const char ** fdigests; /*!< File digest(s) (from header) */
+/*@only@*/ /*@null@*/
+ uint_32 * fdigestalgos; /*!< File digest algorithm(s) (from header) */
/*@only@*/ /*@relnull@*/
const char ** flinks; /*!< File link(s) (from header) */
/*@only@*/ /*@null@*/
@@ -126,7 +128,9 @@
int_32 * odil; /*!< Original dirindex(s) (from header) */
/*@only@*/ /*@relnull@*/
- unsigned char * md5s; /*!< File md5 sums in binary. */
+ unsigned char * digests; /*!< File digest(s) in binary. */
+ uint_32 digestalgo; /*!< File digest algorithm. */
+ uint_32 digestlen; /*!< No. bytes in binary digest. */
/*@only@*/ /*@null@*/
const char * pretrans;
@@ -335,7 +339,21 @@
/*@*/;
/**
+ * Return current file (binary) digest from file info set.
+ * @param fi file info set
+ * @retval *algop digest algorithm
+ * @retval *lenp digest length (in bytes)
+ * @return current file digest, NULL on invalid
+ */
+/*@observer@*/ /*@null@*/
+extern const unsigned char * rpmfiDigest(/*@null@*/ rpmfi fi,
+ /*@out@*/ /*@null@*/ int * algop,
+ /*@out@*/ /*@null@*/ size_t * lenp)
+ /*@modifies *algop, *lenp @*/;
+
+/**
* Return current file (binary) md5 digest from file info set.
+ * @deprecated Use rpmfiDigest instead.
* @param fi file info set
* @return current file md5 digest, NULL on invalid
*/
--- rpm-4.4.2/lib/cpio.h.digests 2004-10-20 06:19:34.000000000 -0400
+++ rpm-4.4.2/lib/cpio.h 2006-07-05 14:18:15.000000000 -0400
@@ -46,7 +46,7 @@
CPIOERR_HDR_TRAILER = (24 ),
CPIOERR_UNKNOWN_FILETYPE= (25 ),
CPIOERR_MISSING_HARDLINK= (26 ),
- CPIOERR_MD5SUM_MISMATCH = (27 ),
+ CPIOERR_DIGEST_MISMATCH = (27 ),
CPIOERR_INTERNAL = (28 ),
CPIOERR_UNMAPPED_FILE = (29 ),
CPIOERR_ENOENT = (30 ),
--- rpm-4.4.2/lib/fsm.c.digests 2004-10-09 15:40:09.000000000 -0400
+++ rpm-4.4.2/lib/fsm.c 2006-07-05 14:18:15.000000000 -0400
@@ -801,14 +801,18 @@
{ rpmts ts = fsmGetTs(fsm);
/*
- * Set file md5 (if not disabled).
+ * Set file digest (if not disabled).
*/
- if (ts != NULL && !(rpmtsFlags(ts) & RPMTRANS_FLAG_NOMD5)) {
- fsm->fmd5sum = (fi->fmd5s ? fi->fmd5s[i] : NULL);
- fsm->md5sum = (fi->md5s ? (fi->md5s + (16 * i)) : NULL);
+ if (ts != NULL && !(rpmtsFlags(ts) & RPMTRANS_FLAG_NOFDIGESTS)) {
+ fsm->fdigestalgo = fi->digestalgo;
+ fsm->fdigest = (fi->fdigests ? fi->fdigests[i] : NULL);
+ fsm->digestlen = fi->digestlen;
+ fsm->digest = (fi->digests ? (fi->digests + (fsm->digestlen * i)) : NULL);
} else {
- fsm->fmd5sum = NULL;
- fsm->md5sum = NULL;
+ fsm->fdigestalgo = 0;
+ fsm->fdigest = NULL;
+ fsm->digestlen = 0;
+ fsm->digest = NULL;
}
}
@@ -823,7 +827,7 @@
*/
/*@-compdef@*/
static int expandRegular(/*@special@*/ FSM_t fsm)
- /*@uses fsm->fmd5sum, fsm->md5sum, fsm->sb, fsm->wfd @*/
+ /*@uses fsm->fdigest, fsm->digest, fsm->sb, fsm->wfd @*/
/*@globals h_errno, fileSystem, internalState @*/
/*@modifies fsm, fileSystem, internalState @*/
{
@@ -835,8 +839,8 @@
if (rc)
goto exit;
- if (st->st_size > 0 && (fsm->fmd5sum != NULL || fsm->md5sum != NULL))
- fdInitDigest(fsm->wfd, PGPHASHALGO_MD5, 0);
+ if (st->st_size > 0 && (fsm->fdigest != NULL || fsm->digest != NULL))
+ fdInitDigest(fsm->wfd, fsm->fdigestalgo, 0);
while (left) {
@@ -856,26 +860,26 @@
(void) fsmNext(fsm, FSM_NOTIFY);
}
- if (st->st_size > 0 && (fsm->fmd5sum || fsm->md5sum)) {
- void * md5sum = NULL;
- int asAscii = (fsm->md5sum == NULL ? 1 : 0);
+ if (st->st_size > 0 && (fsm->fdigest || fsm->digest)) {
+ void * digest = NULL;
+ int asAscii = (fsm->digest == NULL ? 1 : 0);
(void) Fflush(fsm->wfd);
- fdFiniDigest(fsm->wfd, PGPHASHALGO_MD5, &md5sum, NULL, asAscii);
+ fdFiniDigest(fsm->wfd, fsm->fdigestalgo, &digest, NULL, asAscii);
- if (md5sum == NULL) {
- rc = CPIOERR_MD5SUM_MISMATCH;
+ if (digest == NULL) {
+ rc = CPIOERR_DIGEST_MISMATCH;
goto exit;
}
- if (fsm->md5sum != NULL) {
- if (memcmp(md5sum, fsm->md5sum, 16))
- rc = CPIOERR_MD5SUM_MISMATCH;
+ if (fsm->digest != NULL) {
+ if (memcmp(digest, fsm->digest, fsm->digestlen))
+ rc = CPIOERR_DIGEST_MISMATCH;
} else {
- if (strcmp(md5sum, fsm->fmd5sum))
- rc = CPIOERR_MD5SUM_MISMATCH;
+ if (strcmp(digest, fsm->fdigest))
+ rc = CPIOERR_DIGEST_MISMATCH;
}
- md5sum = _free(md5sum);
+ digest = _free(digest);
}
exit:
--- rpm-4.4.2/lib/signature.c.digests 2005-06-06 19:33:08.000000000 -0400
+++ rpm-4.4.2/lib/signature.c 2006-07-05 14:18:15.000000000 -0400
@@ -817,7 +817,7 @@
case RPMSIGTAG_MD5:
pktlen = 16;
pkt = memset(alloca(pktlen), 0, pktlen);
- if (domd5(file, pkt, 0, NULL)
+ if (dodigest(PGPHASHALGO_MD5, file, pkt, 0, NULL)
|| !headerAddEntry(sigh, sigTag, RPM_BIN_TYPE, pkt, pktlen))
break;
ret = 0;
--- rpm-4.4.2/lib/poptI.c.digests 2006-07-05 14:18:15.000000000 -0400
+++ rpm-4.4.2/lib/poptI.c 2006-07-05 14:18:15.000000000 -0400
@@ -129,8 +129,8 @@
ia->noDeps = 1;
break;
- case RPMCLI_POPT_NOMD5:
- ia->transFlags |= RPMTRANS_FLAG_NOMD5;
+ case RPMCLI_POPT_NOFDIGESTS:
+ ia->transFlags |= RPMTRANS_FLAG_NOFDIGESTS;
break;
case RPMCLI_POPT_NOCONTEXTS:
@@ -248,8 +248,10 @@
&rpmIArgs.transFlags, RPMTRANS_FLAG_NODOCS,
N_("do not install documentation"), NULL},
- { "nomd5", '\0', 0, NULL, RPMCLI_POPT_NOMD5,
- N_("don't verify MD5 digest of files"), NULL },
+ { "nomd5", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOFDIGESTS,
+ N_("don't verify file digests"), NULL },
+ { "nofdigests", '\0', 0, NULL, RPMCLI_POPT_NOFDIGESTS,
+ N_("don't verify file digests"), NULL },
{ "nocontexts", '\0',0, NULL, RPMCLI_POPT_NOCONTEXTS,
N_("don't install file security contexts"), NULL},
--- rpm-4.4.2/lib/verify.c.digests 2006-07-05 14:18:15.000000000 -0400
+++ rpm-4.4.2/lib/verify.c 2006-07-05 14:18:15.000000000 -0400
@@ -11,7 +11,7 @@
#include "rpmfi.h"
#include "rpmts.h"
-#include "legacy.h" /* XXX domd5(), uidToUname(), gnameToGid */
+#include "legacy.h" /* XXX dodigest(), uidToUname(), gnameToGid */
#include "ugid.h"
#include "debug.h"
@@ -82,32 +82,32 @@
* Not all attributes of non-regular files can be verified.
*/
if (S_ISDIR(sb.st_mode))
- flags &= ~(RPMVERIFY_MD5 | RPMVERIFY_FILESIZE | RPMVERIFY_MTIME |
+ flags &= ~(RPMVERIFY_FDIGEST | RPMVERIFY_FILESIZE | RPMVERIFY_MTIME |
RPMVERIFY_LINKTO);
else if (S_ISLNK(sb.st_mode)) {
- flags &= ~(RPMVERIFY_MD5 | RPMVERIFY_FILESIZE | RPMVERIFY_MTIME |
+ flags &= ~(RPMVERIFY_FDIGEST | RPMVERIFY_FILESIZE | RPMVERIFY_MTIME |
RPMVERIFY_MODE);
#if CHOWN_FOLLOWS_SYMLINK
flags &= ~(RPMVERIFY_USER | RPMVERIFY_GROUP);
#endif
}
else if (S_ISFIFO(sb.st_mode))
- flags &= ~(RPMVERIFY_MD5 | RPMVERIFY_FILESIZE | RPMVERIFY_MTIME |
+ flags &= ~(RPMVERIFY_FDIGEST | RPMVERIFY_FILESIZE | RPMVERIFY_MTIME |
RPMVERIFY_LINKTO);
else if (S_ISCHR(sb.st_mode))
- flags &= ~(RPMVERIFY_MD5 | RPMVERIFY_FILESIZE | RPMVERIFY_MTIME |
+ flags &= ~(RPMVERIFY_FDIGEST | RPMVERIFY_FILESIZE | RPMVERIFY_MTIME |
RPMVERIFY_LINKTO);
else if (S_ISBLK(sb.st_mode))
- flags &= ~(RPMVERIFY_MD5 | RPMVERIFY_FILESIZE | RPMVERIFY_MTIME |
+ flags &= ~(RPMVERIFY_FDIGEST | RPMVERIFY_FILESIZE | RPMVERIFY_MTIME |
RPMVERIFY_LINKTO);
- else
+ else
flags &= ~(RPMVERIFY_LINKTO);
/*
* Content checks of %ghost files are meaningless.
*/
if (fileAttrs & RPMFILE_GHOST)
- flags &= ~(RPMVERIFY_MD5 | RPMVERIFY_FILESIZE | RPMVERIFY_MTIME |
+ flags &= ~(RPMVERIFY_FDIGEST | RPMVERIFY_FILESIZE | RPMVERIFY_MTIME |
RPMVERIFY_LINKTO);
/*
@@ -117,21 +117,26 @@
/*@=branchstate@*/
- if (flags & RPMVERIFY_MD5) {
- unsigned char md5sum[16];
- size_t fsize;
-
- /* XXX If --nomd5, then prelinked library sizes are not corrected. */
- rc = domd5(fn, md5sum, 0, &fsize);
- sb.st_size = fsize;
- if (rc)
- *res |= (RPMVERIFY_READFAIL|RPMVERIFY_MD5);
+ if (flags & RPMVERIFY_FDIGEST) {
+ int dalgo = 0;
+ size_t dlen = 0;
+ const unsigned char * digest = rpmfiDigest(fi, &dalgo, &dlen);
+
+ if (digest == NULL)
+ *res |= RPMVERIFY_FDIGEST;
else {
- const unsigned char * MD5 = rpmfiMD5(fi);
- if (MD5 == NULL || memcmp(md5sum, MD5, sizeof(md5sum)))
- *res |= RPMVERIFY_MD5;
+ /* XXX If --nofdigest, then prelinked library sizes fail to verify. */
+ unsigned char * fdigest = memset(alloca(dlen), 0, dlen);
+ size_t fsize;
+ rc = dodigest(dalgo, fn, fdigest, 0, &fsize);
+ sb.st_size = fsize;
+ if (rc)
+ *res |= (RPMVERIFY_READFAIL|RPMVERIFY_FDIGEST);
+ else
+ if (memcmp(fdigest, digest, dlen))
+ *res |= RPMVERIFY_FDIGEST;
}
- }
+ }
if (flags & RPMVERIFY_LINKTO) {
char linkto[1024+1];
@@ -145,12 +150,12 @@
if (flink == NULL || strcmp(linkto, flink))
*res |= RPMVERIFY_LINKTO;
}
- }
+ }
if (flags & RPMVERIFY_FILESIZE) {
if (sb.st_size != rpmfiFSize(fi))
*res |= RPMVERIFY_FILESIZE;
- }
+ }
if (flags & RPMVERIFY_MODE) {
unsigned short metamode = fmode;
@@ -158,7 +163,7 @@
/*
* Platforms (like AIX) where sizeof(unsigned short) != sizeof(mode_t)
- * need the (unsigned short) cast here.
+ * need the (unsigned short) cast here.
*/
filemode = (unsigned short)sb.st_mode;
@@ -184,7 +189,7 @@
uint_16 frdev = (rpmfiFRdev(fi) & 0xffff);
if (st_rdev != frdev)
*res |= RPMVERIFY_RDEV;
- }
+ }
}
if (flags & RPMVERIFY_MTIME) {
@@ -301,7 +306,7 @@
ec = rc;
}
} else if (verifyResult || rpmIsVerbose()) {
- const char * size, * MD5, * link, * mtime, * mode;
+ const char * size, * digest, * link, * mtime, * mode;
const char * group, * user, * rdev;
/*@observer@*/ static const char *const aok = ".";
/*@observer@*/ static const char *const unknown = "?";
@@ -317,7 +322,7 @@
((verifyResult & RPMVERIFY_READFAIL) ? unknown : \
(verifyResult & _RPMVERIFY_F) ? _C : aok)
- MD5 = _verifyfile(RPMVERIFY_MD5, "5");
+ digest = _verifyfile(RPMVERIFY_FDIGEST, "5");
size = _verify(RPMVERIFY_FILESIZE, "S");
link = _verifylink(RPMVERIFY_LINKTO, "L");
mtime = _verify(RPMVERIFY_MTIME, "T");
@@ -331,7 +336,7 @@
#undef _verify
sprintf(te, "%s%s%s%s%s%s%s%s %c %s",
- size, mode, MD5, rdev, link, user, group, mtime,
+ size, mode, digest, rdev, link, user, group, mtime,
((fileAttrs & RPMFILE_CONFIG) ? 'c' :
(fileAttrs & RPMFILE_DOC) ? 'd' :
(fileAttrs & RPMFILE_GHOST) ? 'g' :
--- rpm-4.4.2/lib/rpmfi.c.digests 2005-02-10 03:30:28.000000000 -0500
+++ rpm-4.4.2/lib/rpmfi.c 2006-07-05 14:18:15.000000000 -0400
@@ -203,17 +203,36 @@
return fstate;
}
+const unsigned char * rpmfiDigest(rpmfi fi, int * algop, size_t * lenp)
+{
+ unsigned char * digest = NULL;
+
+ if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) {
+/*@-boundsread@*/
+ if (fi->digests != NULL) {
+ digest = fi->digests + (fi->digestlen * fi->i);
+ if (algop != NULL)
+ *algop = (fi->fdigestalgos
+ ? fi->fdigestalgos[fi->i] : fi->digestalgo);
+ if (lenp != NULL)
+ *lenp = fi->digestlen;
+ }
+/*@=boundsread@*/
+ }
+ return digest;
+}
+
const unsigned char * rpmfiMD5(rpmfi fi)
{
- unsigned char * MD5 = NULL;
+ unsigned char * digest = NULL;
if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) {
/*@-boundsread@*/
- if (fi->md5s != NULL)
- MD5 = fi->md5s + (16 * fi->i);
+ if (fi->digests != NULL)
+ digest = fi->digests + (fi->digestlen * fi->i);
/*@=boundsread@*/
}
- return MD5;
+ return digest;
}
const char * rpmfiFLink(rpmfi fi)
@@ -530,12 +549,19 @@
if (blink == NULL) return -1;
return strcmp(alink, blink);
} else if (awhat == REG) {
- const unsigned char * amd5 = rpmfiMD5(afi);
- const unsigned char * bmd5 = rpmfiMD5(bfi);
- if (amd5 == bmd5) return 0;
- if (amd5 == NULL) return 1;
- if (bmd5 == NULL) return -1;
- return memcmp(amd5, bmd5, 16);
+ int aalgo = 0;
+ size_t alen = 0;
+ const unsigned char * adigest = rpmfiDigest(afi, &aalgo, &alen);
+ int balgo = 0;
+ size_t blen = 0;
+ const unsigned char * bdigest = rpmfiDigest(bfi, &balgo, &blen);
+ /* XXX W2DO? changing file digest algo may break rpmfiCompare. */
+ if (!(aalgo == balgo && alen == blen))
+ return -1;
+ if (adigest == bdigest) return 0;
+ if (adigest == NULL) return 1;
+ if (bdigest == NULL) return -1;
+ return memcmp(adigest, bdigest, alen);
}
return 0;
@@ -592,17 +618,23 @@
*/
memset(buffer, 0, sizeof(buffer));
if (dbWhat == REG) {
- const unsigned char * omd5, * nmd5;
- /* XXX avoid md5 on sparse /var/log/lastlog file. */
+ int oalgo = 0;
+ size_t olen = 0;
+ const unsigned char * odigest;
+ int nalgo = 0;
+ size_t nlen = 0;
+ const unsigned char * ndigest;
+ odigest = rpmfiDigest(ofi, &oalgo, &olen);
+ /* XXX avoid digest on sparse /var/log/lastlog file. */
if (strcmp(fn, "/var/log/lastlog"))
- if (domd5(fn, buffer, 0, NULL))
+ if (dodigest(oalgo, fn, buffer, 0, NULL))
return FA_CREATE; /* assume file has been removed */
- omd5 = rpmfiMD5(ofi);
- if (omd5 && !memcmp(omd5, buffer, 16))
+ if (odigest && !memcmp(odigest, buffer, olen))
return FA_CREATE; /* unmodified config file, replace. */
- nmd5 = rpmfiMD5(nfi);
+ ndigest = rpmfiDigest(nfi, &nalgo, &nlen);
/*@-nullpass@*/
- if (omd5 && nmd5 && !memcmp(omd5, nmd5, 16))
+ if (odigest && ndigest && oalgo == nalgo && olen == nlen
+ && !memcmp(odigest, ndigest, nlen))
return FA_SKIP; /* identical file, don't bother. */
/*@=nullpass@*/
} else /* dbWhat == LINK */ {
@@ -1123,8 +1155,8 @@
fi->flinks = hfd(fi->flinks, -1);
fi->flangs = hfd(fi->flangs, -1);
- fi->fmd5s = hfd(fi->fmd5s, -1);
- fi->md5s = _free(fi->md5s);
+ fi->fdigests = hfd(fi->fdigests, -1);
+ fi->digests = _free(fi->digests);
fi->cdict = hfd(fi->cdict, -1);
@@ -1306,27 +1338,53 @@
xx = hge(h, RPMTAG_FILELINKTOS, NULL, (void **) &fi->flinks, NULL);
xx = hge(h, RPMTAG_FILELANGS, NULL, (void **) &fi->flangs, NULL);
- fi->fmd5s = NULL;
- xx = hge(h, RPMTAG_FILEMD5S, NULL, (void **) &fi->fmd5s, NULL);
-
- fi->md5s = NULL;
- if (fi->fmd5s) {
- t = xmalloc(fi->fc * 16);
- fi->md5s = t;
+ fi->digestalgo = PGPHASHALGO_MD5;
+ fi->digestlen = 16;
+ fi->fdigestalgos = NULL;
+ xx = hge(h, RPMTAG_FILEDIGESTALGOS, NULL, (void **) &fi->fdigestalgos, NULL);
+ if (fi->fdigestalgos) {
+ int dalgo = 0;
+ /* XXX Insure that all algorithms are either 0 or constant. */
+ for (i = 0; i < fi->fc; i++) {
+ if (fi->fdigestalgos[i] == 0)
+ continue;
+ if (dalgo == 0)
+ dalgo = fi->fdigestalgos[i];
+ else
+assert(dalgo == fi->fdigestalgos[i]);
+ }
+ fi->digestalgo = dalgo;
+ switch (dalgo) {
+ case PGPHASHALGO_MD5: fi->digestlen = 128/8; break;
+ case PGPHASHALGO_SHA1: fi->digestlen = 160/8; break;
+ case PGPHASHALGO_SHA256: fi->digestlen = 256/8; break;
+ case PGPHASHALGO_SHA384: fi->digestlen = 384/8; break;
+ case PGPHASHALGO_SHA512: fi->digestlen = 512/8; break;
+ }
+ fi->fdigestalgos = NULL;
+ }
+
+ fi->fdigests = NULL;
+ xx = hge(h, RPMTAG_FILEDIGESTS, NULL, (void **) &fi->fdigests, NULL);
+
+ fi->digests = NULL;
+ if (fi->fdigests) {
+ t = xmalloc(fi->fc * fi->digestlen);
+ fi->digests = t;
for (i = 0; i < fi->fc; i++) {
- const char * fmd5;
+ const char * fdigests;
int j;
- fmd5 = fi->fmd5s[i];
- if (!(fmd5 && *fmd5 != '\0')) {
- memset(t, 0, 16);
- t += 16;
+ fdigests = fi->fdigests[i];
+ if (!(fdigests && *fdigests != '\0')) {
+ memset(t, 0, fi->digestlen);
+ t += fi->digestlen;
continue;
}
- for (j = 0; j < 16; j++, t++, fmd5 += 2)
- *t = (nibble(fmd5[0]) << 4) | nibble(fmd5[1]);
+ for (j = 0; j < fi->digestlen; j++, t++, fdigests += 2)
+ *t = (nibble(fdigests[0]) << 4) | nibble(fdigests[1]);
}
- fi->fmd5s = hfd(fi->fmd5s, -1);
+ fi->fdigests = hfd(fi->fdigests, -1);
}
/* XXX TR_REMOVED doesn;t need fmtimes, frdevs, finodes, or fcontexts */
@@ -1401,7 +1459,7 @@
/* XXX DYING */
if (fi->actions == NULL)
fi->actions = xcalloc(fi->fc, sizeof(*fi->actions));
- /*@-compdef@*/ /* FIX: fi-md5s undefined */
+ /*@-compdef@*/ /* FIX: fi->digests undefined */
foo = relocateFileList(ts, fi, h, fi->actions);
/*@=compdef@*/
fi->h = headerFree(fi->h);
--- rpm-4.4.2/lib/rpmcli.h.digests 2006-07-05 14:18:15.000000000 -0400
+++ rpm-4.4.2/lib/rpmcli.h 2006-07-05 14:18:15.000000000 -0400
@@ -83,7 +83,7 @@
*/
#define RPMCLI_POPT_NODEPS -1025
#define RPMCLI_POPT_FORCE -1026
-#define RPMCLI_POPT_NOMD5 -1027
+#define RPMCLI_POPT_NOFDIGESTS -1027
#define RPMCLI_POPT_NOSCRIPTS -1028
#define RPMCLI_POPT_NOSIGNATURE -1029
#define RPMCLI_POPT_NODIGEST -1030
@@ -111,7 +111,7 @@
RPMQV_SPECFILE, /*!< ... from spec file parse (query only). */
RPMQV_PKGID, /*!< ... from package id (header+payload MD5). */
RPMQV_HDRID, /*!< ... from header id (immutable header SHA1). */
- RPMQV_FILEID, /*!< ... from file id (file MD5). */
+ RPMQV_FILEID, /*!< ... from file id (file digest, usually MD5). */
RPMQV_TID, /*!< ... from install transaction id (time stamp). */
RPMQV_HDLIST, /*!< ... from system hdlist. */
RPMQV_FTSWALK /*!< ... from fts(3) walk. */
@@ -122,7 +122,7 @@
*/
typedef enum rpmVerifyAttrs_e {
RPMVERIFY_NONE = 0, /*!< */
- RPMVERIFY_MD5 = (1 << 0), /*!< from %verify(md5) */
+ RPMVERIFY_FDIGEST = (1 << 0), /*!< from %verify(digest) */
RPMVERIFY_FILESIZE = (1 << 1), /*!< from %verify(size) */
RPMVERIFY_LINKTO = (1 << 2), /*!< from %verify(link) */
RPMVERIFY_USER = (1 << 3), /*!< from %verify(user) */
@@ -139,6 +139,7 @@
RPMVERIFY_LSTATFAIL = (1 << 30), /*!< lstat failed */
RPMVERIFY_LGETFILECONFAIL = (1 << 31) /*!< lgetfilecon failed */
} rpmVerifyAttrs;
+#define RPMVERIFY_MD5 RPMVERIFY_FDIGEST
#define RPMVERIFY_ALL ~(RPMVERIFY_NONE)
#define RPMVERIFY_FAILURES \
(RPMVERIFY_LSTATFAIL|RPMVERIFY_READFAIL|RPMVERIFY_READLINKFAIL|RPMVERIFY_LGETFILECONFAIL)
@@ -150,7 +151,7 @@
typedef enum rpmQueryFlags_e {
/*@-enummemuse@*/
QUERY_FOR_DEFAULT = 0, /*!< */
- QUERY_MD5 = (1 << 0), /*!< from --nomd5 */
+ QUERY_FDIGEST = (1 << 0), /*!< from --nofdigest */
QUERY_SIZE = (1 << 1), /*!< from --nosize */
QUERY_LINKTO = (1 << 2), /*!< from --nolink */
QUERY_USER = (1 << 3), /*!< from --nouser) */
@@ -193,7 +194,7 @@
/*@-enummemuse@*/
VERIFY_DEFAULT = 0, /*!< */
/*@=enummemuse@*/
- VERIFY_MD5 = (1 << 0), /*!< from --nomd5 */
+ VERIFY_FDIGEST = (1 << 0), /*!< from --nofdigest */
VERIFY_SIZE = (1 << 1), /*!< from --nosize */
VERIFY_LINKTO = (1 << 2), /*!< from --nolinkto */
VERIFY_USER = (1 << 3), /*!< from --nouser */
@@ -221,7 +222,7 @@
} rpmVerifyFlags;
#define VERIFY_ATTRS \
- ( VERIFY_MD5 | VERIFY_SIZE | VERIFY_LINKTO | VERIFY_USER | VERIFY_GROUP | \
+ ( VERIFY_FDIGEST | VERIFY_SIZE | VERIFY_LINKTO | VERIFY_USER | VERIFY_GROUP | \
VERIFY_MTIME | VERIFY_MODE | VERIFY_RDEV | VERIFY_CONTEXTS )
#define VERIFY_ALL \
( VERIFY_ATTRS | VERIFY_FILES | VERIFY_DEPS | VERIFY_SCRIPT | VERIFY_DIGEST |\
@@ -404,7 +405,7 @@
fileSystem, internalState @*/;
/** \ingroup rpmcli
- * Verify file attributes (including MD5 sum).
+ * Verify file attributes (including file digest).
* @todo gnorpm and python bindings prevent this from being static.
* @param ts transaction set
* @param fi file info (with linked header and current file index)
--- rpm-4.4.2/lib/fsm.h.digests 2003-12-25 18:00:45.000000000 -0500
+++ rpm-4.4.2/lib/fsm.h 2006-07-05 14:18:15.000000000 -0400
@@ -181,14 +181,16 @@
int rc; /*!< External file stage return code. */
int commit; /*!< Commit synchronously? */
cpioMapFlags mapFlags; /*!< Bit(s) to control mapping. */
+ int fdigestalgo; /*!< Digest algorithm (~= PGPHASHALGO_MD5) */
+ int digestlen; /*!< No. of bytes in binary digest (~= 16) */
/*@shared@*/ /*@relnull@*/
const char * dirName; /*!< File directory name. */
/*@shared@*/ /*@relnull@*/
const char * baseName; /*!< File base name. */
/*@shared@*/ /*@relnull@*/
- const char * fmd5sum; /*!< Hex MD5 sum (NULL disables). */
+ const char * fdigest; /*!< Hex digest (usually MD5, NULL disables). */
/*@shared@*/ /*@relnull@*/
- const char * md5sum; /*!< Binary MD5 sum (NULL disables). */
+ const char * digest; /*!< Bin digest (usually MD5, NULL disables). */
/*@dependent@*/ /*@observer@*/ /*@null@*/
const char * fcontext; /*!< File security context (NULL disables). */
--- rpm-4.4.2/lib/poptQV.c.digests 2006-07-05 14:18:15.000000000 -0400
+++ rpm-4.4.2/lib/poptQV.c 2006-07-05 14:18:15.000000000 -0400
@@ -222,8 +222,8 @@
qva->qva_flags |= VERIFY_DEPS;
break;
- case RPMCLI_POPT_NOMD5:
- qva->qva_flags |= VERIFY_MD5;
+ case RPMCLI_POPT_NOFDIGESTS:
+ qva->qva_flags |= VERIFY_FDIGEST;
break;
case RPMCLI_POPT_NOCONTEXTS:
@@ -315,11 +315,13 @@
/* Duplicate file verify flags from packages into command line options. */
/** @todo Add --nomd5 alias to rpmpopt, eliminate. */
#ifdef DYING
- { "nomd5", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_MD5,
- N_("don't verify MD5 digest of files"), NULL },
+ { "nomd5", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_FDIGEST,
+ N_("don't verify file digests"), NULL },
#else
- { "nomd5", '\0', 0, NULL, RPMCLI_POPT_NOMD5,
- N_("don't verify MD5 digest of files"), NULL },
+ { "nomd5", '\0', POPT_ARGFLAG_DOC_HIDDEN, NULL, RPMCLI_POPT_NOFDIGESTS,
+ N_("don't verify file digests"), NULL },
+ { "nofdigests", '\0', 0, NULL, RPMCLI_POPT_NOFDIGESTS,
+ N_("don't verify file digests"), NULL },
#endif
{ "nosize", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
&rpmQVKArgs.qva_flags, VERIFY_SIZE,
--- rpm-4.4.2/lib/psm.c.digests 2005-07-13 07:13:34.000000000 -0400
+++ rpm-4.4.2/lib/psm.c 2006-07-05 14:18:15.000000000 -0400
@@ -321,9 +321,6 @@
*cookie = xstrdup(*cookie);
}
- /* XXX FIXME: can't do endian neutral MD5 verification yet. */
-/*@i@*/ fi->fmd5s = hfd(fi->fmd5s, -1);
-
/* XXX FIXME: don't do per-file mapping, force global flags. */
fi->fmapflags = _free(fi->fmapflags);
fi->mapflags = CPIO_MAP_PATH | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID;
--- rpm-4.4.2/lib/rpmlib.h.digests 2006-07-05 14:18:15.000000000 -0400
+++ rpm-4.4.2/lib/rpmlib.h 2006-07-05 14:34:53.000000000 -0400
@@ -304,7 +304,8 @@
RPMTAG_FILEGIDS = 1032, /*!< internal */
RPMTAG_FILERDEVS = 1033, /* h */
RPMTAG_FILEMTIMES = 1034, /* i */
- RPMTAG_FILEMD5S = 1035, /* s[] */
+ RPMTAG_FILEDIGESTS = 1035, /* s[] */
+#define RPMTAG_FILEMD5S RPMTAG_FILEDIGESTS /* s[] */
RPMTAG_FILELINKTOS = 1036, /* s[] */
RPMTAG_FILEFLAGS = 1037, /* i */
/*@-enummemuse@*/
@@ -447,6 +448,8 @@
RPMTAG_PRIORITY = 1162, /* i extension placeholder */
RPMTAG_CVSID = 1163, /* s */
#define RPMTAG_SVNID RPMTAG_CVSID /* s */
+ RPMTAG_FILEDIGESTALGOS = 1177, /*!< i[] */
+
/*@-enummemuse@*/
RPMTAG_FIRSTFREE_TAG /*!< internal */
@@ -997,7 +1000,7 @@
RPMTRANS_FLAG_APPLYONLY = (1 << 25),
RPMTRANS_FLAG_ANACONDA = (1 << 26), /*!< from --anaconda */
- RPMTRANS_FLAG_NOMD5 = (1 << 27), /*!< from --nomd5 */
+ RPMTRANS_FLAG_NOFDIGESTS = (1 << 27), /*!< from --nomd5 */
RPMTRANS_FLAG_NOSUGGEST = (1 << 28), /*!< from --nosuggest */
RPMTRANS_FLAG_ADDINDEPS = (1 << 29), /*!< from --aid */
RPMTRANS_FLAG_NOCONFIGS = (1 << 30), /*!< from --noconfigs */
--- rpm-4.4.2/lib/query.c.digests 2006-07-05 14:18:15.000000000 -0400
+++ rpm-4.4.2/lib/query.c 2006-07-05 14:18:15.000000000 -0400
@@ -528,7 +528,7 @@
for (i = 0, t = MD5, s = arg; i < 16; i++, t++, s += 2)
*t = (nibble(s[0]) << 4) | nibble(s[1]);
- qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_FILEMD5S, MD5, sizeof(MD5));
+ qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_FILEDIGESTS, MD5, sizeof(MD5));
if (qva->qva_mi == NULL) {
rpmError(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
"fileid", arg);
--- rpm-4.4.2/lib/transaction.c.digests 2006-07-05 14:18:15.000000000 -0400
+++ rpm-4.4.2/lib/transaction.c 2006-07-05 14:18:15.000000000 -0400
@@ -27,7 +27,7 @@
#include "cpio.h"
#include "fprint.h"
-#include "legacy.h" /* XXX domd5 */
+#include "legacy.h" /* XXX dodigest */
#include "misc.h" /* XXX stripTrailingChar, splitString, currentDirectory */
#include "debug.h"
@@ -641,14 +641,21 @@
}
/* Here is a pre-existing modified config file that needs saving. */
- /* XXX avoid md5 on sparse /var/log/lastlog file. */
+ /* XXX avoid digest on sparse /var/log/lastlog file. */
if (strcmp(fn, "/var/log/lastlog"))
- { char md5sum[50];
- const unsigned char * MD5 = rpmfiMD5(fi);
- if (!domd5(fn, md5sum, 0, NULL) && memcmp(MD5, md5sum, 16)) {
- fi->actions[i] = FA_BACKUP;
+ { int dalgo = 0;
+ size_t dlen = 0;
+ const unsigned char * digest = rpmfiDigest(fi, &dalgo, &dlen);
+ unsigned char * fdigest;
+assert(digest != NULL);
+ fdigest = xcalloc(1, dlen);
+ if (!dodigest(dalgo, fn, fdigest, 0, NULL)) {
+ if (memcmp(digest, fdigest, dlen))
+ fi->actions[i] = FA_BACKUP;
+ fdigest = _free(fdigest);
/*@switchbreak@*/ break;
}
+ fdigest = _free(fdigest);
}
fi->actions[i] = FA_ERASE;
/*@switchbreak@*/ break;
--- rpm-4.4.2/rpmio/tdigest.c.digests 2003-03-28 17:47:18.000000000 -0500
+++ rpm-4.4.2/rpmio/tdigest.c 2006-07-05 14:18:15.000000000 -0400
@@ -18,6 +18,9 @@
static struct poptOption optionsTable[] = {
{ "md5", '\0', POPT_ARG_VAL, &hashalgo, PGPHASHALGO_MD5, NULL, NULL },
{ "sha1",'\0', POPT_ARG_VAL, &hashalgo, PGPHASHALGO_SHA1, NULL, NULL },
+ { "sha256",'\0', POPT_ARG_VAL, &hashalgo, PGPHASHALGO_SHA256, NULL, NULL },
+ { "sha384",'\0', POPT_ARG_VAL, &hashalgo, PGPHASHALGO_SHA384, NULL, NULL },
+ { "sha512",'\0', POPT_ARG_VAL, &hashalgo, PGPHASHALGO_SHA512, NULL, NULL },
#ifdef DYING
{ "reverse",'\0', POPT_BIT_SET, &flags, RPMDIGEST_REVERSE, NULL, NULL },
#endif
@@ -145,6 +148,7 @@
ssize_t nb;
sdigest = NULL;
+ if (hashalgo == PGPHASHALGO_MD5 || hashalgo == PGPHASHALGO_SHA1)
{ char *se;
FILE * sfp;
--- rpm-4.4.2/rpmqv.c.digests 2006-07-05 14:35:11.000000000 -0400
+++ rpm-4.4.2/rpmqv.c 2006-07-05 14:36:10.000000000 -0400
@@ -742,7 +742,7 @@
if (!poptPeekArg(optCon)) {
if (ia->rbtid == 0)
argerror(_("no packages given for erase"));
-ia->transFlags |= RPMTRANS_FLAG_NOMD5;
+ia->transFlags |= RPMTRANS_FLAG_NOFDIGESTS;
ia->probFilter |= RPMPROB_FILTER_OLDPACKAGE;
ec += rpmRollback(ts, ia, NULL);
} else {
@@ -782,7 +782,7 @@
if (!poptPeekArg(optCon)) {
if (ia->rbtid == 0)
argerror(_("no packages given for install"));
-ia->transFlags |= RPMTRANS_FLAG_NOMD5;
+ia->transFlags |= RPMTRANS_FLAG_NOFDIGESTS;
ia->probFilter |= RPMPROB_FILTER_OLDPACKAGE;
/*@i@*/ ec += rpmRollback(ts, ia, NULL);
} else {
@@ -821,7 +821,7 @@
#ifdef IAM_RPMK
case MODE_CHECKSIG:
{ rpmVerifyFlags verifyFlags =
- (VERIFY_MD5|VERIFY_DIGEST|VERIFY_SIGNATURE);
+ (VERIFY_FDIGEST|VERIFY_HDRCHK|VERIFY_DIGEST|VERIFY_SIGNATURE);
verifyFlags &= ~ka->qva_flags;
ka->qva_flags = (rpmQueryFlags) verifyFlags;
--- rpm-4.4.2/python/rpmmodule.c.digests 2005-03-07 07:35:04.000000000 -0500
+++ rpm-4.4.2/python/rpmmodule.c 2006-07-05 14:18:15.000000000 -0400
@@ -376,7 +376,7 @@
REGISTER_ENUM(RPMTRANS_FLAG_NOPOSTUN);
REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERPOSTUN);
REGISTER_ENUM(RPMTRANS_FLAG_ANACONDA);
- REGISTER_ENUM(RPMTRANS_FLAG_NOMD5);
+ REGISTER_ENUM(RPMTRANS_FLAG_NOFDIGESTS);
REGISTER_ENUM(RPMTRANS_FLAG_NOSUGGEST);
REGISTER_ENUM(RPMTRANS_FLAG_ADDINDEPS);
REGISTER_ENUM(RPMTRANS_FLAG_NOCONFIGS);
--- rpm-4.4.2/python/rpmts-py.c.digests 2005-02-12 22:12:07.000000000 -0500
+++ rpm-4.4.2/python/rpmts-py.c 2006-07-05 14:18:15.000000000 -0400
@@ -635,7 +635,7 @@
memset(ia, 0, sizeof(*ia));
ia->qva_flags = (VERIFY_DIGEST|VERIFY_SIGNATURE|VERIFY_HDRCHK);
ia->transFlags |= (INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL);
- ia->transFlags |= RPMTRANS_FLAG_NOMD5;
+ ia->transFlags |= RPMTRANS_FLAG_NOFDIGESTS;
ia->installInterfaceFlags = (INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL);
ia->rbtid = rbtid;
ia->relocations = NULL;

View File

@ -1,12 +0,0 @@
--- rpm-4.4.2/lib/transaction.c.netsharedpath 2006-02-13 18:15:37.000000000 -0500
+++ rpm-4.4.2/lib/transaction.c 2006-02-13 18:15:38.000000000 -0500
@@ -820,6 +820,9 @@
/*@innercontinue@*/ continue;
if (strncmp(dn, *nsp, dnlen))
/*@innercontinue@*/ continue;
+ /* Insure that only the netsharedpath basename is compared. */
+ if ((s = strchr((*nsp) + dnlen, '/')) != NULL && s[1] != '\0')
+ /*@innercontinue@*/ continue;
if (strncmp(bn, (*nsp) + dnlen, bnlen))
/*@innercontinue@*/ continue;
len = dnlen + bnlen;

View File

@ -1,14 +0,0 @@
--- rpm-4.4.2/rpmdb/legacy.c.no_large_mmap 2006-01-10 11:25:28.000000000 +0000
+++ rpm-4.4.2/rpmdb/legacy.c 2006-01-10 11:25:31.000000000 +0000
@@ -167,6 +167,11 @@
goto exit;
}
+ /* file to large (32 MB), do not mmap file */
+ if (fsize > (size_t) 32*1024*1024)
+ if (ut == URL_IS_PATH || ut == URL_IS_UNKNOWN)
+ ut = URL_IS_DASH; /* force fd io */
+
switch(ut) {
case URL_IS_PATH:
case URL_IS_UNKNOWN:

View File

@ -1,30 +0,0 @@
--- rpm-4.3.3/lib/rpmrc.c.asm 2005-09-19 13:17:02.000000000 -0400
+++ rpm-4.3.3/lib/rpmrc.c 2005-09-19 13:17:23.000000000 -0400
@@ -1278,27 +1278,6 @@
}
# endif
-# if defined(__linux__) && defined(__powerpc__)
- {
- unsigned pvr = 0;
- __sighandler_t oldh = signal(SIGILL, mfspr_ill);
- if (setjmp(mfspr_jmpbuf) == 0) {
- __asm__ __volatile__ ("mfspr %0, 287" : "=r" (pvr));
- }
- signal(SIGILL, oldh);
-
- if ( pvr ) {
- pvr >>= 16;
- if ( pvr >= 0x40)
- strcpy(un.machine, "ppcpseries");
- else if ( (pvr == 0x36) || (pvr == 0x37) )
- strcpy(un.machine, "ppciseries");
- else
- strcpy(un.machine, "ppc");
- }
- }
-# endif
-
/* the uname() result goes through the arch_canon table */
canon = lookupInCanonTable(un.machine,
tables[RPM_MACHTABLE_INSTARCH].canons,

View File

@ -1,299 +0,0 @@
Allow build without the neon library. Resurrects old httpOpen
code from rpm-4.1.1.
Building without neon means no webdav file uploads, though.
Index: rpm-4.4.2/rpmio/rpmdav.c
===================================================================
--- rpm-4.4.2.orig/rpmio/rpmdav.c
+++ rpm-4.4.2/rpmio/rpmdav.c
@@ -9,6 +9,8 @@
#include <pthread.h>
#endif
+#ifdef WITH_NEON
+
#include "ne_alloc.h"
#include "ne_auth.h"
#include "ne_basic.h"
@@ -27,6 +29,8 @@
#include "ne_string.h"
#include "ne_utils.h"
+#endif /* WITH_NEON */
+
#include <rpmio_internal.h>
#define _RPMDAV_INTERNAL
@@ -61,6 +65,8 @@ _free(/*@only@*/ /*@null@*/ /*@out@*/ co
return NULL;
}
+#ifdef WITH_NEON
+
/* =============================================================== */
static int davFree(urlinfo u)
/*@globals internalState @*/
@@ -1370,6 +1376,8 @@ fprintf(stderr, "*** davReadlink(%s) rc
}
#endif /* NOTYET */
+#endif /* WITH_NEON */
+
/* =============================================================== */
/*@unchecked@*/
int avmagicdir = 0x3607113;
@@ -1494,6 +1502,8 @@ fprintf(stderr, "*** avOpendir(%s)\n", p
}
/*@=boundswrite@*/
+#ifdef WITH_NEON
+
/* =============================================================== */
/*@unchecked@*/
int davmagicdir = 0x8440291;
@@ -1661,4 +1671,6 @@ fprintf(stderr, "*** davOpendir(%s)\n",
return (DIR *) avdir;
/*@=kepttrans@*/
}
+
+#endif /* WITH_NEON */
/*@=modfilesys@*/
Index: rpm-4.4.2/rpmio/rpmio.c
===================================================================
--- rpm-4.4.2.orig/rpmio/rpmio.c
+++ rpm-4.4.2/rpmio/rpmio.c
@@ -375,7 +375,11 @@ static ssize_t fdRead(void * cookie, /*@
/*@-boundswrite@*/
/* HACK: flimsy wiring for davRead */
if (fd->req != NULL) {
+#ifdef WITH_NEON
rc = davRead(fd, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
+#else
+ rc = -1;
+#endif
/* XXX Chunked davRead EOF. */
if (rc == 0)
fd->bytesRemain = 0;
@@ -408,9 +412,13 @@ static ssize_t fdWrite(void * cookie, co
fdstat_enter(fd, FDSTAT_WRITE);
/*@-boundsread@*/
/* HACK: flimsy wiring for davWrite */
- if (fd->req != NULL)
+ if (fd->req != NULL) {
+#ifdef WITH_NEON
rc = davWrite(fd, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
- else
+#else
+ return -1;
+#endif
+ } else
rc = write(fdno, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
/*@=boundsread@*/
fdstat_exit(fd, FDSTAT_WRITE, rc);
@@ -459,9 +467,13 @@ static int fdClose( /*@only@*/ void * co
fdstat_enter(fd, FDSTAT_CLOSE);
/* HACK: flimsy wiring for davClose */
/*@-branchstate@*/
- if (fd->req != NULL)
+ if (fd->req != NULL) {
+#ifdef WITH_NEON
rc = davClose(fd);
- else
+#else
+ return -1;
+#endif
+ } else
rc = ((fdno >= 0) ? close(fdno) : -2);
/*@=branchstate@*/
fdstat_exit(fd, FDSTAT_CLOSE, rc);
@@ -2182,6 +2194,56 @@ exit:
}
/*@=nullstate@*/
+#ifndef WITH_NEON
+/*@-nullstate@*/ /* FIX: u->{ctrl,data}->url undef after XurlLink. */
+static /*@null@*/ FD_t httpOpen(const char * url, /*@unused@*/ int flags,
+ /*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret)
+ /*@globals internalState @*/
+ /*@modifies *uret, internalState @*/
+{
+ urlinfo u = NULL;
+ FD_t fd = NULL;
+
+#if 0 /* XXX makeTempFile() heartburn */
+ assert(!(flags & O_RDWR));
+#endif
+ if (urlSplit(url, &u))
+ goto exit;
+
+ if (u->ctrl == NULL)
+ u->ctrl = fdNew("persist ctrl (httpOpen)");
+ if (u->ctrl->nrefs > 2 && u->data == NULL)
+ u->data = fdNew("persist data (httpOpen)");
+
+ if (u->ctrl->url == NULL)
+ fd = fdLink(u->ctrl, "grab ctrl (httpOpen persist ctrl)");
+ else if (u->data->url == NULL)
+ fd = fdLink(u->data, "grab ctrl (httpOpen persist data)");
+ else
+ fd = fdNew("grab ctrl (httpOpen)");
+
+ if (fd) {
+ fdSetIo(fd, ufdio);
+ fd->ftpFileDoneNeeded = 0;
+ fd->rd_timeoutsecs = httpTimeoutSecs;
+ fd->contentLength = fd->bytesRemain = -1;
+ fd->url = urlLink(u, "url (httpOpen)");
+ fd = fdLink(fd, "grab data (httpOpen)");
+ fd->urlType = URL_IS_HTTP;
+ }
+
+exit:
+/*@-boundswrite@*/
+ if (uret)
+ *uret = u;
+/*@=boundswrite@*/
+ /*@-refcounttrans@*/
+ return fd;
+ /*@=refcounttrans@*/
+}
+/*@=nullstate@*/
+#endif
+
static /*@null@*/ FD_t ufdOpen(const char * url, int flags, mode_t mode)
/*@globals h_errno, fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/
@@ -2220,7 +2282,11 @@ fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o
case URL_IS_HTTPS:
case URL_IS_HTTP:
case URL_IS_HKP:
+#ifdef WITH_NEON
fd = davOpen(url, flags, mode, &u);
+#else
+ fd = httpOpen(url, flags, mode, &u);
+#endif
if (fd == NULL || u == NULL)
break;
@@ -2228,7 +2294,11 @@ fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o
? ((flags & O_APPEND) ? "PUT" :
((flags & O_CREAT) ? "PUT" : "PUT"))
: "GET");
+#ifdef WITH_NEON
u->openError = davReq(fd, cmd, path);
+#else
+ u->openError = httpReq(fd, cmd, path);
+#endif
if (u->openError < 0) {
/* XXX make sure that we can exit through ufdClose */
fd = fdLink(fd, "error ctrl (ufdOpen HTTP)");
Index: rpm-4.4.2/rpmio/rpmrpc.c
===================================================================
--- rpm-4.4.2.orig/rpmio/rpmrpc.c
+++ rpm-4.4.2/rpmio/rpmrpc.c
@@ -93,7 +93,9 @@ int Mkdir (const char * path, mode_t mod
/*@notreached@*/ break;
case URL_IS_HTTPS:
case URL_IS_HTTP:
+#ifdef WITH_NEON
return davMkdir(path, mode);
+#endif
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
@@ -151,7 +153,9 @@ int Rmdir (const char * path)
/*@notreached@*/ break;
case URL_IS_HTTPS:
case URL_IS_HTTP:
+#ifdef WITH_NEON
return davRmdir(path);
+#endif
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
@@ -182,7 +186,9 @@ int Rename (const char * oldpath, const
switch (oldut) {
case URL_IS_HTTPS:
case URL_IS_HTTP:
+#ifdef WITH_NEON
return davRename(oldpath, newpath);
+#endif
/*@notreached@*/ break;
case URL_IS_FTP: /* XXX WRONG WRONG WRONG */
case URL_IS_PATH:
@@ -280,7 +286,9 @@ int Unlink(const char * path) {
/*@notreached@*/ break;
case URL_IS_HTTPS:
case URL_IS_HTTP:
+#ifdef WITH_NEON
return davUnlink(path);
+#endif
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
@@ -1282,7 +1290,9 @@ fprintf(stderr, "*** Stat(%s,%p)\n", pat
/*@notreached@*/ break;
case URL_IS_HTTPS:
case URL_IS_HTTP:
+#ifdef WITH_NEON
return davStat(path, st);
+#endif
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
@@ -1311,7 +1321,9 @@ fprintf(stderr, "*** Lstat(%s,%p)\n", pa
/*@notreached@*/ break;
case URL_IS_HTTPS:
case URL_IS_HTTP:
+#ifdef WITH_NEON
return davLstat(path, st);
+#endif
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
@@ -1489,7 +1501,9 @@ fprintf(stderr, "*** Opendir(%s)\n", pat
/*@notreached@*/ break;
case URL_IS_HTTPS:
case URL_IS_HTTP:
+#ifdef WITH_NEON
return davOpendir(path);
+#endif
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
@@ -1515,8 +1529,10 @@ fprintf(stderr, "*** Readdir(%p)\n", (vo
return NULL;
if (ISAVMAGIC(dir))
return avReaddir(dir);
+#ifdef WITH_NEON
if (ISDAVMAGIC(dir))
return davReaddir(dir);
+#endif
return readdir(dir);
}
@@ -1528,7 +1544,9 @@ fprintf(stderr, "*** Closedir(%p)\n", (v
return 0;
if (ISAVMAGIC(dir))
return avClosedir(dir);
+#ifdef WITH_NEON
if (ISDAVMAGIC(dir))
return davClosedir(dir);
+#endif
return closedir(dir);
}
Index: rpm-4.4.2/rpmio/url.c
===================================================================
--- rpm-4.4.2.orig/rpmio/url.c
+++ rpm-4.4.2/rpmio/url.c
@@ -147,8 +147,10 @@ URLDBGREFS(0, (stderr, "--> url %p -- %d
/*@=usereleased@*/
}
if (u->sess != NULL) {
+#ifdef WITH_NEON
/* HACK: neon include has prototype. */
ne_session_destroy(u->sess);
+#endif
u->sess = NULL;
}
u->buf = _free(u->buf);

View File

@ -1,132 +0,0 @@
--- ./lib/query.c.nosever 2006-06-23 13:00:13.000000000 -0400
+++ ./lib/query.c 2006-06-23 13:00:56.000000000 -0400
@@ -787,22 +787,6 @@
if (qva->qva_flags & VERIFY_HDRCHK)
vsflags |= RPMVSF_NOHDRCHK;
-#ifdef NOTYET
- /* Initialize security context patterns (if not already done). */
- if (!(qva->qva_flags & VERIFY_CONTEXTS)) {
- rpmsx sx = rpmtsREContext(ts);
- if (sx == NULL) {
- arg = rpmGetPath("%{?_verify_file_context_path}", NULL);
- if (arg != NULL && *arg != '\0') {
- sx = rpmsxNew(arg);
- (void) rpmtsSetREContext(ts, sx);
- }
- arg = _free(arg);
- }
- sx = rpmsxFree(sx);
- }
-#endif
-
ovsflags = rpmtsSetVSFlags(ts, vsflags);
ec = rpmcliArgIter(ts, qva, argv);
vsflags = rpmtsSetVSFlags(ts, ovsflags);
--- ./lib/verify.c.nosever 2004-10-24 15:36:30.000000000 -0400
+++ ./lib/verify.c 2006-06-23 13:06:23.000000000 -0400
@@ -78,8 +78,6 @@
return 1;
}
- flags |= RPMVERIFY_CONTEXTS; /* no disable from package. */
-
/*
* Not all attributes of non-regular files can be verified.
*/
@@ -117,33 +115,6 @@
*/
flags &= ~(omitMask | RPMVERIFY_FAILURES);
- /*
- * Verify file security context.
- */
-/*@-branchstate@*/
- if (selinuxEnabled == 1 && (flags & RPMVERIFY_CONTEXTS)) {
- security_context_t con;
-
- rc = lgetfilecon(fn, &con);
- if (rc == -1)
- *res |= (RPMVERIFY_LGETFILECONFAIL|RPMVERIFY_CONTEXTS);
- else {
- rpmsx sx = rpmtsREContext(ts);
- const char * fcontext;
-
- if (sx != NULL) {
- /* Get file security context from patterns. */
- fcontext = rpmsxFContext(sx, fn, fmode);
- sx = rpmsxFree(sx);
- } else {
- /* Get file security context from package. */
- fcontext = rpmfiFContext(fi);
- }
- if (fcontext == NULL || strcmp(fcontext, con))
- *res |= RPMVERIFY_CONTEXTS;
- freecon(con);
- }
- }
/*@=branchstate@*/
if (flags & RPMVERIFY_MD5) {
@@ -331,10 +302,9 @@
}
} else if (verifyResult || rpmIsVerbose()) {
const char * size, * MD5, * link, * mtime, * mode;
- const char * group, * user, * rdev, *ctxt;
+ const char * group, * user, * rdev;
/*@observer@*/ static const char *const aok = ".";
/*@observer@*/ static const char *const unknown = "?";
- /*@observer@*/ static const char *const ctxt_ignore = " ";
ec = 1;
@@ -346,10 +316,6 @@
#define _verifyfile(_RPMVERIFY_F, _C) \
((verifyResult & RPMVERIFY_READFAIL) ? unknown : \
(verifyResult & _RPMVERIFY_F) ? _C : aok)
-#define _verifyctxt(_RPMVERIFY_F, _C) \
- ((selinuxEnabled != 1 ? ctxt_ignore : \
- (verifyResult & RPMVERIFY_LGETFILECONFAIL) ? unknown : \
- (verifyResult & _RPMVERIFY_F) ? _C : aok))
MD5 = _verifyfile(RPMVERIFY_MD5, "5");
size = _verify(RPMVERIFY_FILESIZE, "S");
@@ -359,15 +325,13 @@
user = _verify(RPMVERIFY_USER, "U");
group = _verify(RPMVERIFY_GROUP, "G");
mode = _verify(RPMVERIFY_MODE, "M");
- ctxt = _verifyctxt(RPMVERIFY_CONTEXTS, "C");
-#undef _verifyctxt
#undef _verifyfile
#undef _verifylink
#undef _verify
- sprintf(te, "%s%s%s%s%s%s%s%s%s %c %s",
- size, mode, MD5, rdev, link, user, group, mtime, ctxt,
+ sprintf(te, "%s%s%s%s%s%s%s%s %c %s",
+ size, mode, MD5, rdev, link, user, group, mtime,
((fileAttrs & RPMFILE_CONFIG) ? 'c' :
(fileAttrs & RPMFILE_DOC) ? 'd' :
(fileAttrs & RPMFILE_GHOST) ? 'g' :
@@ -522,20 +486,6 @@
vsflags |= RPMVSF_NOHDRCHK;
vsflags &= ~RPMVSF_NEEDPAYLOAD;
- /* Initialize security context patterns (if not already done). */
- if (qva->qva_flags & VERIFY_CONTEXTS) {
- rpmsx sx = rpmtsREContext(ts);
- if (sx == NULL) {
- arg = rpmGetPath("%{?_verify_file_context_path}", NULL);
- if (arg != NULL && *arg != '\0') {
- sx = rpmsxNew(arg);
- (void) rpmtsSetREContext(ts, sx);
- }
- arg = _free(arg);
- }
- sx = rpmsxFree(sx);
- }
-
ovsflags = rpmtsSetVSFlags(ts, vsflags);
ec = rpmcliArgIter(ts, qva, argv);
vsflags = rpmtsSetVSFlags(ts, ovsflags);

View File

@ -1,36 +0,0 @@
--- rpm-4.4.2/scripts/perl.prov.main 2006-01-18 11:32:28.000000000 -0500
+++ rpm-4.4.2/scripts/perl.prov 2006-01-18 11:32:44.000000000 -0500
@@ -121,13 +121,17 @@
}
# not everyone puts the package name of the file as the first
- # package name so we report all namespaces as if they were
- # provided packages (really ugly).
+ # package name so we report all namespaces except some common
+ # false positives as if they were provided packages (really ugly).
if (m/^\s*package\s+([_:a-zA-Z0-9]+)\s*;/) {
$package=$1;
undef $version;
- $require{$package}=undef;
+ if ($package eq 'main') {
+ undef $package;
+ } else {
+ $require{$package}=undef;
+ }
}
# after we found the package name take the first assignment to
--- rpm-4.4.2/scripts/perldeps.pl.main 2006-01-18 11:32:37.000000000 -0500
+++ rpm-4.4.2/scripts/perldeps.pl 2006-01-18 11:32:44.000000000 -0500
@@ -150,6 +150,10 @@
return if(exists($self->{'provides_check'}->{$params{'-provide'}}));
#
+ # Skip some common false positives
+ return if $params{'-provide'} eq 'main';
+
+ #
# Created dependency object
my $dep = new Dependency "provide", $params{-provide};
$dep->filename($params{-filename});

View File

@ -1,17 +0,0 @@
--- rpm-4.4.2/macros.in.perlreq 2005-07-26 12:42:38.000000000 -0400
+++ rpm-4.4.2/macros.in 2005-07-26 12:42:47.000000000 -0400
@@ -430,10 +430,10 @@
#
# Note: Used iff _use_internal_dependency_generator is non-zero. The
# helpers are also used by @RPMCONFIGDIR@/rpmdeps {--provides|--requires}.
-%__perl_provides @RPMCONFIGDIR@/perldeps.pl --provides
-%__perl_requires @RPMCONFIGDIR@/perldeps.pl --requires
-#%__perl_provides @RPMCONFIGDIR@/perl.prov
-#%__perl_requires @RPMCONFIGDIR@/perl.req
+#%__perl_provides @RPMCONFIGDIR@/perldeps.pl --provides
+#%__perl_requires @RPMCONFIGDIR@/perldeps.pl --requires
+%__perl_provides @RPMCONFIGDIR@/perl.prov
+%__perl_requires @RPMCONFIGDIR@/perl.req
%__python_provides @RPMCONFIGDIR@/pythondeps.sh --provides
%__python_requires @RPMCONFIGDIR@/pythondeps.sh --requires

View File

@ -1,110 +0,0 @@
--- rpm-4.4.2/popt/po/de.po.charset 2005-11-28 11:30:54.000000000 -0500
+++ rpm-4.4.2/popt/po/de.po 2005-11-28 11:31:19.000000000 -0500
@@ -12,7 +12,7 @@
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: ENCODING\n"
#: popt.c:35
--- rpm-4.4.2/popt/po/zh.po.charset 2005-11-28 11:30:54.000000000 -0500
+++ rpm-4.4.2/popt/po/zh.po 2005-11-28 11:31:19.000000000 -0500
@@ -12,7 +12,7 @@
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: ENCODING\n"
#: popt.c:35
--- rpm-4.4.2/popt/po/ja.po.charset 2005-11-28 11:30:54.000000000 -0500
+++ rpm-4.4.2/popt/po/ja.po 2005-11-28 11:31:19.000000000 -0500
@@ -12,7 +12,7 @@
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: ENCODING\n"
#: popt.c:35
--- rpm-4.4.2/popt/po/es.po.charset 2005-11-28 11:30:54.000000000 -0500
+++ rpm-4.4.2/popt/po/es.po 2005-11-28 11:31:19.000000000 -0500
@@ -12,7 +12,7 @@
"Last-Translator: Leandro Lucarella <luca@linuxmendoza.org.ar>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: ENCODING\n"
#: popt.c:35
--- rpm-4.4.2/popt/po/eu_ES.po.charset 2005-11-28 11:30:54.000000000 -0500
+++ rpm-4.4.2/popt/po/eu_ES.po 2005-11-28 11:31:19.000000000 -0500
@@ -12,7 +12,7 @@
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: ENCODING\n"
#: popt.c:35
--- rpm-4.4.2/popt/po/fi.po.charset 2005-11-28 11:30:54.000000000 -0500
+++ rpm-4.4.2/popt/po/fi.po 2005-11-28 11:31:19.000000000 -0500
@@ -12,7 +12,7 @@
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: ENCODING\n"
#: popt.c:35
--- rpm-4.4.2/popt/po/sr.po.charset 2005-11-28 11:30:54.000000000 -0500
+++ rpm-4.4.2/popt/po/sr.po 2005-11-28 11:31:19.000000000 -0500
@@ -12,7 +12,7 @@
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: ENCODING\n"
#: popt.c:35
--- rpm-4.4.2/popt/po/pt_BR.po.charset 2005-11-28 11:30:54.000000000 -0500
+++ rpm-4.4.2/popt/po/pt_BR.po 2005-11-28 11:31:19.000000000 -0500
@@ -12,7 +12,7 @@
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: ENCODING\n"
#: popt.c:35
--- rpm-4.4.2/popt/po/it.po.charset 2005-11-28 11:30:54.000000000 -0500
+++ rpm-4.4.2/popt/po/it.po 2005-11-28 11:31:19.000000000 -0500
@@ -12,7 +12,7 @@
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: ENCODING\n"
#: popt.c:35
--- rpm-4.4.2/popt/po/id.po.charset 2005-11-28 11:30:54.000000000 -0500
+++ rpm-4.4.2/popt/po/id.po 2005-11-28 11:31:19.000000000 -0500
@@ -12,7 +12,7 @@
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: ENCODING\n"
#: popt.c:35

View File

@ -1,104 +0,0 @@
--- rpm-4.4.2/lib/transaction.c.prefer32 2007-04-25 12:10:25.000000000 +0100
+++ rpm-4.4.2/lib/transaction.c 2007-04-25 12:38:32.000000000 +0100
@@ -122,6 +122,7 @@ static int handleInstInstalledFiles(cons
/*@modifies ts, fi, rpmGlobalMacroContext, fileSystem, internalState @*/
{
uint_32 tscolor = rpmtsColor(ts);
+ uint_32 prefcolor = rpmtsPrefColor(ts);
uint_32 otecolor, tecolor;
uint_32 oFColor, FColor;
const char * altNEVR = NULL;
@@ -199,11 +200,11 @@ static int handleInstInstalledFiles(cons
/* Resolve file conflicts to prefer Elf64 (if not forced). */
if (tscolor != 0 && FColor != 0 && FColor != oFColor)
{
- if (oFColor & 0x2) {
+ if (oFColor & prefcolor) {
fi->actions[fileNum] = FA_SKIPCOLOR;
rConflicts = 0;
} else
- if (FColor & 0x2) {
+ if (FColor & prefcolor) {
fi->actions[fileNum] = FA_CREATE;
rConflicts = 0;
}
@@ -458,6 +459,7 @@ static void handleOverlappedFiles(const
if (fi != NULL)
while ((i = rpmfiNext(fi)) >= 0) {
uint_32 tscolor = rpmtsColor(ts);
+ uint_32 prefcolor = rpmtsPrefColor(ts);
uint_32 oFColor, FColor;
struct fingerPrint_s * fiFps;
int otherPkgNum, otherFileNum;
@@ -570,19 +572,19 @@ assert(otherFi != NULL);
rConflicts = reportConflicts;
/* Resolve file conflicts to prefer Elf64 (if not forced) ... */
if (tscolor != 0) {
- if (FColor & 0x2) {
- /* ... last Elf64 file is installed ... */
+ if (FColor & prefcolor) {
+ /* ... last file of preferred colour is installed ... */
if (!XFA_SKIPPING(fi->actions[i])) {
/* XXX static helpers are order dependent. Ick. */
if (strcmp(fn, "/usr/sbin/libgcc_post_upgrade")
&& strcmp(fn, "/usr/sbin/glibc_post_upgrade"))
- otherFi->actions[otherFileNum] = FA_SKIP;
+ otherFi->actions[otherFileNum] = FA_SKIPCOLOR;
}
fi->actions[i] = FA_CREATE;
rConflicts = 0;
} else
- if (oFColor & 0x2) {
- /* ... first Elf64 file is installed ... */
+ if (oFColor & prefcolor) {
+ /* ... first file of preferred colour is installed ... */
if (XFA_SKIPPING(fi->actions[i]))
otherFi->actions[otherFileNum] = FA_CREATE;
fi->actions[i] = FA_SKIPCOLOR;
--- rpm-4.4.2/lib/rpmts.c.prefer32 2005-02-13 03:12:03.000000000 +0000
+++ rpm-4.4.2/lib/rpmts.c 2007-04-25 12:37:45.000000000 +0100
@@ -1475,6 +1475,11 @@ uint_32 rpmtsSetColor(rpmts ts, uint_32
return ocolor;
}
+uint_32 rpmtsPrefColor(rpmts ts)
+{
+ return (ts != NULL ? ts->prefcolor : 0);
+}
+
rpmop rpmtsOp(rpmts ts, rpmtsOpX opx)
{
rpmop op = NULL;
@@ -1554,6 +1559,7 @@ rpmts rpmtsCreate(void)
ts->delta = 5;
ts->color = rpmExpandNumeric("%{?_transaction_color}");
+ ts->prefcolor = rpmExpandNumeric("%{?_prefer_color}")?:2;
ts->numRemovedPackages = 0;
ts->allocedRemovedPackages = ts->delta;
--- rpm-4.4.2/lib/rpmts.h.prefer32 2005-01-04 16:35:05.000000000 +0000
+++ rpm-4.4.2/lib/rpmts.h 2007-04-25 12:33:39.000000000 +0100
@@ -309,6 +309,7 @@ struct rpmts_s {
int_32 tid; /*!< Transaction id. */
uint_32 color; /*!< Transaction color bits. */
+ uint_32 prefcolor; /*!< Preferred file color. */
rpmVSFlags vsflags; /*!< Signature/digest verification flags. */
@@ -983,6 +984,14 @@ uint_32 rpmtsColor(rpmts ts)
/*@*/;
/**
+ * Retrieve prefered file color
+ * @param ts transaction set
+ * @return color bits
+ */
+uint_32 rpmtsPrefColor(rpmts ts)
+ /*@*/;
+
+/**
* Set color bits of transaction set.
* @param ts transaction set
* @param color new color bits

View File

@ -1,10 +0,0 @@
--- rpm-4.4.2/python/header-py.c.aslist 2006-06-28 16:33:31.000000000 -0400
+++ rpm-4.4.2/python/header-py.c 2006-06-28 16:33:47.000000000 -0400
@@ -537,6 +537,7 @@
case RPMTAG_CONFLICTNAME:
case RPMTAG_CONFLICTFLAGS:
case RPMTAG_CONFLICTVERSION:
+ case RPMTAG_CHANGELOGTIME:
forceArray = 1;
break;
case RPMTAG_SUMMARY:

View File

@ -1,89 +0,0 @@
--- rpm-4.4.2/lib/query.c.flush 2006-10-31 12:48:54.000000000 +0000
+++ rpm-4.4.2/lib/query.c 2006-10-31 12:49:05.000000000 +0000
@@ -124,6 +124,28 @@
return str;
}
+/**
+ */
+static void flushBuffer(char ** tp, char ** tep, int nonewline)
+ /*@ modifies *tp, *tep @*/
+{
+ char *t, *te;
+
+ t = *tp;
+ te = *tep;
+ if (te > t) {
+ if (!nonewline) {
+ *te++ = '\n';
+ *te = '\0';
+ }
+ rpmMessage(RPMMESS_NORMAL, "%s", t);
+ te = t;
+ *t = '\0';
+ }
+ *tp = t;
+ *tep = te;
+}
+
int showQueryPackage(QVA_t qva, rpmts ts, Header h)
{
int scareMem = 0;
@@ -131,7 +153,6 @@
char * t, * te;
char * prefix = NULL;
int rc = 0; /* XXX FIXME: need real return code */
- int nonewline = 0;
int i;
te = t = xmalloc(BUFSIZ);
@@ -141,7 +162,6 @@
if (qva->qva_queryFormat != NULL) {
const char * str = queryHeader(h, qva->qva_queryFormat);
- nonewline = 1;
/*@-branchstate@*/
if (str) {
size_t tb = (te - t);
@@ -157,6 +177,7 @@
/*@=usereleased@*/
/*@=boundswrite@*/
str = _free(str);
+ flushBuffer(&t, &te, 1);
}
/*@=branchstate@*/
}
@@ -304,31 +325,13 @@
_("package has neither file owner or id lists\n"));
}
}
-/*@-branchstate@*/
- if (te > t) {
-/*@-boundswrite@*/
- *te++ = '\n';
- *te = '\0';
- rpmMessage(RPMMESS_NORMAL, "%s", t);
- te = t;
- *t = '\0';
-/*@=boundswrite@*/
- }
-/*@=branchstate@*/
+ flushBuffer(&t, &te, 0);
}
rc = 0;
exit:
- if (te > t) {
- if (!nonewline) {
-/*@-boundswrite@*/
- *te++ = '\n';
- *te = '\0';
-/*@=boundswrite@*/
- }
- rpmMessage(RPMMESS_NORMAL, "%s", t);
- }
+ flushBuffer(&t, &te, 0);
t = _free(t);
fi = rpmfiFree(fi);

View File

@ -1,337 +0,0 @@
--- rpm-4.4.2/configure.ac.ipv6 2006-07-05 10:06:54.000000000 -0400
+++ rpm-4.4.2/configure.ac 2006-07-05 10:07:00.000000000 -0400
@@ -858,7 +858,8 @@
dnl XXX AC_FUNC_FORK([])
dnl XXX AC_CHECK_FUNCS(gethostname mkdir mkfifo rmdir select uname)
-AC_CHECK_FUNCS(basename getcwd getwd inet_aton mtrace putenv realpath setenv)
+AC_CHECK_FUNCS(basename getaddrinfo getcwd getnameinfo getwd inet_aton)
+AC_CHECK_FUNCS(mtrace putenv realpath setenv)
AC_CHECK_FUNCS(stpcpy stpncpy strcspn)
AC_CHECK_FUNCS(strdup strndup strerror strtol strtoul strspn strstr)
--- rpm-4.4.2/rpmio/rpmio.c.ipv6 2005-01-25 22:39:58.000000000 -0500
+++ rpm-4.4.2/rpmio/rpmio.c 2006-07-05 10:04:15.000000000 -0400
@@ -9,6 +9,10 @@
# include <machine/types.h>
#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+
#include <netinet/in.h>
#include <arpa/inet.h> /* XXX for inet_aton and HP-UX */
@@ -750,6 +754,7 @@
return retstr;
}
+#if !defined(HAVE_GETADDRINFO)
#if !defined(USE_ALT_DNS) || !USE_ALT_DNS
static int mygethostbyname(const char * host,
/*@out@*/ struct in_addr * address)
@@ -800,14 +805,50 @@
}
/*@=compdef@*/
/*@=boundsread@*/
+#endif
static int tcpConnect(FD_t ctrl, const char * host, int port)
/*@globals h_errno, fileSystem, internalState @*/
/*@modifies ctrl, fileSystem, internalState @*/
{
- struct sockaddr_in sin;
int fdno = -1;
int rc;
+#ifdef HAVE_GETADDRINFO
+ struct addrinfo hints, *res, *res0;
+ char pbuf[NI_MAXSERV];
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ sprintf(pbuf, "%d", port);
+ pbuf[sizeof(pbuf)-1] = '\0';
+ rc = FTPERR_FAILED_CONNECT;
+ if (getaddrinfo(host, pbuf, &hints, &res0) == 0) {
+ for (res = res0; res != NULL; res= res->ai_next) {
+ if ((fdno = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) < 0)
+ continue;
+ if (connect(fdno, res->ai_addr, res->ai_addrlen) < 0) {
+ close(fdno);
+ continue;
+ }
+ /* success */
+ rc = 0;
+ if (_ftp_debug) {
+ char hbuf[NI_MAXHOST];
+ getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf),
+ NULL, 0, NI_NUMERICHOST);
+ fprintf(stderr,"++ connect [%s]:%d on fdno %d\n",
+ /*@-unrecog@*/ hbuf /*@=unrecog@*/, port, fdno);
+ }
+ break;
+ }
+ freeaddrinfo(res0);
+ }
+ if (rc < 0)
+ goto errxit;
+
+#else /* HAVE_GETADDRINFO */
+ struct sockaddr_in sin;
/*@-boundswrite@*/
memset(&sin, 0, sizeof(sin));
@@ -842,6 +883,7 @@
inet_ntoa(sin.sin_addr)
/*@=unrecog =moduncon =evalorderuncon @*/ ,
(int)ntohs(sin.sin_port), fdno);
+#endif /* HAVE_GETADDRINFO */
fdSetFdno(ctrl, (fdno >= 0 ? fdno : -1));
return 0;
@@ -1174,12 +1216,17 @@
int ftpReq(FD_t data, const char * ftpCmd, const char * ftpArg)
{
urlinfo u = data->url;
+#if !defined(HAVE_GETADDRINFO)
struct sockaddr_in dataAddress;
+#endif /* HAVE_GETADDRINFO */
+ char remoteIP[NI_MAXHOST];
char * cmd;
int cmdlen;
char * passReply;
char * chptr;
int rc;
+ int epsv;
+ int port;
/*@-boundswrite@*/
URLSANE(u);
@@ -1214,8 +1261,35 @@
data->contentLength = cl;
}
+ epsv = 0;
passReply = NULL;
- rc = ftpCommand(u, &passReply, "PASV", NULL);
+#ifdef HAVE_GETNAMEINFO
+ rc = ftpCommand(u, &passReply, "EPSV", NULL);
+ if (rc==0) {
+#ifdef HAVE_GETADDRINFO
+ struct sockaddr_storage ss;
+#else /* HAVE_GETADDRINFO */
+ struct sockaddr_in ss;
+#endif /* HAVE_GETADDRINFO */
+ int size;
+ /* we need to know IP of remote host */
+ size=sizeof(ss);
+ if ((getpeername(fdFileno(c2f(u->ctrl)), (struct sockaddr *)&ss, &size) == 0) &&
+ (getnameinfo((struct sockaddr *)&ss, size, remoteIP, sizeof(remoteIP),
+ NULL, 0, NI_NUMERICHOST) == 0))
+ epsv++;
+ else {
+ /* abort EPSV and fall back to PASV */
+ rc = ftpCommand(u, &passReply, "ABOR", NULL);
+ if (rc) {
+ rc = FTPERR_PASSIVE_ERROR;
+ goto errxit;
+ }
+ }
+ }
+ if (epsv==0)
+#endif /* HAVE_GETNAMEINFO */
+ rc = ftpCommand(u, &passReply, "PASV", NULL);
if (rc) {
rc = FTPERR_PASSIVE_ERROR;
goto errxit;
@@ -1230,6 +1304,15 @@
if (*chptr != ')') return FTPERR_PASSIVE_ERROR;
*chptr-- = '\0';
+ if (epsv) {
+ int i;
+ if(sscanf(passReply,"%*c%*c%*c%d%*c",&i) != 1) {
+ rc = FTPERR_PASSIVE_ERROR;
+ goto errxit;
+ }
+ port = i;
+ } else {
+
while (*chptr && *chptr != ',') chptr--;
if (*chptr != ',') return FTPERR_PASSIVE_ERROR;
chptr--;
@@ -1241,13 +1324,11 @@
port number portion */
{ int i, j;
- memset(&dataAddress, 0, sizeof(dataAddress));
- dataAddress.sin_family = AF_INET;
if (sscanf(chptr, "%d,%d", &i, &j) != 2) {
rc = FTPERR_PASSIVE_ERROR;
goto errxit;
}
- dataAddress.sin_port = htons((((unsigned)i) << 8) + j);
+ port = (((unsigned)i) << 8) + j;
}
chptr = passReply;
@@ -1255,9 +1336,75 @@
if (*chptr == ',') *chptr = '.';
}
/*@=boundswrite@*/
+ sprintf(remoteIP, "%s", passReply);
+ } /* if (epsv) */
+
+#ifdef HAVE_GETADDRINFO
+ {
+ struct addrinfo hints, *res, *res0;
+ char pbuf[NI_MAXSERV];
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_NUMERICHOST;
+ sprintf(pbuf, "%d", port);
+ pbuf[sizeof(pbuf)-1] = '\0';
+ if (getaddrinfo(remoteIP, pbuf, &hints, &res0)) {
+ rc = FTPERR_PASSIVE_ERROR;
+ goto errxit;
+ }
+
+ for (res = res0; res != NULL; res = res->ai_next) {
+ rc = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+ fdSetFdno(data, (rc >= 0 ? rc : -1));
+ if (rc < 0) {
+ if (res->ai_next)
+ continue;
+ else {
+ rc = FTPERR_FAILED_CONNECT;
+ freeaddrinfo(res0);
+ goto errxit;
+ }
+ }
+ data = fdLink(data, "open data (ftpReq)");
+
+ /* XXX setsockopt SO_LINGER */
+ /* XXX setsockopt SO_KEEPALIVE */
+ /* XXX setsockopt SO_TOS IPTOS_THROUGHPUT */
+
+ {
+ int criterr = 0;
+ while (connect(fdFileno(data), res->ai_addr, res->ai_addrlen) < 0) {
+ if (errno == EINTR)
+ continue;
+ criterr++;
+ }
+ if (criterr) {
+ if (res->ai_addr) {
+ fdClose(data);
+ continue;
+ } else {
+ rc = FTPERR_PASSIVE_ERROR;
+ freeaddrinfo(res0);
+ goto errxit;
+ }
+ }
+ }
+ /* success */
+ rc = 0;
+ break;
+ }
+ freeaddrinfo(res0);
+ }
+
+#else /* HAVE_GETADDRINFO */
+ memset(&dataAddress, 0, sizeof(dataAddress));
+ dataAddress.sin_family = AF_INET;
+ dataAddress.sin_port = htons(port);
/*@-moduncon@*/
- if (!inet_aton(passReply, &dataAddress.sin_addr)) {
+ if (!inet_aton(remoteIP, &dataAddress.sin_addr)) {
rc = FTPERR_PASSIVE_ERROR;
goto errxit;
}
@@ -1285,6 +1432,7 @@
goto errxit;
}
/*@=internalglobs@*/
+#endif /* HAVE_GETADDRINFO */
if (_ftp_debug)
fprintf(stderr, "-> %s", cmd);
@@ -1598,6 +1746,7 @@
urlinfo u;
const char * host;
const char * path;
+ char hthost[NI_MAXHOST];
int port;
int rc;
char * req;
@@ -1610,6 +1759,10 @@
if (((host = (u->proxyh ? u->proxyh : u->host)) == NULL))
return FTPERR_BAD_HOSTNAME;
+ if (strchr(host, ':'))
+ sprintf(hthost, "[%s]", host);
+ else
+ strcpy(hthost, host);
if ((port = (u->proxyp > 0 ? u->proxyp : u->port)) < 0) port = 80;
path = (u->proxyh || u->proxyp > 0) ? u->url : httpArg;
@@ -1639,7 +1792,7 @@
Accept: text/plain\r\n\
Transfer-Encoding: chunked\r\n\
\r\n\
-") + strlen(httpCmd) + strlen(path) + sizeof(VERSION) + strlen(host) + 20;
+") + strlen(httpCmd) + strlen(path) + sizeof(VERSION) + strlen(hthost) + 20;
/*@-boundswrite@*/
req = alloca(len);
@@ -1653,7 +1806,7 @@
Accept: text/plain\r\n\
Transfer-Encoding: chunked\r\n\
\r\n\
-", httpCmd, path, (u->httpVersion ? 1 : 0), VERSION, host, port);
+", httpCmd, path, (u->httpVersion ? 1 : 0), VERSION, hthost, port);
} else {
sprintf(req, "\
%s %s HTTP/1.%d\r\n\
@@ -1661,7 +1814,7 @@
Host: %s:%d\r\n\
Accept: text/plain\r\n\
\r\n\
-", httpCmd, path, (u->httpVersion ? 1 : 0), VERSION, host, port);
+", httpCmd, path, (u->httpVersion ? 1 : 0), VERSION, hthost, port);
}
/*@=boundswrite@*/
--- rpm-4.4.2/rpmio/url.c.ipv6 2004-11-28 15:41:31.000000000 -0500
+++ rpm-4.4.2/rpmio/url.c 2006-07-05 10:04:15.000000000 -0400
@@ -431,6 +431,8 @@
/*
* Split URL into components. The URL can look like
* scheme://user:password@host:port/path
+ * or as in RFC2732 for IPv6 address
+ * service://user:password@[ip:v6:ad:dr:es:s]:port/path
*/
/*@-bounds@*/
/*@-modfilesys@*/
@@ -487,8 +489,14 @@
}
/*@=branchstate@*/
- /* Look for ...host:port */
+ /* Look for ...host:port or [v6addr]:port*/
fe = f = s;
+ if (strchr(fe, '[') && strchr(fe, ']'))
+ {
+ fe = strchr(f, ']');
+ *f++ = '\0';
+ *fe++ = '\0';
+ }
while (*fe && *fe != ':') fe++;
if (*fe == ':') {
*fe++ = '\0';

View File

@ -1,115 +0,0 @@
--- rpm-4.4.2/rpmio/rpmsq.c.deadlock 2005-07-13 06:47:03.000000000 -0400
+++ rpm-4.4.2/rpmio/rpmsq.c 2006-01-30 21:00:13.000000000 -0500
@@ -218,7 +218,6 @@
sq->id = ME();
ret = pthread_mutex_init(&sq->mutex, NULL);
- ret = pthread_cond_init(&sq->cond, NULL);
insque(elem, (prev != NULL ? prev : rpmsqQueue));
ret = sigrelse(SIGCHLD);
}
@@ -240,8 +239,11 @@
ret = sighold (SIGCHLD);
if (ret == 0) {
remque(elem);
- ret = pthread_cond_destroy(&sq->cond);
- ret = pthread_mutex_destroy(&sq->mutex);
+
+ /* Unlock the mutex and then destroy it */
+ if((ret = pthread_mutex_unlock(&sq->mutex)) == 0)
+ ret = pthread_mutex_destroy(&sq->mutex);
+
sq->id = NULL;
/*@-bounds@*/
if (sq->pipes[1]) ret = close(sq->pipes[1]);
@@ -315,11 +317,20 @@
sq != NULL && sq != rpmsqQueue;
sq = sq->q_forw)
{
+ int ret;
+
if (sq->child != reaped)
/*@innercontinue@*/ continue;
sq->reaped = reaped;
sq->status = status;
- (void) pthread_cond_signal(&sq->cond);
+
+ /* Unlock the mutex. The waiter will then be able to
+ * aquire the lock.
+ *
+ * XXX: jbj, wtd, if this fails?
+ */
+ ret = pthread_mutex_unlock(&sq->mutex);
+
/*@innerbreak@*/ break;
}
}
@@ -391,6 +402,7 @@
{
pid_t pid;
int xx;
+ int nothreads = 0; /* XXX: Shouldn't this be a global? */
if (sq->reaper) {
xx = rpmsqInsert(sq, NULL);
@@ -405,6 +417,24 @@
xx = sighold(SIGCHLD);
+ /*
+ * Initialize the cond var mutex. We have to aquire the lock we
+ * use for the condition before we fork. Otherwise it is possible for
+ * the child to exit, we get sigchild and the sig handler to send
+ * the condition signal before we are waiting on the condition.
+ */
+ if (!nothreads) {
+ if(pthread_mutex_lock(&sq->mutex)) {
+ /* Yack we did not get the lock, lets just give up */
+/*@-bounds@*/
+ xx = close(sq->pipes[0]);
+ xx = close(sq->pipes[1]);
+ sq->pipes[0] = sq->pipes[1] = -1;
+/*@=bounds@*/
+ goto out;
+ }
+ }
+
pid = fork();
if (pid < (pid_t) 0) { /* fork failed. */
/*@-bounds@*/
@@ -462,10 +492,6 @@
/* Protect sq->reaped from handler changes. */
ret = sighold(SIGCHLD);
- /* Initialize the cond var mutex. */
- if (!nothreads)
- ret = pthread_mutex_lock(&sq->mutex);
-
/* Start the child, linux often runs child before parent. */
/*@-bounds@*/
if (sq->pipes[0] >= 0)
@@ -486,7 +512,13 @@
ret = sigpause(SIGCHLD);
else {
xx = sigrelse(SIGCHLD);
- ret = pthread_cond_wait(&sq->cond, &sq->mutex);
+
+ /*
+ * We start before the fork with this mutex locked;
+ * The only one that unlocks this the signal handler.
+ * So if we get the lock the child has been reaped.
+ */
+ ret = pthread_mutex_lock(&sq->mutex);
xx = sighold(SIGCHLD);
}
}
@@ -495,9 +527,6 @@
/* Accumulate stopwatch time spent waiting, potential performance gain. */
sq->ms_scriptlets += rpmswExit(&sq->op, -1)/1000;
- /* Tear down cond var mutex, our child has been reaped. */
- if (!nothreads)
- xx = pthread_mutex_unlock(&sq->mutex);
xx = sigrelse(SIGCHLD);
#ifdef _RPMSQ_DEBUG

View File

@ -1,16 +0,0 @@
--- rpm-4.4.2/lib/rpmte.c.hack 2006-05-03 16:06:24.000000000 -0400
+++ rpm-4.4.2/lib/rpmte.c 2006-05-03 16:07:42.000000000 -0400
@@ -586,9 +586,10 @@
if (mydt != deptype)
/*@innercontinue@*/ continue;
ix &= 0x00ffffff;
-assert (ix < Count);
- colors[ix] |= val;
- refs[ix]++;
+ if (i < Count) {
+ colors[ix] |= val;
+ refs[ix]++;
+ }
}
}

View File

@ -1,27 +0,0 @@
--- rpm-4.4.2/lib/depends.c.order 2006-11-20 11:17:13.000000000 +0000
+++ rpm-4.4.2/lib/depends.c 2006-11-20 11:19:19.000000000 +0000
@@ -1421,7 +1421,14 @@
(void) rpmteSetDegree(q, 0);
tsbytes += rpmtePkgFileSize(q);
- ordering[orderingCount] = rpmteAddedKey(q);
+ switch (rpmteType(q)) {
+ case TR_ADDED:
+ ordering[orderingCount] = rpmteAddedKey(q);
+ /*@switchbreak@*/ break;
+ case TR_REMOVED:
+ ordering[orderingCount] = RPMAL_NOMATCH;
+ /*@switchbreak@*/ break;
+ }
orderingCount++;
qlen--;
loopcheck--;
@@ -1618,7 +1625,7 @@
continue;
j = needle->orIndex;
- if ((q = ts->order[j]) == NULL)
+ if ((q = ts->order[j]) == NULL || needle->pkgKey == RPMAL_NOMATCH)
continue;
newOrder[newOrderCount++] = q;

View File

@ -1,11 +0,0 @@
--- rpm-4.4.2/python/rpmts-py.c.unicode 2006-12-11 13:32:38.000000000 -0500
+++ rpm-4.4.2/python/rpmts-py.c 2006-12-11 13:33:13.000000000 -0500
@@ -1362,7 +1362,7 @@
if (Key) {
/*@-branchstate@*/
- if (PyString_Check(Key)) {
+ if (PyString_Check(Key) || PyUnicode_Check(Key)) {
key = PyString_AsString(Key);
len = PyString_Size(Key);
} else if (PyInt_Check(Key)) {

View File

@ -1,23 +0,0 @@
--- rpm-4.4.2/lib/rpmlock.c.userlock 2005-01-26 13:41:43.000000000 +0000
+++ rpm-4.4.2/lib/rpmlock.c 2007-03-13 10:33:15.000000000 +0000
@@ -37,9 +37,9 @@
/* XXX oneshot to determine path for fcntl lock. */
if (rpmlock_path == NULL) {
- char * t = rpmExpand(rpmlock_path_default, NULL);
+ char * t = rpmGenPath(rootdir, rpmlock_path_default, NULL);
if (t == NULL || *t == '\0' || *t == '%')
- t = RPMLOCK_PATH;
+ t = strdup(RPMLOCK_PATH);
rpmlock_path = xstrdup(t);
t = _free(t);
}
@@ -129,7 +129,7 @@
const char *rootDir = rpmtsRootDir(ts);
rpmlock lock;
- if (!rootDir)
+ if (!rootDir || rpmtsChrootDone(ts))
rootDir = "/";
lock = rpmlock_new(rootDir);
/*@-branchstate@*/

View File

@ -1,27 +0,0 @@
--- rpm-4.4.2/lib/rpmvercmp.c.vercmp 2005-07-03 22:32:22.000000000 -0400
+++ rpm-4.4.2/lib/rpmvercmp.c 2006-02-13 18:20:01.000000000 -0500
@@ -39,6 +39,9 @@
while (*one && !xisalnum(*one)) one++;
while (*two && !xisalnum(*two)) two++;
+ /* If we ran to the end of either, we are finished with the loop */
+ if (!(*one && *two)) break;
+
str1 = one;
str2 = two;
@@ -64,9 +67,13 @@
*str2 = '\0';
/*@=boundswrite@*/
+ /* this cannot happen, as we previously tested to make sure that */
+ /* the first string has a non-null segment */
+ if (one == str1) return -1; /* arbitrary */
+
/* take care of the case where the two version segments are */
/* different types: one numeric, the other alpha (i.e. empty) */
- if (one == str1) return -1; /* arbitrary */
+ /* numeric segments are always newer than alpha segments */
/* XXX See patch #60884 (and details) from bugzilla #50977. */
if (two == str2) return (isnum ? 1 : -1);

View File

@ -0,0 +1,87 @@
changeset: 6176:c0237c16e2e3
user: Panu Matilainen <pmatilai@redhat.com>
date: Fri Jul 20 10:41:15 2007 +0300
files: python/rpmmodule.c
description:
Add python methods for checking pending signals from rpmsqCaught.
- a thin wrapper for rpmdbCheckSignals() from rpm5.org / Jeff Johnson
- a function taking a list of signals to check and returning list caught
signals (python doesn't know about signal sets so rpmsqCaught needs
wrapping)
diff -r d8e2ec20c948 -r c0237c16e2e3 python/rpmmodule.c
--- a/python/rpmmodule.c Wed Jul 18 16:05:56 2007 +0300
+++ b/python/rpmmodule.c Fri Jul 20 10:41:15 2007 +0300
@@ -7,6 +7,7 @@
#include <rpmio_internal.h>
#include <rpmcli.h> /* XXX for rpmCheckSig */
#include <rpmdb.h>
+#include <rpmsq.h>
#include "legacy.h"
#include "misc.h"
@@ -58,6 +59,50 @@ static PyObject * archScore(PyObject * s
}
/**
+ * */
+static PyObject * signalsCaught(PyObject * self, PyObject * check)
+{
+ PyObject *caught, *o;
+ Py_ssize_t llen;
+ int signum, i;
+ sigset_t newMask, oldMask;
+
+ if (!PyList_Check(check)) {
+ PyErr_SetString(PyExc_TypeError, "list expected");
+ return NULL;
+ }
+
+ llen = PyList_Size(check);
+ caught = PyList_New(0);
+
+ /* block signals while checking for them */
+ (void) sigfillset(&newMask);
+ (void) sigprocmask(SIG_BLOCK, &newMask, &oldMask);
+
+ for (i = 0; i < llen; i++) {
+ o = PyList_GetItem(check, i);
+ signum = PyInt_AsLong(o);
+ if (sigismember(&rpmsqCaught, signum)) {
+ PyList_Append(caught, o);
+ }
+ }
+ (void) sigprocmask(SIG_SETMASK, &oldMask, NULL);
+
+ return caught;
+}
+
+/**
+ * */
+static PyObject * checkSignals(PyObject * self, PyObject * args)
+{
+ if (!PyArg_ParseTuple(args, ":checkSignals")) return NULL;
+ rpmdbCheckSignals();
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+/**
*/
static PyObject * setLogFile (PyObject * self, PyObject * args, PyObject *kwds)
{
@@ -145,6 +190,11 @@ static PyMethodDef rpmModuleMethods[] =
{ "archscore", (PyCFunction) archScore, METH_VARARGS|METH_KEYWORDS,
NULL },
+
+ { "signalsCaught", (PyCFunction) signalsCaught, METH_O,
+ NULL },
+ { "checkSignals", (PyCFunction) checkSignals, METH_VARARGS,
+ NULL },
{ "headerLoad", (PyCFunction) hdrLoad, METH_VARARGS|METH_KEYWORDS,
NULL },

View File

@ -0,0 +1,105 @@
changeset: 6179:fb37e4dccbf3
tag: tip
user: Panu Matilainen <pmatilai@redhat.com>
date: Sat Jul 21 15:05:19 2007 +0300
files: python/rpmmodule.c rpmdb/rpmdb.c rpmdb/rpmdb.h
description:
Make rpmdbCheckTerminate() non-terminating.
This allows use in exit handler without affecting exit code, and permits
caller to do its own cleanup if necessary.
diff -r e9ced408b17f -r fb37e4dccbf3 python/rpmmodule.c
--- a/python/rpmmodule.c Fri Jul 20 11:23:11 2007 +0300
+++ b/python/rpmmodule.c Sat Jul 21 15:05:19 2007 +0300
@@ -229,8 +229,6 @@ static PyMethodDef rpmModuleMethods[] =
/*
* Force clean up of open iterators and dbs on exit.
-* This ends up calling exit() while we're already exiting but exit
-* handlers will only get called once so it wont loop.
*/
static void rpm_exithook(void)
{
diff -r e9ced408b17f -r fb37e4dccbf3 rpmdb/rpmdb.c
--- a/rpmdb/rpmdb.c Fri Jul 20 11:23:11 2007 +0300
+++ b/rpmdb/rpmdb.c Sat Jul 21 15:05:19 2007 +0300
@@ -707,7 +707,7 @@ int rpmdbCheckTerminate(int terminate)
sigset_t newMask, oldMask;
static int terminating = 0;
- if (terminating) return 0;
+ if (terminating) return 1;
(void) sigfillset(&newMask); /* block all signals */
(void) sigprocmask(SIG_BLOCK, &newMask, &oldMask);
@@ -724,10 +724,6 @@ int rpmdbCheckTerminate(int terminate)
rpmdb db;
rpmdbMatchIterator mi;
-/*@-abstract@*/ /* sigset_t is abstract type */
- rpmMessage(RPMMESS_DEBUG, "Exiting on signal(0x%lx) ...\n", *((unsigned long *)&rpmsqCaught));
-/*@=abstract@*/
-
/*@-branchstate@*/
while ((mi = rpmmiRock) != NULL) {
/*@i@*/ rpmmiRock = mi->mi_next;
@@ -743,14 +739,20 @@ int rpmdbCheckTerminate(int terminate)
(void) rpmdbClose(db);
}
/*@=newreftrans@*/
+ }
+ sigprocmask(SIG_SETMASK, &oldMask, NULL);
+ return terminating;
+}
+
+int rpmdbCheckSignals(void)
+{
+ if (rpmdbCheckTerminate(0)) {
+/*@-abstract@*/ /* sigset_t is abstract type */
+ rpmMessage(RPMMESS_DEBUG, "Exiting on signal(0x%lx) ...\n", *((unsigned long *)&rpmsqCaught));
exit(EXIT_FAILURE);
- }
- return sigprocmask(SIG_SETMASK, &oldMask, NULL);
-}
-
-int rpmdbCheckSignals(void)
-{
- return rpmdbCheckTerminate(0);
+/*@=abstract@*/
+ }
+ return 0;
}
/**
diff -r e9ced408b17f -r fb37e4dccbf3 rpmdb/rpmdb.h
--- a/rpmdb/rpmdb.h Fri Jul 20 11:23:11 2007 +0300
+++ b/rpmdb/rpmdb.h Sat Jul 21 15:05:19 2007 +0300
@@ -1039,8 +1039,7 @@ Header rpmdbNextIterator(/*@null@*/ rpmd
/*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmdb
- * Check rpmdb signal handler for trapped signal exit. Just a compatibility
- * wrapper for rpmdbCheckTerminate()
+ * Check for and exit on termination signals.
*/
/*@mayexit@*/
int rpmdbCheckSignals(void)
@@ -1048,10 +1047,13 @@ int rpmdbCheckSignals(void)
/*@modifies fileSystem, internalState @*/;
/** \ingroup rpmdb
- * Check rpmdb signal handler for trapped signal or requested exit.
+ * Check rpmdb signal handler for trapped signal and/or requested exit,
+ * clean up any open iterators and databases on termination condition.
+ * On non-zero exit any open references to rpmdb are invalid and cannot
+ * be accessed anymore, calling process should terminate immediately.
* @param terminate 0 to only check for signals, 1 to terminate anyway
- */
-/*@mayexit@*/
+ * @return 0 to continue, 1 if termination cleanup was done.
+ */
int rpmdbCheckTerminate(int terminate);
/** \ingroup rpmdb

View File

@ -0,0 +1,87 @@
changeset: 6177:6acd7701e4df
user: Panu Matilainen <pmatilai@redhat.com>
date: Fri Jul 20 11:19:56 2007 +0300
files: rpmdb/rpmdb.c rpmdb/rpmdb.h
description:
Support explicitly asking from rpmdb cleanup + termination.
New rpmdbCheckTerminate() function which checks for termination signals
and allows requesting termination via parameter as well. Make
rpmdbCheckSignals() just a wrapper that calls it with terminate=0.
diff -r c0237c16e2e3 -r 6acd7701e4df rpmdb/rpmdb.c
--- a/rpmdb/rpmdb.c Fri Jul 20 10:41:15 2007 +0300
+++ b/rpmdb/rpmdb.c Fri Jul 20 11:19:56 2007 +0300
@@ -700,14 +700,14 @@ static rpmdb rpmdbRock;
/*@unchecked@*/ /*@exposed@*/ /*@null@*/
static rpmdbMatchIterator rpmmiRock;
-int rpmdbCheckSignals(void)
+int rpmdbCheckTerminate(int terminate)
/*@globals rpmdbRock, rpmmiRock @*/
/*@modifies rpmdbRock, rpmmiRock @*/
{
sigset_t newMask, oldMask;
- static int terminate = 0;
-
- if (terminate) return 0;
+ static int terminating = 0;
+
+ if (terminating) return 0;
(void) sigfillset(&newMask); /* block all signals */
(void) sigprocmask(SIG_BLOCK, &newMask, &oldMask);
@@ -716,10 +716,11 @@ int rpmdbCheckSignals(void)
|| sigismember(&rpmsqCaught, SIGQUIT)
|| sigismember(&rpmsqCaught, SIGHUP)
|| sigismember(&rpmsqCaught, SIGTERM)
- || sigismember(&rpmsqCaught, SIGPIPE))
- terminate = 1;
-
- if (terminate) {
+ || sigismember(&rpmsqCaught, SIGPIPE)
+ || terminate)
+ terminating = 1;
+
+ if (terminating) {
rpmdb db;
rpmdbMatchIterator mi;
@@ -745,6 +746,11 @@ int rpmdbCheckSignals(void)
exit(EXIT_FAILURE);
}
return sigprocmask(SIG_SETMASK, &oldMask, NULL);
+}
+
+int rpmdbCheckSignals(void)
+{
+ return rpmdbCheckTerminate(0);
}
/**
diff -r c0237c16e2e3 -r 6acd7701e4df rpmdb/rpmdb.h
--- a/rpmdb/rpmdb.h Fri Jul 20 10:41:15 2007 +0300
+++ b/rpmdb/rpmdb.h Fri Jul 20 11:19:56 2007 +0300
@@ -1039,12 +1039,20 @@ Header rpmdbNextIterator(/*@null@*/ rpmd
/*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmdb
- * Check rpmdb signal handler for trapped signal exit.
+ * Check rpmdb signal handler for trapped signal exit. Just a compatibility
+ * wrapper for rpmdbCheckTerminate()
*/
/*@mayexit@*/
int rpmdbCheckSignals(void)
/*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
+
+/** \ingroup rpmdb
+ * Check rpmdb signal handler for trapped signal or requested exit.
+ * @param terminate 0 to only check for signals, 1 to terminate anyway
+ */
+/*@mayexit@*/
+int rpmdbCheckTerminate(int terminate);
/** \ingroup rpmdb
* Destroy rpm database iterator.

View File

@ -0,0 +1,121 @@
changeset: 6235:0d4b8cfd8dc9
tag: tip
user: Panu Matilainen <pmatilai@redhat.com>
date: Thu Aug 09 15:15:24 2007 +0300
files: lib/rpmfi.c lib/rpmfi.h lib/transaction.c
description:
Avoid unnecessary .rpmnew and .rpmsave files (rhbz#128622)
Don't create .rpmnew and .rpmsave files when file/symlink on disk differs
just by timestamp. Patch by Tomas Mraz.
diff -r debbc872bbb3 -r 0d4b8cfd8dc9 lib/rpmfi.c
--- a/lib/rpmfi.c Thu Aug 09 14:18:11 2007 +0300
+++ b/lib/rpmfi.c Thu Aug 09 15:15:24 2007 +0300
@@ -22,6 +22,7 @@
#include "rpmte.h"
#include "rpmts.h"
+#include "legacy.h" /* XXX domd5 */
#include "misc.h" /* XXX stripTrailingChar */
#include "rpmmacro.h" /* XXX rpmCleanPath */
#include "legacy.h"
@@ -625,6 +626,49 @@ fileAction rpmfiDecideFate(const rpmfi o
* merge the difference ala CVS, but...
*/
return save;
+}
+/*@=boundsread@*/
+
+/*@-boundsread@*/
+int rpmfiConfigConflict(const rpmfi fi)
+{
+ const char * fn = rpmfiFN(fi);
+ int flags = rpmfiFFlags(fi);
+ char buffer[1024];
+ fileTypes newWhat, diskWhat;
+ struct stat sb;
+
+ if (!(flags & RPMFILE_CONFIG) || lstat(fn, &sb)) {
+ return 0;
+ }
+
+ diskWhat = whatis((int_16)sb.st_mode);
+ newWhat = whatis(rpmfiFMode(fi));
+
+ if (newWhat != LINK && newWhat != REG)
+ return 1;
+
+ if (diskWhat != newWhat)
+ return 1;
+
+ memset(buffer, 0, sizeof(buffer));
+ if (newWhat == REG) {
+ const unsigned char * nmd5;
+ if (domd5(fn, (unsigned char *)buffer, 0, NULL))
+ return 0; /* assume file has been removed */
+ nmd5 = rpmfiMD5(fi);
+ if (nmd5 && !memcmp(nmd5, buffer, 16))
+ return 0; /* unmodified config file */
+ } else /* newWhat == LINK */ {
+ const char * nFLink;
+ if (readlink(fn, buffer, sizeof(buffer) - 1) == -1)
+ return 0; /* assume file has been removed */
+ nFLink = rpmfiFLink(fi);
+ if (nFLink && !strcmp(nFLink, buffer))
+ return 0; /* unmodified config file */
+ }
+
+ return 1;
}
/*@=boundsread@*/
diff -r debbc872bbb3 -r 0d4b8cfd8dc9 lib/rpmfi.h
--- a/lib/rpmfi.h Thu Aug 09 14:18:11 2007 +0300
+++ b/lib/rpmfi.h Thu Aug 09 15:15:24 2007 +0300
@@ -620,6 +620,14 @@ fileAction rpmfiDecideFate(const rpmfi o
/*@modifies nfi, fileSystem, internalState @*/;
/**
+ * Return whether file is conflicting config
+ * @param fi file info
+ * @return 1 if config file and file on disk conflicts
+ */
+int rpmfiConfigConflict(const rpmfi fi)
+ /*@*/;
+
+/**
* Return formatted string representation of package disposition.
* @param fi file info set
* @return formatted string
diff -r debbc872bbb3 -r 0d4b8cfd8dc9 lib/transaction.c
--- a/lib/transaction.c Thu Aug 09 14:18:11 2007 +0300
+++ b/lib/transaction.c Thu Aug 09 15:15:24 2007 +0300
@@ -547,7 +547,7 @@ static void handleOverlappedFiles(const
/*@-boundswrite@*/
switch (rpmteType(p)) {
case TR_ADDED:
- { struct stat sb;
+ {
int reportConflicts =
!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_REPLACENEWFILES);
int done = 0;
@@ -556,7 +556,7 @@ static void handleOverlappedFiles(const
/* XXX is this test still necessary? */
if (fi->actions[i] != FA_UNKNOWN)
/*@switchbreak@*/ break;
- if ((FFlags & RPMFILE_CONFIG) && !lstat(fn, &sb)) {
+ if (rpmfiConfigConflict(fi)) {
/* Here is a non-overlapped pre-existing config file. */
fi->actions[i] = (FFlags & RPMFILE_NOREPLACE)
? FA_ALTNAME : FA_BACKUP;
@@ -613,7 +613,7 @@ assert(otherFi != NULL);
/* Try to get the disk accounting correct even if a conflict. */
fixupSize = rpmfiFSize(otherFi);
- if ((FFlags & RPMFILE_CONFIG) && !lstat(fn, &sb)) {
+ if (rpmfiConfigConflict(fi)) {
/* Here is an overlapped pre-existing config file. */
fi->actions[i] = (FFlags & RPMFILE_NOREPLACE)
? FA_ALTNAME : FA_SKIP;

View File

@ -0,0 +1,47 @@
changeset: 6178:e9ced408b17f
tag: tip
user: Panu Matilainen <pmatilai@redhat.com>
date: Fri Jul 20 11:23:11 2007 +0300
files: python/rpmmodule.c
description:
Force rpmdb clean termination on exit from python.
Python process tracebacking with active iterators can and will otherwise leave
stale locks around (as is presumably the reason for rhbz#235389 and various
other locking issues)
diff -r 6acd7701e4df -r e9ced408b17f python/rpmmodule.c
--- a/python/rpmmodule.c Fri Jul 20 11:19:56 2007 +0300
+++ b/python/rpmmodule.c Fri Jul 20 11:23:11 2007 +0300
@@ -227,6 +227,16 @@ static PyMethodDef rpmModuleMethods[] =
{ NULL }
} ;
+/*
+* Force clean up of open iterators and dbs on exit.
+* This ends up calling exit() while we're already exiting but exit
+* handlers will only get called once so it wont loop.
+*/
+static void rpm_exithook(void)
+{
+ rpmdbCheckTerminate(1);
+}
+
/**
*/
static char rpm__doc__[] =
@@ -263,6 +273,13 @@ void init_rpm(void)
m = Py_InitModule3("_rpm", rpmModuleMethods, rpm__doc__);
if (m == NULL)
+ return;
+
+ /*
+ * treat error to register rpm cleanup hook as fatal, tracebacks
+ * can and will leave stale locks around if we can't clean up
+ */
+ if (Py_AtExit(rpm_exithook) == -1)
return;
rpmReadConfigFiles(NULL, NULL);

View File

@ -0,0 +1,26 @@
diff -r e1802883bd62 -r cf3b54441b8a build/files.c
--- a/build/files.c Sat Jul 21 15:48:03 2007 +0300
+++ b/build/files.c Mon Jul 23 10:02:54 2007 +0300
@@ -1065,7 +1065,6 @@ static int compareFileListRecs(const voi
/**
* Test if file is located in a %docdir.
- * @bug Use of strstr(3) might result in false positives.
* @param fl package file tree walk data
* @param fileName file path
* @return 1 if doc file, 0 if not
@@ -1073,9 +1072,12 @@ static int isDoc(FileList fl, const char
static int isDoc(FileList fl, const char * fileName) /*@*/
{
int x = fl->docDirCount;
-
+ size_t k, l;
+
+ k = strlen(fileName);
while (x--) {
- if (strstr(fileName, fl->docDirs[x]) == fileName)
+ l = strlen(fl->docDirs[x]);
+ if (l < k && strncmp(fileName, fl->docDirs[x], l) == 0 && fileName[l] == '/')
return 1;
}
return 0;

View File

@ -0,0 +1,253 @@
diff -up rpm-4.4.2.2-rc2/python/Makefile.am.matchpathcon rpm-4.4.2.2-rc2/python/Makefile.am
--- rpm-4.4.2.2-rc2/python/Makefile.am.matchpathcon 2007-09-11 09:28:15.000000000 +0300
+++ rpm-4.4.2.2-rc2/python/Makefile.am 2007-09-27 11:05:29.000000000 +0300
@@ -34,7 +34,8 @@ mylibs= \
$(top_builddir)/rpmdb/librpmdb.la \
$(top_builddir)/rpmio/librpmio.la \
@WITH_POPT_LIB@ \
- @WITH_LIBELF_LIB@
+ @WITH_LIBELF_LIB@ \
+ @WITH_SELINUX_LIB@
LDADD =
diff -up rpm-4.4.2.2-rc2/python/rpmts-py.c.matchpathcon rpm-4.4.2.2-rc2/python/rpmts-py.c
--- rpm-4.4.2.2-rc2/python/rpmts-py.c.matchpathcon 2007-09-11 09:28:15.000000000 +0300
+++ rpm-4.4.2.2-rc2/python/rpmts-py.c 2007-09-27 11:25:29.000000000 +0300
@@ -1187,17 +1187,13 @@ rpmts_Run(rpmtsObject * s, PyObject * ar
}
/* Initialize security context patterns (if not already done). */
- if (!(s->ts->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
- rpmsx sx = rpmtsREContext(s->ts);
- if (sx == NULL) {
- const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
- if (fn != NULL && *fn != '\0') {
- sx = rpmsxNew(fn);
- (void) rpmtsSetREContext(s->ts, sx);
- }
- fn = _free(fn);
+ if (rpmtsSELinuxEnabled(s->ts) &&
+ !(s->ts->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
+ const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
+ if (fn != NULL && *fn != '\0') {
+ matchpathcon_init(fn);
}
- sx = rpmsxFree(sx);
+ fn = _free(fn);
}
if (_rpmts_debug)
diff -up rpm-4.4.2.2-rc2/build/Makefile.am.matchpathcon rpm-4.4.2.2-rc2/build/Makefile.am
--- rpm-4.4.2.2-rc2/build/Makefile.am.matchpathcon 2007-09-11 09:28:12.000000000 +0300
+++ rpm-4.4.2.2-rc2/build/Makefile.am 2007-09-27 11:05:29.000000000 +0300
@@ -35,6 +35,7 @@ librpmbuild_la_LDFLAGS = -release 4.4 $(
$(top_builddir)/lib/librpm.la \
$(top_builddir)/rpmdb/librpmdb.la \
$(top_builddir)/rpmio/librpmio.la \
+ @WITH_SELINUX_LIB@ \
@WITH_LIBELF_LIB@
rpmfile.h:
diff -up rpm-4.4.2.2-rc2/build/files.c.matchpathcon rpm-4.4.2.2-rc2/build/files.c
--- rpm-4.4.2.2-rc2/build/files.c.matchpathcon 2007-09-11 09:28:12.000000000 +0300
+++ rpm-4.4.2.2-rc2/build/files.c 2007-09-27 11:05:29.000000000 +0300
@@ -23,7 +23,7 @@
#define _RPMFI_INTERNAL
#include "rpmfi.h"
-#include "rpmsx.h"
+#include <selinux/selinux.h>
#define _RPMTE_INTERNAL
#include "rpmte.h"
@@ -1136,7 +1136,7 @@ static void genCpioListAndHeader(/*@part
int apathlen = 0;
int dpathlen = 0;
int skipLen = 0;
- rpmsx sx = NULL;
+ security_context_t scon = NULL;
const char * sxfn;
size_t fnlen;
FileListRec flp;
@@ -1156,7 +1156,7 @@ static void genCpioListAndHeader(/*@part
sxfn = rpmGetPath("%{?_build_file_context_path}", NULL);
if (sxfn != NULL && *sxfn != '\0')
- sx = rpmsxNew(sxfn);
+ matchpathcon_init(sxfn);
for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) {
const char *s;
@@ -1338,18 +1338,19 @@ static void genCpioListAndHeader(/*@part
&(flp->flags), 1);
/* Add file security context to package. */
-/*@-branchstate@*/
- if (sx != NULL) {
- mode_t fmode = (uint_16)flp->fl_mode;
- s = rpmsxFContext(sx, flp->fileURL, fmode);
- if (s == NULL) s = "";
- (void) headerAddOrAppendEntry(h, RPMTAG_FILECONTEXTS, RPM_STRING_ARRAY_TYPE,
- &s, 1);
- }
-/*@=branchstate@*/
+ mode_t fmode = (uint_16)flp->fl_mode;
+ int rc = matchpathcon(flp->fileURL, fmode, &scon);
+ if ( rc == 0 && scon != NULL) {
+ (void) headerAddOrAppendEntry(h, RPMTAG_FILECONTEXTS, RPM_STRING_ARRAY_TYPE, &scon, 1);
+ freecon(scon);
+ }
+ else {
+ const char *nocon = "";
+ (void) headerAddOrAppendEntry(h, RPMTAG_FILECONTEXTS, RPM_STRING_ARRAY_TYPE, &nocon, 1);
+ }
+
}
- sx = rpmsxFree(sx);
sxfn = _free(sxfn);
(void) headerAddEntry(h, RPMTAG_SIZE, RPM_INT32_TYPE,
diff -up rpm-4.4.2.2-rc2/lib/fsm.c.matchpathcon rpm-4.4.2.2-rc2/lib/fsm.c
--- rpm-4.4.2.2-rc2/lib/fsm.c.matchpathcon 2007-09-11 09:28:15.000000000 +0300
+++ rpm-4.4.2.2-rc2/lib/fsm.c 2007-09-27 11:28:30.000000000 +0300
@@ -634,12 +634,11 @@ static int fsmMapFContext(FSM_t fsm)
if (ts != NULL && rpmtsSELinuxEnabled(ts) == 1 &&
!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONTEXTS))
{
- rpmsx sx = rpmtsREContext(ts);
+ security_context_t scon = NULL;
- if (sx != NULL) {
+ if ( matchpathcon(fsm->path, st->st_mode, &scon) == 0 && scon != NULL) {
/* Get file security context from patterns. */
- fsm->fcontext = rpmsxFContext(sx, fsm->path, st->st_mode);
- sx = rpmsxFree(sx);
+ fsm->fcontext = scon;
} else {
int i = fsm->ix;
@@ -1277,7 +1276,7 @@ static int fsmMkdirs(/*@special@*/ /*@pa
/*@-compdef@*/
rpmts ts = fsmGetTs(fsm);
/*@=compdef@*/
- rpmsx sx = rpmtsREContext(ts);
+ security_context_t scon = NULL;
fsm->path = NULL;
@@ -1341,10 +1340,15 @@ static int fsmMkdirs(/*@special@*/ /*@pa
if (!rc) {
/* XXX FIXME? only new dir will have context set. */
/* Get file security context from patterns. */
- if (sx != NULL) {
- fsm->fcontext = rpmsxFContext(sx, fsm->path, st->st_mode);
- rc = fsmNext(fsm, FSM_LSETFCON);
+ if (rpmtsSELinuxEnabled(ts) &&
+ ! rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONTEXTS) {
+ if (matchpathcon(fsm->path, st->st_mode, &scon) == 0 &&
+ scon != NULL) {
+ fsm->fcontext = scon;
+ rc = fsmNext(fsm, FSM_LSETFCON);
+ }
}
+
if (fsm->fcontext == NULL)
rpmMessage(RPMMESS_DEBUG,
_("%s directory created with perms %04o, no context.\n"),
@@ -1377,7 +1381,6 @@ static int fsmMkdirs(/*@special@*/ /*@pa
}
/*@=boundswrite@*/
dnli = dnlFreeIterator(dnli);
- sx = rpmsxFree(sx);
/*@=observertrans =dependenttrans@*/
fsm->path = path;
diff -up rpm-4.4.2.2-rc2/lib/rpmfi.c.matchpathcon rpm-4.4.2.2-rc2/lib/rpmfi.c
--- rpm-4.4.2.2-rc2/lib/rpmfi.c.matchpathcon 2007-09-11 09:28:15.000000000 +0300
+++ rpm-4.4.2.2-rc2/lib/rpmfi.c 2007-09-27 11:05:29.000000000 +0300
@@ -16,7 +16,7 @@
#define _RPMFI_INTERNAL
#include "rpmfi.h"
-#include "rpmsx.h"
+#include <selinux/selinux.h>
#define _RPMTE_INTERNAL /* relocations */
#include "rpmte.h"
@@ -1697,8 +1697,8 @@ void rpmfiBuildREContexts(Header h,
{
int scareMem = 0;
rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, scareMem);
- rpmsx sx = NULL;
const char ** av = NULL;
+ const char * myfn = rpmGetPath("%{?__file_context_path}", NULL);
int ac;
size_t nb;
char * t;
@@ -1712,7 +1712,7 @@ void rpmfiBuildREContexts(Header h,
}
/* Read security context patterns. */
- sx = rpmsxNew(NULL);
+ matchpathcon_init(myfn);
/* Compute size of argv array blob, concatenating file contexts. */
nb = ac * sizeof(*fcnb);
@@ -1723,10 +1723,9 @@ void rpmfiBuildREContexts(Header h,
while (rpmfiNext(fi) >= 0) {
const char * fn = rpmfiFN(fi);
mode_t fmode = rpmfiFMode(fi);
- const char * scon;
+ security_context_t scon;
- scon = rpmsxFContext(sx, fn, fmode);
- if (scon != NULL) {
+ if (matchpathcon(fn, fmode, &scon) == 0) {
fcnb[ac] = strlen(scon) + 1;
/*@-branchstate@*/
if (fcnb[ac] > 0) {
@@ -1734,6 +1733,7 @@ void rpmfiBuildREContexts(Header h,
memcpy(fctxt+fctxtlen, scon, fcnb[ac]);
fctxtlen += fcnb[ac];
}
+ freecon(scon);
/*@=branchstate@*/
}
ac++;
@@ -1759,7 +1759,6 @@ void rpmfiBuildREContexts(Header h,
exit:
fi = rpmfiFree(fi);
- sx = rpmsxFree(sx);
/*@-branchstate@*/
if (fcontextp)
*fcontextp = av;
diff -up rpm-4.4.2.2-rc2/lib/rpminstall.c.matchpathcon rpm-4.4.2.2-rc2/lib/rpminstall.c
--- rpm-4.4.2.2-rc2/lib/rpminstall.c.matchpathcon 2007-09-11 09:28:15.000000000 +0300
+++ rpm-4.4.2.2-rc2/lib/rpminstall.c 2007-09-27 11:27:46.000000000 +0300
@@ -309,17 +309,12 @@ int rpmInstall(rpmts ts,
ia->transFlags |= RPMTRANS_FLAG_REPACKAGE;
/* Initialize security context patterns (if not already done). */
- if (!(ia->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
- rpmsx sx = rpmtsREContext(ts);
- if (sx == NULL) {
- const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
- if (fn != NULL && *fn != '\0') {
- sx = rpmsxNew(fn);
- (void) rpmtsSetREContext(ts, sx);
- }
- fn = _free(fn);
- }
- sx = rpmsxFree(sx);
+ if (rpmtsSELinuxEnabled(ts) &&
+ !(ia->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
+ const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
+ if (fn != NULL && *fn != '\0') {
+ matchpathcon_init(fn);
+ }
}
(void) rpmtsSetFlags(ts, ia->transFlags);

View File

@ -1,33 +0,0 @@
--- rpm-4.4.2/tools/debugedit.c.jj 2007-04-20 21:27:50.000000000 +0200
+++ rpm-4.4.2/tools/debugedit.c 2007-04-20 23:07:27.000000000 +0200
@@ -371,9 +371,10 @@ canonicalize_path (const char *s, char *
if (s[0] == '.' && (s[1] == 0 || IS_DIR_SEPARATOR (s[1])))
{
- s ++;
- if (!*s && d > droot)
- d--;
+ s++;
+ if (*s)
+ while (IS_DIR_SEPARATOR (*s))
+ ++s;
}
else if (s[0] == '.' && s[1] == '.'
@@ -401,8 +402,6 @@ canonicalize_path (const char *s, char *
if (*s)
while (IS_DIR_SEPARATOR (*s))
s++;
- else if (d > droot)
- d--;
}
}
else
@@ -411,7 +410,6 @@ canonicalize_path (const char *s, char *
*d++ = *s++;
}
}
-
else
{
while (*s && ! IS_DIR_SEPARATOR (*s))

317
rpm.spec
View File

@ -1,9 +1,6 @@
%define with_python_version 2.5%{nil}
%define with_apidocs 1%{nil}
# XXX legacy requires './' payload prefix to be omitted from rpm packages.
%define _noPayloadPrefix 1
%define __prefix %{?_prefix}%{!?_prefix:/usr}
%{?!_lib: %define _lib lib}
%{expand: %%define __share %(if [ -d %{__prefix}/share/man ]; then echo /share ; else echo %%{nil} ; fi)}
@ -15,64 +12,33 @@
Summary: The RPM package management system
Name: rpm
Version: 4.4.2
Version: 4.4.2.2
%{expand: %%define rpm_version %{version}}
Release: 46%{?dist}
Release: 2%{?dist}
Group: System Environment/Base
Url: http://www.rpm.org/
Source: rpm-%{rpm_version}.tar.gz
Source1: mono-find-provides
Source2: mono-find-requires
Patch0: rpm-4.4.1-hkp-disable.patch
Patch1: rpm-4.4.1-fileconflicts.patch
Patch2: rpm-4.4.1-prereq.patch
Patch3: rpm-4.4.1-nonmerged.patch
Patch4: rpm-4.4.1-prepostun.patch
Patch5: rpm-4.4.1-ordererase.patch
Patch6: rpm-4.4.2-matchpathcon.patch
Patch7: rpm-4.4.2-perlreq.patch
Patch8: rpm-4.4.2-db3-param.patch
Patch9: rpm-4.4.2-contextverify.patch
Patch10: rpm-4.4.2-popt-charset.patch
Patch11: rpm-4.4.2-ghost-conflicts.patch
Patch12: rpm-4.4.2-exclude.patch
Patch13: rpm-4.4.2-excluded-size.patch
Patch14: rpm-4.4.2-cronpath.patch
Patch15: rpm-4.4.2-mono.patch
Patch16: rpm-4.4.2-file-softmagic.patch
Patch17: rpm-4.4.2-no-large-mmap.patch
Patch18: rpm-4.4.2-perlmainprov.patch
Patch19: rpm-4.4.2-rpmsq-deadlock.patch
Patch20: rpm-4.4.2-netsharedpath.patch
Patch21: rpm-4.4.2-userlock.patch
Patch22: rpm-4.4.2-vercmp.patch
Patch23: rpm-4.4.2-doxy.patch
Patch24: rpm-4.4.2-trust.patch
Patch25: rpm-4.4.2-devel-autodep.patch
Patch26: rpm-4.4.2-rpmfc-skip.patch
Patch27: rpm-4.4.2-noselinux-verify.patch
Patch28: rpm-4.4.2-python-aslist.patch
Patch29: rpm-4.4.2-rpmio-ipv6.patch
Patch30: rpm-4.4.2-gnuhash.patch
Patch31: rpm-4.4.2-debugedit-ppc-reloc.patch
Patch32: rpm-4.4.2-debugpaths.patch
Patch33: rpm-4.4.2-transaction-order.patch
Patch34: rpm-4.4.2-debugopt.patch
Patch35: rpm-4.4.2-query-flushbuffer.patch
Patch36: rpm-4.4.2-unicodekey.patch
Patch37: rpm-4.4.2-noneon.patch
Patch38: rpm-4.4.2-debugedit-canonicalize-path.patch
Patch39: rpm-4.4.2-no-ppc-asm.patch
Patch40: rpm-4.4.2-forkfailed.patch
Patch41: rpm-4.4.2-cdiff.patch
Patch42: rpm-4.4.2-docflags.patch
Patch43: rpm-debugedit-incremental-fix.patch
Patch44: rpm-4.4.2-prefer-elf32.patch
License: GPL
Requires: patch > 2.5
Prereq: shadow-utils
Requires: popt = 1.10.2
Patch1: rpm-4.4.1-prereq.patch
Patch2: rpm-4.4.2-ghost-conflicts.patch
Patch3: rpm-4.4.2-trust.patch
Patch4: rpm-4.4.2-devel-autodep.patch
Patch5: rpm-4.4.2-rpmfc-skip.patch
Patch6: rpm-4.4.2.2-matchpathcon.patch
# XXX Beware, this is one murky license, partially GPL/LGPL dual-licensed
# and several different components with their own licenses included...
# XXX Beware, this is one murky license, partially GPL/LGPL dual-licensed
# and several different components with their own licenses included...
# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD and MIT and Sleepycat
License: GPLv2+
Requires(pre): shadow-utils
Requires(postun): shadow-utils
Requires(post): coreutils
Requires: popt >= 1.10.2.1
Requires: crontabs
Requires: logrotate
# explicit due to config.guess hackery
BuildRequires: redhat-rpm-config
BuildRequires: autoconf
BuildRequires: elfutils-devel >= 0.112
@ -90,8 +56,9 @@ BuildRequires: libselinux-devel
BuildRequires: ncurses-devel
BuildRequires: bzip2-devel >= 0.9.0c-2
BuildRequires: python-devel >= %{with_python_version}
BuildRequires: doxygen
BuildRoot: %{_tmppath}/%{name}-root
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
The RPM Package Manager (RPM) is a powerful command line driven
@ -103,7 +70,7 @@ the package like its version, a description, etc.
%package libs
Summary: Libraries for manipulating RPM packages
Group: Development/Libraries
Requires: rpm = %{rpm_version}-%{release}
Requires: rpm = %{version}-%{release}
%description libs
This package contains the RPM shared libraries.
@ -111,7 +78,7 @@ This package contains the RPM shared libraries.
%package devel
Summary: Development files for manipulating RPM packages
Group: Development/Libraries
Requires: rpm = %{rpm_version}-%{release}
Requires: rpm = %{version}-%{release}
Requires: beecrypt >= 4.1.2
Requires: sqlite-devel
Requires: libselinux-devel
@ -131,8 +98,10 @@ will manipulate RPM packages and databases.
%package build
Summary: Scripts and executable programs used to build packages
Group: Development/Tools
Requires: rpm = %{rpm_version}-%{release}, patch >= 2.5, file, elfutils
Requires: findutils
Requires: rpm = %{version}-%{release}
Requires: elfutils >= 0.128 binutils
Requires: findutils sed grep gawk diffutils file patch >= 2.5
Requires: zip gzip bzip2 cpio
Provides: rpmbuild(VendorConfig) = 4.1-1
%description build
@ -142,7 +111,7 @@ that are used to build packages using the RPM Package Manager.
%package python
Summary: Python bindings for apps which will manipulate RPM packages
Group: Development/Libraries
Requires: rpm = %{rpm_version}-%{release}
Requires: rpm = %{version}-%{release}
%description python
The rpm-python package contains a module that permits applications
@ -155,7 +124,8 @@ programs that will manipulate RPM packages and databases.
%package -n popt
Summary: A C library for parsing command line parameters
Group: Development/Libraries
Version: 1.10.2
Version: 1.10.2.2
License: MIT
%description -n popt
Popt is a C library for parsing command line parameters. Popt was
@ -168,55 +138,13 @@ functions for parsing arbitrary strings into argv[] arrays using
shell-like rules.
%prep
%setup -q
%patch0 -p1 -b .nohkp
%patch1 -p1 -b .fileconflicts
%patch2 -p1 -b .prereq
%patch3 -p1 -b .rpmal
%patch4 -p1 -b .prepostun
%patch5 -p1 -b .ordererase
# patch 6 moved
%patch7 -p1 -b .perlreq
%patch8 -p1 -b .param
%patch10 -p1 -b .charset
%patch11 -p1 -b .ghostconflicts
#patch12 -p1 -b .exclude
%patch13 -p1 -b .excludedsize
%patch14 -p1 -b .cronpath
%patch15 -p1 -b .mono
%patch16 -p1 -b .magic
%patch17 -p1 -b .no_large_mmap
%patch18 -p1 -b .perlmainprov
%patch19 -p1 -b .deadlock
%patch20 -p1 -b .netsharedpath
%patch21 -p1 -b .userlock
%patch22 -p1 -b .vercmp
%patch23 -p1 -b .doxy
%patch24 -p1 -b .trust
%patch25 -p1 -b .develdeps
%patch26 -p1 -b .fcskip
%patch27 -p0 -b .nosever
%patch6 -p1 -b .matchpathcon
%patch28 -p1 -b .aslist
%patch29 -p1 -b .ipv6
%patch30 -p1 -b .gnuhash
%patch31 -p0 -b .dbgppc
%patch32 -p1 -b .dbgpaths
%patch33 -p1 -b .order
%patch34 -p1 -b .dbgopt
%patch35 -p1 -b .flush
%patch36 -p1 -b .unicode
%patch37 -p1 -b .noneon
%patch38 -p0 -b .debugcan
%patch39 -p1 -b .noppcasm
%patch40 -p0 -b .forkfail
%patch41 -p1 -b .cdiff
%patch42 -p1 -b .docflags
%patch43 -p1 -b .debugcan2
%patch44 -p1 -b .elfprefer
# rebuild configure for ipv6
autoconf
%setup -q -n %{name}-%{rpm_version}
%patch1 -p1 -b .prereq
%patch2 -p1 -b .ghostconflicts
%patch3 -p1 -b .trust
%patch4 -p1 -b .develdeps
%patch5 -p1 -b .fcskip
%patch6 -p1 -b .matchpathcon
%build
@ -225,14 +153,18 @@ unset LD_ASSUME_KERNEL || :
WITH_PYTHON="--with-python=%{with_python_version}"
# XXX pull in updated config.guess and config.sub as done by %%configure
# which cannot be used to build rpm itself due to makefile brokenness
for i in $(find . -name config.guess -o -name config.sub) ; do
[ -f /usr/lib/rpm/redhat/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/redhat/$(basename $i) $i
done
CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS
./configure --prefix=%{__prefix} --sysconfdir=/etc \
--localstatedir=/var --infodir='${prefix}%{__share}/info' \
--mandir='${prefix}%{__share}/man' \
$WITH_PYTHON --enable-posixmutexes --without-javaglue
make -C zlib || :
make %{?_smp_mflags}
%install
@ -243,24 +175,9 @@ rm -rf $RPM_BUILD_ROOT
make DESTDIR="$RPM_BUILD_ROOT" install
# Working around breakage from the -L$(RPM_BUILD_ROOT)... -L$(DESTDIR)...
# workaround to #132435,
# and from linking to included zlib
for i in librpm.la librpmbuild.la librpmdb.la librpmio.la ; do
sed -i -e 's~-L'"$RPM_BUILD_ROOT"'[^ ]* ~~g' \
-e 's~-L'"$RPM_BUILD_DIR"'[^ ]* ~~g' \
"$RPM_BUILD_ROOT%{__libdir}/$i"
done
# Clean up dangling symlinks
# XXX Fix in rpm tree
for i in /usr/bin/rpme /usr/bin/rpmi /usr/bin/rpmu; do
rm -f "$RPM_BUILD_ROOT"/"$i"
done
# Clean up dangling symlinks
for i in /usr/lib/rpmpopt /usr/lib/rpmrc; do
rm -f "$RPM_BUILD_ROOT"/"$i"
# Clean up useless symlinks
for i in rpme rpmi rpmu; do
rm -f $RPM_BUILD_ROOT%{_bindir}/$i
done
# Save list of packages through cron
@ -284,34 +201,28 @@ do
touch $RPM_BUILD_ROOT/var/lib/rpm/$dbi
done
%find_lang %{name}
%find_lang popt
# copy db and file/libmagic license info to distinct names
cp -p db/LICENSE LICENSE-bdb
cp -p file/LEGAL.NOTICE LEGAL.NOTICE-file
cp -p lua/COPYRIGHT COPYRIGHT-lua
# Get rid of unpackaged files
{ cd $RPM_BUILD_ROOT
rm -f .%{_libdir}/lib*.la
rm -f .%{__prefix}/lib/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req}
rm -f .%{__prefix}/lib/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,rpm.*}
rm -rf .%{__mandir}/{fr,ko}
rm -f .%{__libdir}/python%{with_python_version}/site-packages/*.{a,la}
rm -f .%{__libdir}/python%{with_python_version}/site-packages/rpm/*.{a,la}
rm -f .%{__libdir}/python%{with_python_version}/site-packages/rpmdb/*.{a,la}
}
# Install mono find-provides/requires
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/usr/lib/rpm
install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/rpm
%clean
rm -rf $RPM_BUILD_ROOT
%pre
if [ -f /var/lib/rpm/packages.rpm ]; then
echo "
You have (unsupported)
/var/lib/rpm/packages.rpm db1 format installed package headers
Please install rpm-4.0.4 first, and do
rpm --rebuilddb
to convert your database from db1 to db3 format.
"
exit 1
fi
/usr/sbin/groupadd -g 37 rpm > /dev/null 2>&1
/usr/sbin/useradd -r -d /var/lib/rpm -u 37 -g 37 rpm -s /sbin/nologin > /dev/null 2>&1
exit 0
@ -349,13 +260,10 @@ exit 0
%define rpmattr %attr(0755, rpm, rpm)
%files
%files -f %{name}.lang
%defattr(-,root,root,-)
%doc RPM-PGP-KEY RPM-GPG-KEY BETA-GPG-KEY CHANGES GROUPS doc/manual/[a-z]*
# XXX comment these lines out if building with rpm that knows not %pubkey attr
%pubkey RPM-PGP-KEY
%pubkey RPM-GPG-KEY
%pubkey BETA-GPG-KEY
%doc CHANGES GROUPS COPYING LICENSE-bdb LEGAL.NOTICE-file CREDITS ChangeLog
%doc COPYRIGHT-lua doc/manual/[a-z]*
%attr(0755, rpm, rpm) /bin/rpm
/etc/cron.daily/rpm
@ -383,7 +291,6 @@ exit 0
%rpmattr %{__prefix}/lib/rpm/freshen.sh
%attr(0644, rpm, rpm) %{__prefix}/lib/rpm/macros
%rpmattr %{__prefix}/lib/rpm/mkinstalldirs
%rpmattr %{__prefix}/lib/rpm/rpm.*
%rpmattr %{__prefix}/lib/rpm/rpm2cpio.sh
%rpmattr %{__prefix}/lib/rpm/rpm[deiukqv]
%rpmattr %{__prefix}/lib/rpm/tgpg
@ -418,33 +325,14 @@ exit 0
%endif
%ifarch x86_64
%attr(-, rpm, rpm) %{__prefix}/lib/rpm/x86_64*
%attr(-, rpm, rpm) %{__prefix}/lib/rpm/ia32e*
%attr(-, rpm, rpm) %{__prefix}/lib/rpm/amd64*
%endif
%attr(-, rpm, rpm) %{__prefix}/lib/rpm/noarch*
%rpmattr %{__prefix}/lib/rpm/rpmdb_*
%rpmattr %{__prefix}/lib/rpm/rpmfile
%lang(cs) %{__prefix}/*/locale/cs/LC_MESSAGES/rpm.mo
%lang(da) %{__prefix}/*/locale/da/LC_MESSAGES/rpm.mo
%lang(de) %{__prefix}/*/locale/de/LC_MESSAGES/rpm.mo
%lang(fi) %{__prefix}/*/locale/fi/LC_MESSAGES/rpm.mo
%lang(fr) %{__prefix}/*/locale/fr/LC_MESSAGES/rpm.mo
%lang(gl) %{__prefix}/*/locale/gl/LC_MESSAGES/rpm.mo
%lang(is) %{__prefix}/*/locale/is/LC_MESSAGES/rpm.mo
%lang(ja) %{__prefix}/*/locale/ja/LC_MESSAGES/rpm.mo
%lang(ko) %{__prefix}/*/locale/ko/LC_MESSAGES/rpm.mo
%lang(no) %{__prefix}/*/locale/no/LC_MESSAGES/rpm.mo
%lang(pl) %{__prefix}/*/locale/pl/LC_MESSAGES/rpm.mo
%lang(pt) %{__prefix}/*/locale/pt/LC_MESSAGES/rpm.mo
%lang(pt_BR) %{__prefix}/*/locale/pt_BR/LC_MESSAGES/rpm.mo
%lang(ro) %{__prefix}/*/locale/ro/LC_MESSAGES/rpm.mo
%lang(ru) %{__prefix}/*/locale/ru/LC_MESSAGES/rpm.mo
%lang(sk) %{__prefix}/*/locale/sk/LC_MESSAGES/rpm.mo
%lang(sl) %{__prefix}/*/locale/sl/LC_MESSAGES/rpm.mo
%lang(sr) %{__prefix}/*/locale/sr/LC_MESSAGES/rpm.mo
%lang(sv) %{__prefix}/*/locale/sv/LC_MESSAGES/rpm.mo
%lang(tr) %{__prefix}/*/locale/tr/LC_MESSAGES/rpm.mo
%{__mandir}/man1/gendiff.1*
%{__mandir}/man8/rpm.8*
%{__mandir}/man8/rpm2cpio.8*
@ -471,9 +359,11 @@ exit 0
%{__prefix}/src/redhat/RPMS/*
%rpmattr %{__bindir}/rpmbuild
%rpmattr %{__prefix}/lib/rpm/brp-*
%rpmattr %{__prefix}/lib/rpm/check-buildroot
%rpmattr %{__prefix}/lib/rpm/check-files
%rpmattr %{__prefix}/lib/rpm/check-prereqs
%rpmattr %{__prefix}/lib/rpm/config.site
%rpmattr %{__prefix}/lib/rpm/check-rpaths*
%attr(0644, rpm, rpm) %{__prefix}/lib/rpm/config.site
%rpmattr %{__prefix}/lib/rpm/cross-build
%rpmattr %{__prefix}/lib/rpm/debugedit
%rpmattr %{__prefix}/lib/rpm/find-debuginfo.sh
@ -488,10 +378,10 @@ exit 0
%rpmattr %{__prefix}/lib/rpm/getpo.sh
%rpmattr %{__prefix}/lib/rpm/http.req
%rpmattr %{__prefix}/lib/rpm/javadeps
%rpmattr %{__prefix}/lib/rpm/magic
%rpmattr %{__prefix}/lib/rpm/magic.mgc
%rpmattr %{__prefix}/lib/rpm/magic.mime
%rpmattr %{__prefix}/lib/rpm/magic.mime.mgc
%attr(0644, rpm, rpm) %{__prefix}/lib/rpm/magic
%attr(0644, rpm, rpm) %{__prefix}/lib/rpm/magic.mgc
%attr(0644, rpm, rpm) %{__prefix}/lib/rpm/magic.mime
%attr(0644, rpm, rpm) %{__prefix}/lib/rpm/magic.mime.mgc
%rpmattr %{__prefix}/lib/rpm/magic.prov
%rpmattr %{__prefix}/lib/rpm/magic.req
%rpmattr %{__prefix}/lib/rpm/mono-find-provides
@ -534,40 +424,10 @@ exit 0
%rpmattr %{__prefix}/lib/rpm/rpmcache
%rpmattr %{__bindir}/rpmgraph
%files -n popt
%files -n popt -f popt.lang
%defattr(-,root,root)
%{__libdir}/libpopt.so.*
%{__mandir}/man3/popt.3*
%lang(cs) %{__prefix}/*/locale/cs/LC_MESSAGES/popt.mo
%lang(da) %{__prefix}/*/locale/da/LC_MESSAGES/popt.mo
%lang(de) %{__prefix}/*/locale/de/LC_MESSAGES/popt.mo
%lang(es) %{__prefix}/*/locale/es/LC_MESSAGES/popt.mo
%lang(eu_ES) %{__prefix}/*/locale/eu_ES/LC_MESSAGES/popt.mo
%lang(fi) %{__prefix}/*/locale/fi/LC_MESSAGES/popt.mo
%lang(fr) %{__prefix}/*/locale/fr/LC_MESSAGES/popt.mo
%lang(gl) %{__prefix}/*/locale/gl/LC_MESSAGES/popt.mo
%lang(hu) %{__prefix}/*/locale/hu/LC_MESSAGES/popt.mo
%lang(id) %{__prefix}/*/locale/id/LC_MESSAGES/popt.mo
%lang(is) %{__prefix}/*/locale/is/LC_MESSAGES/popt.mo
%lang(it) %{__prefix}/*/locale/it/LC_MESSAGES/popt.mo
%lang(ja) %{__prefix}/*/locale/ja/LC_MESSAGES/popt.mo
%lang(ko) %{__prefix}/*/locale/ko/LC_MESSAGES/popt.mo
%lang(no) %{__prefix}/*/locale/no/LC_MESSAGES/popt.mo
%lang(pl) %{__prefix}/*/locale/pl/LC_MESSAGES/popt.mo
%lang(pt) %{__prefix}/*/locale/pt/LC_MESSAGES/popt.mo
%lang(pt_BR) %{__prefix}/*/locale/pt_BR/LC_MESSAGES/popt.mo
%lang(ro) %{__prefix}/*/locale/ro/LC_MESSAGES/popt.mo
%lang(ru) %{__prefix}/*/locale/ru/LC_MESSAGES/popt.mo
%lang(sk) %{__prefix}/*/locale/sk/LC_MESSAGES/popt.mo
%lang(sl) %{__prefix}/*/locale/sl/LC_MESSAGES/popt.mo
%lang(sr) %{__prefix}/*/locale/sr/LC_MESSAGES/popt.mo
%lang(sv) %{__prefix}/*/locale/sv/LC_MESSAGES/popt.mo
%lang(tr) %{__prefix}/*/locale/tr/LC_MESSAGES/popt.mo
%lang(uk) %{__prefix}/*/locale/uk/LC_MESSAGES/popt.mo
%lang(wa) %{__prefix}/*/locale/wa/LC_MESSAGES/popt.mo
%lang(zh) %{__prefix}/*/locale/zh/LC_MESSAGES/popt.mo
%lang(zh_CN) %{__prefix}/*/locale/zh_CN/LC_MESSAGES/popt.mo
%lang(zh_TW) %{__prefix}/*/locale/zh_TW/LC_MESSAGES/popt.mo
# XXX These may end up in popt-devel but it hardly seems worth the effort.
%{__libdir}/libpopt.a
@ -575,6 +435,41 @@ exit 0
%{__includedir}/popt.h
%changelog
* Fri Oct 12 2007 Panu Matilainen <pmatilai@redhat.com> 4.4.2.2-2
- remember to bump popt version too
* Fri Oct 12 2007 Panu Matilainen <pmatilai@redhat.com> 4.4.2.2-1
- rebase to 4.4.2.2
- add bunch of previously implicit dependencies for rpm-build (#316201)
- pull in updated config.guess to get _host macro correct (#259761)
- explicitly buildrequire redhat-rpm-config for the config.guess hack
- further license clarification per fedora guidelines
- improved matchpathcon patch (#259421)
* Mon Aug 13 2007 Panu Matilainen <pmatilai@redhat.com> - 4.4.2.1-1
- update to 4.4.2.1 (#247749 and others)
- drop upstreamed patches and sources
- loosen up popt-dependency to prepare for splitting it off
- avoid unnecessary .rpmsave / .rpmnew files by Tomas Mraz (#29470, #128622)
- stricter docdir checking by Ralf S. Engelschall (#246819)
- license clarifications
- include full ChangeLog as doc
- require logrotate (#248629)
- allow checking for pending signals from python (#181434)
- add hook to python for cleaning up on unclean exit (#245389)
- spec / package (review) cleanups:
- use find_lang instead of manually listing translations
- remove useless rpm 3.x upgrade check from preinstall script
- use Fedora recommended buildroot
- don't include useless, ancient GPG keys
- add rpm, db, file and lua licenses to docs
- use scriptlet dependency markers instead of PreReq
- post scriptlet requires coreutils
- main package doesn't require patch, rpm-build does
- buildrequire doxygen once more to resurrect apidocs
- remove useless/doubly packaged files from /usr/lib/rpm
- fix bunch of file permissions
* Tue May 01 2007 Paul Nasrat <pnasrat@redhat.com> - 4.4.2-46
- Configurable policy for prefered ELF (#235757)

View File

@ -1 +1 @@
e24ce468082479fe850c9d6563f56db5 rpm-4.4.2.tar.gz
15faa7ebd9791ade1a2f8181821ac259 rpm-4.4.2.2.tar.gz