Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
165614f3dd | ||
|
367ec3f990 | ||
|
7a8cd25c20 | ||
|
afee5b61a3 | ||
|
b0b7f20ef8 | ||
|
76d3f4014f | ||
|
3b6a3d6051 | ||
|
8e0e97732b | ||
|
cecc1e8906 | ||
|
03c3322d9a |
22
.gitignore
vendored
22
.gitignore
vendored
@ -18,25 +18,3 @@
|
||||
/rpm-4.12.0-rc1.tar.bz2
|
||||
/rpm-4.12.0.tar.bz2
|
||||
/rpm-4.12.0.1.tar.bz2
|
||||
/rpm-4.12.90.tar.bz2
|
||||
/rpm-4.13.0-rc1.tar.bz2
|
||||
/rpm-4.13.0-rc2.tar.bz2
|
||||
/rpm-4.13.0.tar.bz2
|
||||
/rpm-4.13.0.1.tar.bz2
|
||||
/rpm-4.13.90-git14002.tar.bz2
|
||||
/rpm-4.14.0-rc1.tar.bz2
|
||||
/rpm-4.14.0-rc2.tar.bz2
|
||||
/rpm-4.14.0.tar.bz2
|
||||
/rpm-4.14.1.tar.bz2
|
||||
/rpm-4.14.2-rc1.tar.bz2
|
||||
/rpm-4.14.2-rc2.tar.bz2
|
||||
/rpm-4.14.2.tar.bz2
|
||||
/rpm-4.14.2.1.tar.bz2
|
||||
/rpm-4.14.90-git14653.tar.bz2
|
||||
/rpm-4.15.0-beta.tar.bz2
|
||||
/rpm-4.15.0-rc1.tar.bz2
|
||||
/rpm-4.15.0.tar.bz2
|
||||
/rpm-4.15.1.tar.bz2
|
||||
/rpm-4.15.90-git14971.tar.bz2
|
||||
/rpm-4.16.0-beta1.tar.bz2
|
||||
/rpm-4.16.0-beta3.tar.bz2
|
||||
|
37
0001-Fix-find-debuginfo.sh-for-ELF-with-file-warnings.patch
Normal file
37
0001-Fix-find-debuginfo.sh-for-ELF-with-file-warnings.patch
Normal file
@ -0,0 +1,37 @@
|
||||
From 4f58e5abcb336292f78bc6d54e1140b4fdded30b Mon Sep 17 00:00:00 2001
|
||||
From: Pascal Terjan <pterjan@mandriva.org>
|
||||
Date: Sat, 14 Feb 2015 21:58:19 +0000
|
||||
Subject: [PATCH] Fix find-debuginfo.sh for ELF with file warnings
|
||||
|
||||
Since the fix for CVE-2014-9620, file will print a "warning" that it
|
||||
only processed 256 notes:
|
||||
|
||||
$ file -N libjvm.so
|
||||
libjvm.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=63ece24db1a29f9df8231337f741664e0b10fc7f, not stripped, too many notes (256)
|
||||
|
||||
And this leads to those messages and a failure:
|
||||
stat: cannot stat 'libjvm.so,': No such file or directory
|
||||
stat: cannot stat 'too': No such file or directory
|
||||
stat: cannot stat 'many': No such file or directory
|
||||
stat: cannot stat 'notes': No such file or directory
|
||||
stat: cannot stat '(256)': No such file or directory
|
||||
---
|
||||
scripts/find-debuginfo.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
|
||||
index 57449f7..264fad5 100644
|
||||
--- a/scripts/find-debuginfo.sh
|
||||
+++ b/scripts/find-debuginfo.sh
|
||||
@@ -205,7 +205,7 @@ $strict || strict_error=WARNING
|
||||
find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \
|
||||
\( -perm -0100 -or -perm -0010 -or -perm -0001 \) \
|
||||
-print |
|
||||
-file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p' |
|
||||
+file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped.*/\1/p' |
|
||||
xargs --no-run-if-empty stat -c '%h %D_%i %n' |
|
||||
while read nlinks inum f; do
|
||||
get_debugfn "$f"
|
||||
--
|
||||
2.3.0
|
||||
|
@ -1,95 +0,0 @@
|
||||
From 2426c2a066e44f4d9a342585e76cdbdb0a8a2db1 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Robinson <pbrobinson@gmail.com>
|
||||
Date: Wed, 23 Oct 2019 20:22:19 +0100
|
||||
Subject: [PATCH] Revert "Improve ARM detection"
|
||||
|
||||
This reverts commit 8c3a7b8fa92b49a811fe36b60857b12f5d7db8a8.
|
||||
|
||||
This is the final piece in fixing rhbz 1691430. It's a clean revert
|
||||
so let's do that for F-31 and we can discuss the details later.
|
||||
|
||||
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
|
||||
---
|
||||
lib/rpmrc.c | 37 +++++++++----------------------------
|
||||
1 file changed, 9 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/lib/rpmrc.c b/lib/rpmrc.c
|
||||
index 0806e1b07..cada3f788 100644
|
||||
--- a/lib/rpmrc.c
|
||||
+++ b/lib/rpmrc.c
|
||||
@@ -82,7 +82,6 @@ struct rpmOption {
|
||||
static struct rpmat_s {
|
||||
const char *platform;
|
||||
uint64_t hwcap;
|
||||
- uint64_t hwcap2;
|
||||
} rpmat;
|
||||
|
||||
typedef struct defaultEntry_s {
|
||||
@@ -951,9 +950,6 @@ static int is_geode(void)
|
||||
|
||||
|
||||
#if defined(__linux__)
|
||||
-#ifndef AT_HWCAP2 /* glibc < 2.18 */
|
||||
-#define AT_HWCAP2 26
|
||||
-#endif
|
||||
/**
|
||||
* Populate rpmat structure with auxv values
|
||||
*/
|
||||
@@ -967,7 +963,6 @@ static void read_auxv(void)
|
||||
if (!rpmat.platform)
|
||||
rpmat.platform = "";
|
||||
rpmat.hwcap = getauxval(AT_HWCAP);
|
||||
- rpmat.hwcap2 = getauxval(AT_HWCAP2);
|
||||
#else
|
||||
rpmat.platform = "";
|
||||
int fd = open("/proc/self/auxv", O_RDONLY);
|
||||
@@ -989,9 +984,6 @@ static void read_auxv(void)
|
||||
case AT_HWCAP:
|
||||
rpmat.hwcap = auxv.a_un.a_val;
|
||||
break;
|
||||
- case AT_HWCAP2:
|
||||
- rpmat.hwcap2 = auxv.a_un.a_val;
|
||||
- break;
|
||||
}
|
||||
}
|
||||
close(fd);
|
||||
@@ -1225,27 +1217,16 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
|
||||
# if !defined(HWCAP_ARM_VFPv3)
|
||||
# define HWCAP_ARM_VFPv3 (1 << 13)
|
||||
# endif
|
||||
-# if !defined(HWCAP2_AES)
|
||||
-# define HWCAP2_AES (1 << 0)
|
||||
-# endif
|
||||
- /*
|
||||
- * un.machine is armvXE, where X is version number and E is
|
||||
- * endianness (b or l)
|
||||
- */
|
||||
- if (rstreqn(un.machine, "armv", 4)) {
|
||||
- char endian = un.machine[strlen(un.machine)-1];
|
||||
- char *modifier = un.machine + 5;
|
||||
- /* keep armv7, armv8, armv9, armv10, ... */
|
||||
- while(risdigit(*modifier))
|
||||
- modifier++;
|
||||
- if (rpmat.hwcap & HWCAP_ARM_VFPv3)
|
||||
- *modifier++ = 'h';
|
||||
- if (rpmat.hwcap2 & HWCAP2_AES)
|
||||
- *modifier++ = 'c';
|
||||
+ if (rstreq(un.machine, "armv7l")) {
|
||||
+ if (rpmat.hwcap & HWCAP_ARM_VFPv3) {
|
||||
if (rpmat.hwcap & HWCAP_ARM_NEON)
|
||||
- *modifier++ = 'n';
|
||||
- *modifier++ = endian;
|
||||
- *modifier++ = 0;
|
||||
+ strcpy(un.machine, "armv7hnl");
|
||||
+ else
|
||||
+ strcpy(un.machine, "armv7hl");
|
||||
+ }
|
||||
+ } else if (rstreq(un.machine, "armv6l")) {
|
||||
+ if (rpmat.hwcap & HWCAP_ARM_VFP)
|
||||
+ strcpy(un.machine, "armv6hl");
|
||||
}
|
||||
# endif /* arm*-linux */
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
@ -1,30 +0,0 @@
|
||||
From f2bc669cd0a080792522dd1bb7f50ef7025f16f0 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sat, 21 Jul 2018 10:13:04 +0200
|
||||
Subject: [PATCH] find-debuginfo.sh: decompress DWARF compressed ELF sections
|
||||
|
||||
debugedit and dwz do not support DWARF compressed ELF sections, let's
|
||||
just decompress those before extracting debuginfo.
|
||||
|
||||
Tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||
---
|
||||
scripts/find-debuginfo.sh | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
|
||||
index 90a44942d..7b01bc036 100755
|
||||
--- a/scripts/find-debuginfo.sh
|
||||
+++ b/scripts/find-debuginfo.sh
|
||||
@@ -357,6 +357,9 @@ do_file()
|
||||
get_debugfn "$f"
|
||||
[ -f "${debugfn}" ] && return
|
||||
|
||||
+ echo "explicitly decompress any DWARF compressed ELF sections in $f"
|
||||
+ eu-elfcompress -q -p -t none "$f"
|
||||
+
|
||||
echo "extracting debug info from $f"
|
||||
# See also cpio SOURCEFILE copy. Directories must match up.
|
||||
debug_base_name="$RPM_BUILD_DIR"
|
||||
--
|
||||
2.18.0
|
||||
|
101
rpm-4.10.0-dwz-debuginfo.patch
Normal file
101
rpm-4.10.0-dwz-debuginfo.patch
Normal file
@ -0,0 +1,101 @@
|
||||
--- rpm-4.10.0/scripts/find-debuginfo.sh 2012-03-20 09:07:25.000000000 +0100
|
||||
+++ rpm-4.10.0/scripts/find-debuginfo.sh.jj 2012-06-19 12:32:33.147503858 +0200
|
||||
@@ -4,6 +4,8 @@
|
||||
#
|
||||
# Usage: find-debuginfo.sh [--strict-build-id] [-g] [-r]
|
||||
# [-o debugfiles.list]
|
||||
+# [--run-dwz] [--dwz-low-mem-die-limit N]
|
||||
+# [--dwz-max-die-limit N]
|
||||
# [[-l filelist]... [-p 'pattern'] -o debuginfo.list]
|
||||
# [builddir]
|
||||
#
|
||||
@@ -20,6 +22,10 @@
|
||||
# The -p argument is an grep -E -style regexp matching the a file name,
|
||||
# and must not use anchors (^ or $).
|
||||
#
|
||||
+# The --run-dwz flag instructs find-debuginfo.sh to run the dwz utility
|
||||
+# if available, and --dwz-low-mem-die-limit and --dwz-max-die-limit
|
||||
+# provide detailed limits. See dwz(1) -l and -L option for details.
|
||||
+#
|
||||
# All file names in switches are relative to builddir (. if not given).
|
||||
#
|
||||
|
||||
@@ -32,6 +38,11 @@ strip_r=false
|
||||
# Barf on missing build IDs.
|
||||
strict=false
|
||||
|
||||
+# DWZ parameters.
|
||||
+run_dwz=false
|
||||
+dwz_low_mem_die_limit=
|
||||
+dwz_max_die_limit=
|
||||
+
|
||||
BUILDDIR=.
|
||||
out=debugfiles.list
|
||||
nout=0
|
||||
@@ -40,6 +51,17 @@ while [ $# -gt 0 ]; do
|
||||
--strict-build-id)
|
||||
strict=true
|
||||
;;
|
||||
+ --run-dwz)
|
||||
+ run_dwz=true
|
||||
+ ;;
|
||||
+ --dwz-low-mem-die-limit)
|
||||
+ dwz_low_mem_die_limit=$2
|
||||
+ shift
|
||||
+ ;;
|
||||
+ --dwz-max-die-limit)
|
||||
+ dwz_max_die_limit=$2
|
||||
+ shift
|
||||
+ ;;
|
||||
-g)
|
||||
strip_g=true
|
||||
;;
|
||||
@@ -266,6 +288,37 @@ while read nlinks inum f; do
|
||||
fi
|
||||
done || exit
|
||||
|
||||
+# Invoke the DWARF Compressor utility.
|
||||
+if $run_dwz && type dwz >/dev/null 2>&1 \
|
||||
+ && [ -d "${RPM_BUILD_ROOT}/usr/lib/debug" ]; then
|
||||
+ dwz_files="`cd "${RPM_BUILD_ROOT}/usr/lib/debug"; find -type f -name \*.debug`"
|
||||
+ if [ -n "${dwz_files}" ]; then
|
||||
+ dwz_multifile_name="${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}-${RPM_PACKAGE_RELEASE}.${RPM_ARCH}"
|
||||
+ dwz_multifile_suffix=
|
||||
+ dwz_multifile_idx=0
|
||||
+ while [ -f "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}${dwz_multifile_suffix}" ]; do
|
||||
+ let ++dwz_multifile_idx
|
||||
+ dwz_multifile_suffix=".${dwz_multifile_idx}"
|
||||
+ done
|
||||
+ dwz_multfile_name="${dwz_multifile_name}${dwz_multifile_suffix}"
|
||||
+ dwz_opts="-h -q -r -m .dwz/${dwz_multifile_name}"
|
||||
+ mkdir -p "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz"
|
||||
+ [ -n "${dwz_low_mem_die_limit}" ] \
|
||||
+ && dwz_opts="${dwz_opts} -l ${dwz_low_mem_die_limit}"
|
||||
+ [ -n "${dwz_max_die_limit}" ] \
|
||||
+ && dwz_opts="${dwz_opts} -L ${dwz_max_die_limit}"
|
||||
+ ( cd "${RPM_BUILD_ROOT}/usr/lib/debug" && dwz $dwz_opts $dwz_files )
|
||||
+ # Remove .dwz directory if empty
|
||||
+ rmdir "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz" 2>/dev/null
|
||||
+ if [ -f "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}" ]; then
|
||||
+ id="`readelf -Wn "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}" \
|
||||
+ 2>/dev/null | sed -n 's/^ Build ID: \([0-9a-f]\+\)/\1/p'`"
|
||||
+ [ -n "$id" ] \
|
||||
+ && make_id_link "$id" "/usr/lib/debug/.dwz/${dwz_multifile_name}" .debug
|
||||
+ fi
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
# For each symlink whose target has a .debug file,
|
||||
# make a .debug symlink to that file.
|
||||
find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*" -type l -print |
|
||||
--- rpm-4.10.0/macros.in 2012-03-20 09:07:25.000000000 +0100
|
||||
+++ rpm-4.10.0/macros.in.jj 2012-06-19 12:32:33.147503858 +0200
|
||||
@@ -176,7 +176,7 @@
|
||||
# the script. See the script for details.
|
||||
#
|
||||
%__debug_install_post \
|
||||
- %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
|
||||
+ %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
|
||||
%{nil}
|
||||
|
||||
# Template for debug information sub-package.
|
98
rpm-4.10.0-minidebuginfo.patch
Normal file
98
rpm-4.10.0-minidebuginfo.patch
Normal file
@ -0,0 +1,98 @@
|
||||
--- rpm-4.10.0/macros.in 2012-06-11 11:16:21.216952339 +0200
|
||||
+++ rpm-4.10.0/macros.in.minidebug 2012-06-11 11:16:23.686912455 +0200
|
||||
@@ -175,7 +175,7 @@
|
||||
# the script. See the script for details.
|
||||
#
|
||||
%__debug_install_post \
|
||||
- %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
|
||||
+ %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
|
||||
%{nil}
|
||||
|
||||
# Template for debug information sub-package.
|
||||
@@ -418,6 +418,12 @@ package or when debugging this package.\
|
||||
#%_missing_build_ids_terminate_build 1
|
||||
|
||||
#
|
||||
+# Include minimal debug information in build binaries.
|
||||
+# Requires _enable_debug_packages.
|
||||
+#
|
||||
+#%_include_minidebuginfo 1
|
||||
+
|
||||
+#
|
||||
# Use internal dependency generator rather than external helpers?
|
||||
%_use_internal_dependency_generator 1
|
||||
|
||||
--- rpm-4.10.0/scripts/find-debuginfo.sh 2012-06-11 11:16:09.698138273 +0200
|
||||
+++ rpm-4.10.0/scripts/find-debuginfo.sh.minidebug 2012-06-11 11:16:13.399078526 +0200
|
||||
@@ -2,7 +2,7 @@
|
||||
#find-debuginfo.sh - automagically generate debug info and file list
|
||||
#for inclusion in an rpm spec file.
|
||||
#
|
||||
-# Usage: find-debuginfo.sh [--strict-build-id] [-g] [-r]
|
||||
+# Usage: find-debuginfo.sh [--strict-build-id] [-g] [-r] [-m]
|
||||
# [-o debugfiles.list]
|
||||
# [--run-dwz] [--dwz-low-mem-die-limit N]
|
||||
# [--dwz-max-die-limit N]
|
||||
@@ -29,6 +29,9 @@ strip_g=false
|
||||
# with -r arg, pass --reloc-debug-sections to eu-strip.
|
||||
strip_r=false
|
||||
|
||||
+# with -m arg, add minimal debuginfo to binary.
|
||||
+include_minidebug=false
|
||||
+
|
||||
# Barf on missing build IDs.
|
||||
strict=false
|
||||
|
||||
@@ -43,6 +46,9 @@ while [ $# -gt 0 ]; do
|
||||
-g)
|
||||
strip_g=true
|
||||
;;
|
||||
+ -m)
|
||||
+ include_minidebug=true
|
||||
+ ;;
|
||||
-o)
|
||||
if [ -z "${lists[$nout]}" -a -z "${ptns[$nout]}" ]; then
|
||||
out=$2
|
||||
@@ -105,6 +111,32 @@ strip_to_debug()
|
||||
chmod 444 "$1" || exit
|
||||
}
|
||||
|
||||
+add_minidebug()
|
||||
+{
|
||||
+ local debuginfo="$1"
|
||||
+ local binary="$2"
|
||||
+
|
||||
+ local dynsyms=`mktemp`
|
||||
+ local funcsyms=`mktemp`
|
||||
+ local keep_symbols=`mktemp`
|
||||
+ local mini_debuginfo=`mktemp`
|
||||
+
|
||||
+ # Extract the dynamic symbols from the main binary, there is no need to also have these
|
||||
+ # in the normal symbol table
|
||||
+ nm -D "$binary" --format=posix --defined-only | awk '{ print $1 }' | sort > "$dynsyms"
|
||||
+ # Extract all the text (i.e. function) symbols from the debuginfo
|
||||
+ nm "$debuginfo" --format=posix --defined-only | awk '{ if ($2 == "T" || $2 == "t") print $1 }' | sort > "$funcsyms"
|
||||
+ # Keep all the function symbols not already in the dynamic symbol table
|
||||
+ comm -13 "$dynsyms" "$funcsyms" > "$keep_symbols"
|
||||
+ # Copy the full debuginfo, keeping only a minumal set of symbols and removing some unnecessary sections
|
||||
+ objcopy -S --remove-section .gdb_index --remove-section .comment --keep-symbols="$keep_symbols" "$debuginfo" "$mini_debuginfo" &> /dev/null
|
||||
+ #Inject the compressed data into the .gnu_debugdata section of the original binary
|
||||
+ xz "$mini_debuginfo"
|
||||
+ mini_debuginfo="${mini_debuginfo}.xz"
|
||||
+ objcopy --add-section .gnu_debugdata="$mini_debuginfo" "$binary"
|
||||
+ rm -f "$dynsyms" "$funcsyms" "$keep_symbols" "$mini_debuginfo"
|
||||
+}
|
||||
+
|
||||
# Make a relative symlink to $1 called $3$2
|
||||
shopt -s extglob
|
||||
link_relative()
|
||||
@@ -260,6 +292,9 @@ while read nlinks inum f; do
|
||||
chmod u-w "$f"
|
||||
fi
|
||||
|
||||
+ $include_minidebug && add_minidebug "${debugfn}" "$f"
|
||||
+
|
||||
+
|
||||
if [ -n "$id" ]; then
|
||||
make_id_link "$id" "$dn/$(basename $f)"
|
||||
make_id_link "$id" "/usr/lib/debug$dn/$bn" .debug
|
394
rpm-4.11.1-sepdebugcrcfix.patch
Normal file
394
rpm-4.11.1-sepdebugcrcfix.patch
Normal file
@ -0,0 +1,394 @@
|
||||
--- rpm-4.11.1-rc1-orig/Makefile.am 2013-06-07 12:19:21.000000000 +0200
|
||||
+++ rpm-4.11.1-rc1/Makefile.am 2013-06-24 18:34:06.342894002 +0200
|
||||
@@ -162,6 +162,10 @@ rpmlibexec_PROGRAMS += elfdeps
|
||||
elfdeps_SOURCES = tools/elfdeps.c
|
||||
elfdeps_LDADD = rpmio/librpmio.la
|
||||
elfdeps_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
|
||||
+
|
||||
+rpmlibexec_PROGRAMS += sepdebugcrcfix
|
||||
+sepdebugcrcfix_SOURCES = tools/sepdebugcrcfix.c
|
||||
+sepdebugcrcfix_LDADD = @WITH_LIBELF_LIB@
|
||||
endif
|
||||
endif
|
||||
|
||||
--- rpm-4.11.1-rc1-orig/scripts/find-debuginfo.sh 2013-06-24 17:20:55.407538301 +0200
|
||||
+++ rpm-4.11.1-rc1/scripts/find-debuginfo.sh 2013-06-24 18:34:41.270897302 +0200
|
||||
@@ -114,10 +114,12 @@ done
|
||||
LISTFILE="$BUILDDIR/$out"
|
||||
SOURCEFILE="$BUILDDIR/debugsources.list"
|
||||
LINKSFILE="$BUILDDIR/debuglinks.list"
|
||||
+ELFBINSFILE="$BUILDDIR/elfbins.list"
|
||||
|
||||
> "$SOURCEFILE"
|
||||
> "$LISTFILE"
|
||||
> "$LINKSFILE"
|
||||
+> "$ELFBINSFILE"
|
||||
|
||||
debugdir="${RPM_BUILD_ROOT}/usr/lib/debug"
|
||||
|
||||
@@ -316,6 +318,7 @@ while read nlinks inum f; do
|
||||
|
||||
$include_minidebug && add_minidebug "${debugfn}" "$f"
|
||||
|
||||
+ echo "./${f#$RPM_BUILD_ROOT}" >> "$ELFBINSFILE"
|
||||
|
||||
if [ -n "$id" ]; then
|
||||
make_id_link "$id" "$dn/$(basename $f)"
|
||||
@@ -354,6 +357,10 @@ if $run_dwz && type dwz >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
+# dwz invalidates .gnu_debuglink CRC32 in the main files.
|
||||
+cat "$ELFBINSFILE" |
|
||||
+(cd "$RPM_BUILD_ROOT"; xargs -d '\n' /usr/lib/rpm/sepdebugcrcfix usr/lib/debug)
|
||||
+
|
||||
# For each symlink whose target has a .debug file,
|
||||
# make a .debug symlink to that file.
|
||||
find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*" -type l -print |
|
||||
--- rpm-4.11.1-rc1-orig/tools/sepdebugcrcfix.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ rpm-4.11.1-rc1/tools/sepdebugcrcfix.c 2013-06-24 18:31:54.927881439 +0200
|
||||
@@ -0,0 +1,344 @@
|
||||
+/* Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+/* Version 2013-06-24. */
|
||||
+
|
||||
+#define _GNU_SOURCE
|
||||
+#include <string.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <errno.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <unistd.h>
|
||||
+#include <sys/mman.h>
|
||||
+#include <endian.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <error.h>
|
||||
+#include <libelf.h>
|
||||
+#include <gelf.h>
|
||||
+#include <bfd.h>
|
||||
+
|
||||
+#define _(x) x
|
||||
+#define static_assert(expr) \
|
||||
+ extern int never_defined_just_used_for_checking[(expr) ? 1 : -1]
|
||||
+#ifndef min
|
||||
+# define min(a, b) ((a) < (b) ? (a) : (b))
|
||||
+#endif
|
||||
+
|
||||
+static_assert (sizeof (unsigned long) >= sizeof (uint32_t));
|
||||
+
|
||||
+typedef int bool;
|
||||
+static const bool false = 0, true = 1;
|
||||
+
|
||||
+/* This is bfd_calc_gnu_debuglink_crc32 from bfd/opncls.c. */
|
||||
+static unsigned long
|
||||
+ calc_gnu_debuglink_crc32 (unsigned long crc,
|
||||
+ const unsigned char *buf,
|
||||
+ bfd_size_type len)
|
||||
+{
|
||||
+ static const unsigned long crc32_table[256] =
|
||||
+ {
|
||||
+ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
|
||||
+ 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
|
||||
+ 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,
|
||||
+ 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
|
||||
+ 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,
|
||||
+ 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
|
||||
+ 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,
|
||||
+ 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
|
||||
+ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,
|
||||
+ 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,
|
||||
+ 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,
|
||||
+ 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
|
||||
+ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,
|
||||
+ 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
|
||||
+ 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,
|
||||
+ 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
|
||||
+ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,
|
||||
+ 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
|
||||
+ 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,
|
||||
+ 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
|
||||
+ 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,
|
||||
+ 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
|
||||
+ 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,
|
||||
+ 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
|
||||
+ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,
|
||||
+ 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,
|
||||
+ 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,
|
||||
+ 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
|
||||
+ 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,
|
||||
+ 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
|
||||
+ 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,
|
||||
+ 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
|
||||
+ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,
|
||||
+ 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,
|
||||
+ 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,
|
||||
+ 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
|
||||
+ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,
|
||||
+ 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
|
||||
+ 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,
|
||||
+ 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
|
||||
+ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,
|
||||
+ 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
|
||||
+ 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,
|
||||
+ 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
|
||||
+ 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,
|
||||
+ 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
|
||||
+ 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,
|
||||
+ 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
|
||||
+ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,
|
||||
+ 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,
|
||||
+ 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,
|
||||
+ 0x2d02ef8d
|
||||
+ };
|
||||
+ const unsigned char *end;
|
||||
+
|
||||
+ crc = ~crc & 0xffffffff;
|
||||
+ for (end = buf + len; buf < end; ++ buf)
|
||||
+ crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8);
|
||||
+ return ~crc & 0xffffffff;
|
||||
+}
|
||||
+
|
||||
+static size_t updated_count, matched_count, failed_count;
|
||||
+
|
||||
+static const char *usr_lib_debug;
|
||||
+
|
||||
+static bool
|
||||
+crc32 (const char *fname, const char *base_fname, uint32_t *crcp)
|
||||
+{
|
||||
+ char *reldir = strdup (base_fname);
|
||||
+ if (reldir == NULL)
|
||||
+ error (1, 0, _("out of memory"));
|
||||
+ char *s = reldir + strlen (reldir);
|
||||
+ while (s > reldir && s[-1] != '/')
|
||||
+ *--s = '\0';
|
||||
+ char *debugname;
|
||||
+ if (asprintf (&debugname, "%s/%s/%s", usr_lib_debug, reldir, fname) <= 0)
|
||||
+ error (1, 0, _("out of memory"));
|
||||
+ free (reldir);
|
||||
+ int fd = open (debugname, O_RDONLY);
|
||||
+ if (fd == -1)
|
||||
+ {
|
||||
+ error (0, errno, _("cannot open \"%s\""), debugname);
|
||||
+ return false;
|
||||
+ }
|
||||
+ off64_t size = lseek64 (fd, 0, SEEK_END);
|
||||
+ if (size == -1)
|
||||
+ {
|
||||
+ error (0, errno, _("cannot get size of \"%s\""), debugname);
|
||||
+ return false;
|
||||
+ }
|
||||
+ off_t offset = 0;
|
||||
+ uint32_t crc = 0;
|
||||
+ void *buf = NULL;
|
||||
+ while (offset < size)
|
||||
+ {
|
||||
+ const size_t maplen = min (0x10000, size - offset);
|
||||
+ void *map = NULL;
|
||||
+ if (buf == NULL)
|
||||
+ {
|
||||
+ map = mmap (NULL, maplen, PROT_READ, MAP_PRIVATE | MAP_POPULATE,
|
||||
+ fd, offset);
|
||||
+ if (map == MAP_FAILED)
|
||||
+ {
|
||||
+ error (0, errno, _("cannot map 0x%llx bytes at offset 0x%llx "
|
||||
+ "of file \"%s\""),
|
||||
+ (unsigned long long) maplen, (unsigned long long) offset,
|
||||
+ debugname);
|
||||
+ map = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ if (map == NULL)
|
||||
+ {
|
||||
+ if (buf == NULL)
|
||||
+ {
|
||||
+ buf = malloc (maplen);
|
||||
+ if (buf == NULL)
|
||||
+ error (1, 0, _("out of memory"));
|
||||
+ }
|
||||
+ ssize_t got = pread (fd, buf, maplen, offset);
|
||||
+ if (got != maplen)
|
||||
+ {
|
||||
+ error (0, errno, _("cannot read 0x%llx bytes at offset 0x%llx "
|
||||
+ "of file \"%s\""),
|
||||
+ (unsigned long long) maplen, (unsigned long long) offset,
|
||||
+ debugname);
|
||||
+ free (buf);
|
||||
+ free (debugname);
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+ crc = calc_gnu_debuglink_crc32 (crc, map ?: buf, maplen);
|
||||
+ if (map && munmap (map, maplen) != 0)
|
||||
+ error (1, errno, _("cannot unmap 0x%llx bytes at offset 0x%llx "
|
||||
+ "of file \"%s\""),
|
||||
+ (unsigned long long) maplen, (unsigned long long) offset,
|
||||
+ debugname);
|
||||
+ offset += maplen;
|
||||
+ }
|
||||
+ free (buf);
|
||||
+ if (close (fd) != 0)
|
||||
+ {
|
||||
+ error (0, errno, _("cannot close \"%s\""), debugname);
|
||||
+ free (debugname);
|
||||
+ return false;
|
||||
+ }
|
||||
+ free (debugname);
|
||||
+ *crcp = crc;
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+static bool
|
||||
+process (Elf *elf, int fd, const char *fname)
|
||||
+{
|
||||
+ GElf_Ehdr ehdr_mem, *ehdr = gelf_getehdr (elf, &ehdr_mem);
|
||||
+ if (ehdr == NULL)
|
||||
+ {
|
||||
+ error (0, 0, _("cannot get ELF header of \"%s\""), fname);
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB
|
||||
+ && ehdr->e_ident[EI_DATA] != ELFDATA2MSB)
|
||||
+ {
|
||||
+ error (0, 0, _("invalid ELF endianity of \"%s\""), fname);
|
||||
+ return false;
|
||||
+ }
|
||||
+ Elf_Scn *scn = NULL;
|
||||
+ const char scnname[] = ".gnu_debuglink";
|
||||
+ while ((scn = elf_nextscn (elf, scn)) != NULL)
|
||||
+ {
|
||||
+ GElf_Shdr shdr_mem, *shdr = gelf_getshdr (scn, &shdr_mem);
|
||||
+ if (shdr == NULL)
|
||||
+ {
|
||||
+ error (0, 0, _("cannot get section # %zu in \"%s\""),
|
||||
+ elf_ndxscn (scn), fname);
|
||||
+ continue;
|
||||
+ }
|
||||
+ const char *sname = elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name);
|
||||
+ if (sname == NULL)
|
||||
+ {
|
||||
+ error (0, 0, _("cannot get name of section # %zu in \"%s\""),
|
||||
+ elf_ndxscn (scn), fname);
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (strcmp (sname, scnname) != 0)
|
||||
+ continue;
|
||||
+ Elf_Data *data = elf_getdata (scn, NULL);
|
||||
+ if (data == NULL)
|
||||
+ {
|
||||
+ error (0, 0, _("cannot get data of section \"%s\" # %zu in \"%s\""),
|
||||
+ scnname, elf_ndxscn (scn), fname);
|
||||
+ continue;
|
||||
+ }
|
||||
+ if ((data->d_size & 3) != 0)
|
||||
+ {
|
||||
+ error (0, 0, _("invalid size of section \"%s\" # %zu in \"%s\""),
|
||||
+ scnname, elf_ndxscn (scn), fname);
|
||||
+ continue;
|
||||
+ }
|
||||
+ const uint8_t *zerop = memchr (data->d_buf, '\0', data->d_size);
|
||||
+ const uint8_t *crcp = (zerop == NULL
|
||||
+ ? NULL
|
||||
+ : (const uint8_t *) ((uintptr_t) (zerop + 1 + 3)
|
||||
+ & -4));
|
||||
+ if (crcp + 4 != (uint8_t *) data->d_buf + data->d_size)
|
||||
+ {
|
||||
+ error (0, 0, _("invalid format of section \"%s\" # %zu in \"%s\""),
|
||||
+ scnname, elf_ndxscn (scn), fname);
|
||||
+ continue;
|
||||
+ }
|
||||
+ uint32_t had_crc_targetendian = *(const uint32_t *) crcp;
|
||||
+ uint32_t had_crc = (ehdr->e_ident[EI_DATA] == ELFDATA2LSB
|
||||
+ ? le32toh (had_crc_targetendian)
|
||||
+ : be32toh (had_crc_targetendian));
|
||||
+ uint32_t crc;
|
||||
+ if (! crc32 (data->d_buf, fname, &crc))
|
||||
+ return false;
|
||||
+ if (crc == had_crc)
|
||||
+ {
|
||||
+ matched_count++;
|
||||
+ return true;
|
||||
+ }
|
||||
+ updated_count++;
|
||||
+ off64_t seekto = (shdr->sh_offset + data->d_off
|
||||
+ + (crcp - (const uint8_t *) data->d_buf));
|
||||
+ uint32_t crc_targetendian = (ehdr->e_ident[EI_DATA] == ELFDATA2LSB
|
||||
+ ? htole32 (crc) : htobe32 (crc));
|
||||
+ ssize_t wrote = pwrite (fd, &crc_targetendian, sizeof (crc_targetendian),
|
||||
+ seekto);
|
||||
+ if (wrote != sizeof (crc_targetendian))
|
||||
+ {
|
||||
+ error (0, 0, _("cannot write new CRC to 0x%llx "
|
||||
+ "inside section \"%s\" # %zu in \"%s\""),
|
||||
+ (unsigned long long) seekto, scnname, elf_ndxscn (scn), fname);
|
||||
+ return false;
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+ error (0, 0, _("cannot find section \"%s\" in \"%s\""), scnname, fname);
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (int argc, char **argv)
|
||||
+{
|
||||
+ if (argc < 2)
|
||||
+ error (1, 0, _("usr/lib/debug [<relative filenames>...]"));
|
||||
+ usr_lib_debug = argv[1];
|
||||
+ if (elf_version (EV_CURRENT) == EV_NONE)
|
||||
+ error (1, 0, _("error initializing libelf: %s"), elf_errmsg (-1));
|
||||
+ for (int argi = 2; argi < argc; argi++)
|
||||
+ {
|
||||
+ const char *fname = argv[argi];
|
||||
+ int fd = open64 (fname, O_RDWR);
|
||||
+ if (fd == -1)
|
||||
+ {
|
||||
+ error (0, errno, _("cannot open \"%s\""), fname);
|
||||
+ failed_count++;
|
||||
+ continue;
|
||||
+ }
|
||||
+ bool failed = false;
|
||||
+ Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
|
||||
+ if (elf == NULL)
|
||||
+ {
|
||||
+ error (0, 0, _("cannot open \"%s\" as ELF: %s"), fname,
|
||||
+ elf_errmsg (-1));
|
||||
+ failed = true;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (! process (elf, fd, fname))
|
||||
+ failed = true;
|
||||
+ if (elf_end (elf) != 0)
|
||||
+ {
|
||||
+ error (0, 0, _("cannot close \"%s\" as ELF: %s"), fname,
|
||||
+ elf_errmsg (-1));
|
||||
+ failed = true;
|
||||
+ }
|
||||
+ }
|
||||
+ if (close (fd) != 0)
|
||||
+ {
|
||||
+ error (0, errno, _("cannot close \"%s\""), fname);
|
||||
+ failed = true;
|
||||
+ }
|
||||
+ if (failed)
|
||||
+ failed_count++;
|
||||
+ }
|
||||
+ printf ("%s: Updated %zu CRC32s, %zu CRC32s did match.\n", argv[0],
|
||||
+ updated_count, matched_count);
|
||||
+ if (failed_count)
|
||||
+ printf ("%s: Failed for %zu files.\n", argv[0], failed_count);
|
||||
+ return failed_count == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
+}
|
@ -8,5 +8,5 @@ diff -up rpm-4.11.1-rc1/macros.in.siteconfig rpm-4.11.1-rc1/macros.in
|
||||
+ CONFIG_SITE=${CONFIG_SITE:-NONE}\
|
||||
+ export CONFIG_SITE\
|
||||
\
|
||||
%{verbose:set -x}\
|
||||
%{verbose:set -x}%{!verbose:exec > /dev/null}\
|
||||
umask 022\
|
29
rpm-4.12.0-Fix-Python3-import.patch
Normal file
29
rpm-4.12.0-Fix-Python3-import.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From 97989236c0f39ccbc7f2c1d52cc30f167fd827fe Mon Sep 17 00:00:00 2001
|
||||
From: Florian Festi <ffesti@redhat.com>
|
||||
Date: Mon, 26 Jan 2015 14:22:34 +0100
|
||||
Subject: [PATCH] Fix Python import directive for more strict Python3 search
|
||||
rules
|
||||
|
||||
Fixes http://rpm.org/ticket/885
|
||||
---
|
||||
python/rpm/transaction.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/python/rpm/transaction.py b/python/rpm/transaction.py
|
||||
index db7ca67..91a6cc1 100644
|
||||
--- a/python/rpm/transaction.py
|
||||
+++ b/python/rpm/transaction.py
|
||||
@@ -37,8 +37,8 @@ class TransactionSet(TransactionSetCore):
|
||||
return self._wrapSetGet('_probFilter', ignoreSet)
|
||||
|
||||
def parseSpec(self, specfile):
|
||||
- import _rpmb
|
||||
- return _rpmb.spec(specfile)
|
||||
+ import rpm._rpmb
|
||||
+ return rpm._rpmb.spec(specfile)
|
||||
|
||||
def getKeys(self):
|
||||
keys = []
|
||||
--
|
||||
2.1.0
|
||||
|
76
rpm-4.12.0-archive-endian.patch
Normal file
76
rpm-4.12.0-archive-endian.patch
Normal file
@ -0,0 +1,76 @@
|
||||
commit 104856ea17161eb3a508913c2b7ed701f2e4f6aa
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Tue Oct 7 15:37:21 2014 +0300
|
||||
|
||||
Unbreak size and archive size generation on big-endian systems
|
||||
|
||||
- Fix regression from commit 68bddc353a7ea87ea00ad957858cd509e845e84c,
|
||||
accessing a 64bit int as if it were a 32bit one doesn't make it one.
|
||||
|
||||
diff --git a/build/pack.c b/build/pack.c
|
||||
index 28834dc..15f005a 100644
|
||||
--- a/build/pack.c
|
||||
+++ b/build/pack.c
|
||||
@@ -273,9 +273,6 @@ static rpmRC generateSignature(char *SHA1, uint8_t *MD5, rpm_loff_t size,
|
||||
{
|
||||
Header sig = NULL;
|
||||
struct rpmtd_s td;
|
||||
- rpmTagVal sizetag;
|
||||
- rpmTagVal payloadtag;
|
||||
- rpm_tagtype_t typetag;
|
||||
rpmRC rc = RPMRC_OK;
|
||||
char *reservedSpace;
|
||||
int spaceSize = 0;
|
||||
@@ -297,29 +294,33 @@ static rpmRC generateSignature(char *SHA1, uint8_t *MD5, rpm_loff_t size,
|
||||
td.data = MD5;
|
||||
headerPut(sig, &td, HEADERPUT_DEFAULT);
|
||||
|
||||
+ rpmtdReset(&td);
|
||||
+ td.count = 1;
|
||||
if (payloadSize < UINT32_MAX) {
|
||||
- sizetag = RPMSIGTAG_SIZE;
|
||||
- payloadtag = RPMSIGTAG_PAYLOADSIZE;
|
||||
- typetag = RPM_INT32_TYPE;
|
||||
+ rpm_off_t p = payloadSize;
|
||||
+ rpm_off_t s = size;
|
||||
+ td.type = RPM_INT32_TYPE;
|
||||
+
|
||||
+ td.tag = RPMSIGTAG_PAYLOADSIZE;
|
||||
+ td.data = &p;
|
||||
+ headerPut(sig, &td, HEADERPUT_DEFAULT);
|
||||
+
|
||||
+ td.tag = RPMSIGTAG_SIZE;
|
||||
+ td.data = &s;
|
||||
+ headerPut(sig, &td, HEADERPUT_DEFAULT);
|
||||
} else {
|
||||
- sizetag = RPMSIGTAG_LONGSIZE;
|
||||
- payloadtag = RPMSIGTAG_LONGARCHIVESIZE;
|
||||
- typetag = RPM_INT64_TYPE;
|
||||
- }
|
||||
+ rpm_loff_t p = payloadSize;
|
||||
+ rpm_loff_t s = size;
|
||||
+ td.type = RPM_INT64_TYPE;
|
||||
|
||||
- rpmtdReset(&td);
|
||||
- td.tag = payloadtag;
|
||||
- td.count = 1;
|
||||
- td.type = typetag;
|
||||
- td.data = &payloadSize;
|
||||
- headerPut(sig, &td, HEADERPUT_DEFAULT);
|
||||
+ td.tag = RPMSIGTAG_LONGARCHIVESIZE;
|
||||
+ td.data = &p;
|
||||
+ headerPut(sig, &td, HEADERPUT_DEFAULT);
|
||||
|
||||
- rpmtdReset(&td);
|
||||
- td.tag = sizetag;
|
||||
- td.count = 1;
|
||||
- td.type = typetag;
|
||||
- td.data = &size;
|
||||
- headerPut(sig, &td, HEADERPUT_DEFAULT);
|
||||
+ td.tag = RPMSIGTAG_LONGSIZE;
|
||||
+ td.data = &s;
|
||||
+ headerPut(sig, &td, HEADERPUT_DEFAULT);
|
||||
+ }
|
||||
|
||||
spaceSize = rpmExpandNumeric("%{__gpg_reserved_space}");
|
||||
if(spaceSize > 0) {
|
59
rpm-4.12.0-fix-crash-on-corrupted.patch
Normal file
59
rpm-4.12.0-fix-crash-on-corrupted.patch
Normal file
@ -0,0 +1,59 @@
|
||||
From 9c36ca411332d2718eca339e867561c39abc256b Mon Sep 17 00:00:00 2001
|
||||
From: Lubos Kardos <lkardos@redhat.com>
|
||||
Date: Fri, 6 Nov 2015 14:49:59 +0100
|
||||
Subject: [PATCH] Fix crash when parsing corrupted RPM file (rhbz:1273360)
|
||||
|
||||
---
|
||||
lib/legacy.c | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/lib/legacy.c b/lib/legacy.c
|
||||
index 422c2b0..8ba7bbd 100644
|
||||
--- a/lib/legacy.c
|
||||
+++ b/lib/legacy.c
|
||||
@@ -25,7 +25,7 @@ static void compressFilelist(Header h)
|
||||
char ** dirNames;
|
||||
const char ** baseNames;
|
||||
uint32_t * dirIndexes;
|
||||
- rpm_count_t count;
|
||||
+ rpm_count_t count, realCount = 0;
|
||||
int i;
|
||||
int dirIndex = -1;
|
||||
|
||||
@@ -58,6 +58,7 @@ static void compressFilelist(Header h)
|
||||
while ((i = rpmtdNext(&fileNames)) >= 0) {
|
||||
dirIndexes[i] = dirIndex;
|
||||
baseNames[i] = rpmtdGetString(&fileNames);
|
||||
+ realCount++;
|
||||
}
|
||||
goto exit;
|
||||
}
|
||||
@@ -87,19 +88,20 @@ static void compressFilelist(Header h)
|
||||
(needle = bsearch(&filename, dirNames, dirIndex + 1, sizeof(dirNames[0]), dncmp)) == NULL) {
|
||||
char *s = xmalloc(len + 1);
|
||||
rstrlcpy(s, filename, len + 1);
|
||||
- dirIndexes[i] = ++dirIndex;
|
||||
+ dirIndexes[realCount] = ++dirIndex;
|
||||
dirNames[dirIndex] = s;
|
||||
} else
|
||||
- dirIndexes[i] = needle - dirNames;
|
||||
+ dirIndexes[realCount] = needle - dirNames;
|
||||
|
||||
*baseName = savechar;
|
||||
- baseNames[i] = baseName;
|
||||
+ baseNames[realCount] = baseName;
|
||||
+ realCount++;
|
||||
}
|
||||
|
||||
exit:
|
||||
if (count > 0) {
|
||||
- headerPutUint32(h, RPMTAG_DIRINDEXES, dirIndexes, count);
|
||||
- headerPutStringArray(h, RPMTAG_BASENAMES, baseNames, count);
|
||||
+ headerPutUint32(h, RPMTAG_DIRINDEXES, dirIndexes, realCount);
|
||||
+ headerPutStringArray(h, RPMTAG_BASENAMES, baseNames, realCount);
|
||||
headerPutStringArray(h, RPMTAG_DIRNAMES,
|
||||
(const char **) dirNames, dirIndex + 1);
|
||||
}
|
||||
--
|
||||
1.9.3
|
||||
|
36
rpm-4.12.0-golang-debuginfo.patch
Normal file
36
rpm-4.12.0-golang-debuginfo.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From 363c015da5cbf315df267dc53580290984039804 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Wed, 15 Apr 2015 09:51:08 +0200
|
||||
Subject: [PATCH] Make sure references to go sources in debuginfo packages go
|
||||
to the installed path and not the source file in the build environment.
|
||||
|
||||
- Resolves: rhbz#1184221
|
||||
---
|
||||
tools/debugedit.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tools/debugedit.c b/tools/debugedit.c
|
||||
index 0f85885..cf89312 100644
|
||||
--- a/tools/debugedit.c
|
||||
+++ b/tools/debugedit.c
|
||||
@@ -480,7 +480,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off, char *comp_dir, int phase)
|
||||
unsigned char *endcu, *endprol;
|
||||
unsigned char opcode_base;
|
||||
uint32_t value, dirt_cnt;
|
||||
- size_t comp_dir_len = strlen (comp_dir);
|
||||
+ size_t comp_dir_len = !comp_dir ? 0 : strlen (comp_dir);
|
||||
size_t abs_file_cnt = 0, abs_dir_cnt = 0;
|
||||
|
||||
if (phase != 0)
|
||||
@@ -950,7 +950,7 @@ edit_attributes (DSO *dso, unsigned char *ptr, struct abbrev_tag *t, int phase)
|
||||
}
|
||||
}
|
||||
|
||||
- if (found_list_offs && comp_dir)
|
||||
+ if (found_list_offs)
|
||||
edit_dwarf2_line (dso, list_offs, comp_dir, phase);
|
||||
|
||||
free (comp_dir);
|
||||
--
|
||||
2.1.0
|
||||
|
201
rpm-4.12.0-gpg-passphrase1.patch
Normal file
201
rpm-4.12.0-gpg-passphrase1.patch
Normal file
@ -0,0 +1,201 @@
|
||||
From 6a8924b4c9df8e3597f7b4aa3de46498d390c5a8 Mon Sep 17 00:00:00 2001
|
||||
From: Lubos Kardos <lkardos@redhat.com>
|
||||
Date: Tue, 9 Jun 2015 14:19:59 +0200
|
||||
Subject: [PATCH 1/2] Use named pipe instead of stdin as input for gpg
|
||||
|
||||
This enables running gpg with access to the shell the rpmsign command
|
||||
is running in. This is needed to allow gpg to get passphrase by itself.
|
||||
---
|
||||
sign/rpmgensig.c | 105 ++++++++++++++++++++++++++++++++++++++++++-------------
|
||||
1 file changed, 80 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/sign/rpmgensig.c b/sign/rpmgensig.c
|
||||
index 0bd14e3..9691f0d 100644
|
||||
--- a/sign/rpmgensig.c
|
||||
+++ b/sign/rpmgensig.c
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <errno.h>
|
||||
#include <sys/wait.h>
|
||||
#include <popt.h>
|
||||
+#include <libgen.h>
|
||||
|
||||
#include <rpm/rpmlib.h> /* RPMSIGTAG & related */
|
||||
#include <rpm/rpmmacro.h>
|
||||
@@ -33,6 +34,68 @@ typedef struct sigTarget_s {
|
||||
rpm_loff_t size;
|
||||
} *sigTarget;
|
||||
|
||||
+/*
|
||||
+ * There is no function for creating unique temporary fifos so create
|
||||
+ * unique temporary directory and then create fifo in it.
|
||||
+ */
|
||||
+static char *mkTempFifo(void)
|
||||
+{
|
||||
+ char *tmppath = NULL, *tmpdir = NULL, *fifofn = NULL;
|
||||
+ mode_t mode;
|
||||
+
|
||||
+ tmppath = rpmExpand("%{_tmppath}", NULL);
|
||||
+ if (rpmioMkpath(tmppath, 0755, (uid_t) -1, (gid_t) -1))
|
||||
+ goto exit;
|
||||
+
|
||||
+
|
||||
+ tmpdir = rpmGetPath(tmppath, "/rpm-tmp.XXXXXX", NULL);
|
||||
+ mode = umask(0077);
|
||||
+ tmpdir = mkdtemp(tmpdir);
|
||||
+ umask(mode);
|
||||
+ if (tmpdir == NULL) {
|
||||
+ rpmlog(RPMLOG_ERR, _("error creating temp directory %s: %m\n"),
|
||||
+ tmpdir);
|
||||
+ tmpdir = _free(tmpdir);
|
||||
+ goto exit;
|
||||
+ }
|
||||
+
|
||||
+ fifofn = rpmGetPath(tmpdir, "/fifo", NULL);
|
||||
+ if (mkfifo(fifofn, 0600) == -1) {
|
||||
+ rpmlog(RPMLOG_ERR, _("error creating fifo %s: %m\n"), fifofn);
|
||||
+ fifofn = _free(fifofn);
|
||||
+ }
|
||||
+
|
||||
+exit:
|
||||
+ if (fifofn == NULL && tmpdir != NULL)
|
||||
+ unlink(tmpdir);
|
||||
+
|
||||
+ free(tmppath);
|
||||
+ free(tmpdir);
|
||||
+
|
||||
+ return fifofn;
|
||||
+}
|
||||
+
|
||||
+/* Delete fifo and then temporary directory in which it was located */
|
||||
+static int rpmRmTempFifo(const char *fn)
|
||||
+{
|
||||
+ int rc = 0;
|
||||
+ char *dfn = NULL, *dir = NULL;
|
||||
+
|
||||
+ if ((rc = unlink(fn)) != 0) {
|
||||
+ rpmlog(RPMLOG_ERR, _("error delete fifo %s: %m\n"), fn);
|
||||
+ return rc;
|
||||
+ }
|
||||
+
|
||||
+ dfn = xstrdup(fn);
|
||||
+ dir = dirname(dfn);
|
||||
+
|
||||
+ if ((rc = rmdir(dir)) != 0)
|
||||
+ rpmlog(RPMLOG_ERR, _("error delete directory %s: %m\n"), dir);
|
||||
+ free(dfn);
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
static int closeFile(FD_t *fdp)
|
||||
{
|
||||
if (fdp == NULL || *fdp == NULL)
|
||||
@@ -186,8 +249,9 @@ static int runGPG(sigTarget sigt, const char *sigfile, const char * passPhrase)
|
||||
{
|
||||
int pid = 0, status;
|
||||
int inpipe[2];
|
||||
- int inpipe2[2];
|
||||
FILE * fpipe = NULL;
|
||||
+ FD_t fnamedPipe = NULL;
|
||||
+ char *namedPipeName = NULL;
|
||||
unsigned char buf[BUFSIZ];
|
||||
ssize_t count;
|
||||
ssize_t wantCount;
|
||||
@@ -200,13 +264,9 @@ static int runGPG(sigTarget sigt, const char *sigfile, const char * passPhrase)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
- inpipe2[0] = inpipe2[1] = 0;
|
||||
- if (pipe(inpipe2) < 0) {
|
||||
- rpmlog(RPMLOG_ERR, _("Couldn't create pipe for signing: %m"));
|
||||
- goto exit;
|
||||
- }
|
||||
+ namedPipeName = mkTempFifo();
|
||||
|
||||
- addMacro(NULL, "__plaintext_filename", NULL, "-", -1);
|
||||
+ addMacro(NULL, "__plaintext_filename", NULL, namedPipeName, -1);
|
||||
addMacro(NULL, "__signature_filename", NULL, sigfile, -1);
|
||||
|
||||
if (!(pid = fork())) {
|
||||
@@ -217,9 +277,6 @@ static int runGPG(sigTarget sigt, const char *sigfile, const char * passPhrase)
|
||||
(void) dup2(inpipe[0], 3);
|
||||
(void) close(inpipe[1]);
|
||||
|
||||
- (void) dup2(inpipe2[0], STDIN_FILENO);
|
||||
- (void) close(inpipe2[1]);
|
||||
-
|
||||
if (gpg_path && *gpg_path != '\0')
|
||||
(void) setenv("GNUPGHOME", gpg_path, 1);
|
||||
(void) setenv("LC_ALL", "C", 1);
|
||||
@@ -240,8 +297,6 @@ static int runGPG(sigTarget sigt, const char *sigfile, const char * passPhrase)
|
||||
|
||||
(void) close(inpipe[0]);
|
||||
inpipe[0] = 0;
|
||||
- (void) close(inpipe2[0]);
|
||||
- inpipe2[0] = 0;
|
||||
|
||||
fpipe = fdopen(inpipe[1], "w");
|
||||
if (!fpipe) {
|
||||
@@ -257,12 +312,11 @@ static int runGPG(sigTarget sigt, const char *sigfile, const char * passPhrase)
|
||||
(void) fclose(fpipe);
|
||||
fpipe = NULL;
|
||||
|
||||
- fpipe = fdopen(inpipe2[1], "w");
|
||||
- if (!fpipe) {
|
||||
- rpmlog(RPMLOG_ERR, _("fdopen failed\n"));
|
||||
+ fnamedPipe = Fopen(namedPipeName, "w");
|
||||
+ if (!fnamedPipe) {
|
||||
+ rpmlog(RPMLOG_ERR, _("Fopen failed\n"));
|
||||
goto exit;
|
||||
}
|
||||
- inpipe2[1] = 0;
|
||||
|
||||
if (Fseek(sigt->fd, sigt->start, SEEK_SET) < 0) {
|
||||
rpmlog(RPMLOG_ERR, _("Could not seek in file %s: %s\n"),
|
||||
@@ -273,8 +327,8 @@ static int runGPG(sigTarget sigt, const char *sigfile, const char * passPhrase)
|
||||
size = sigt->size;
|
||||
wantCount = size < sizeof(buf) ? size : sizeof(buf);
|
||||
while ((count = Fread(buf, sizeof(buf[0]), wantCount, sigt->fd)) > 0) {
|
||||
- fwrite(buf, sizeof(buf[0]), count, fpipe);
|
||||
- if (ferror(fpipe)) {
|
||||
+ Fwrite(buf, sizeof(buf[0]), count, fnamedPipe);
|
||||
+ if (Ferror(fnamedPipe)) {
|
||||
rpmlog(RPMLOG_ERR, _("Could not write to pipe\n"));
|
||||
goto exit;
|
||||
}
|
||||
@@ -286,8 +340,8 @@ static int runGPG(sigTarget sigt, const char *sigfile, const char * passPhrase)
|
||||
sigt->fileName, Fstrerror(sigt->fd));
|
||||
goto exit;
|
||||
}
|
||||
- fclose(fpipe);
|
||||
- fpipe = NULL;
|
||||
+ Fclose(fnamedPipe);
|
||||
+ fnamedPipe = NULL;
|
||||
|
||||
(void) waitpid(pid, &status, 0);
|
||||
pid = 0;
|
||||
@@ -307,15 +361,16 @@ exit:
|
||||
if (inpipe[1])
|
||||
close(inpipe[1]);
|
||||
|
||||
- if (inpipe2[0])
|
||||
- close(inpipe[0]);
|
||||
-
|
||||
- if (inpipe2[1])
|
||||
- close(inpipe[1]);
|
||||
+ if (fnamedPipe)
|
||||
+ Fclose(fnamedPipe);
|
||||
|
||||
if (pid)
|
||||
waitpid(pid, &status, 0);
|
||||
|
||||
+ if (namedPipeName) {
|
||||
+ rpmRmTempFifo(namedPipeName);
|
||||
+ free(namedPipeName);
|
||||
+ }
|
||||
|
||||
return rc;
|
||||
}
|
||||
--
|
||||
1.9.3
|
||||
|
370
rpm-4.12.0-gpg-passphrase2.patch
Normal file
370
rpm-4.12.0-gpg-passphrase2.patch
Normal file
@ -0,0 +1,370 @@
|
||||
From 0bce5fcf270711a2e077fba0fb7c5979ea007eb5 Mon Sep 17 00:00:00 2001
|
||||
From: Lubos Kardos <lkardos@redhat.com>
|
||||
Date: Tue, 9 Jun 2015 18:06:29 +0200
|
||||
Subject: [PATCH 2/2] Allow gpg to get passphrase by itself.
|
||||
|
||||
Remove rpm asking for passphrase and then passing this passphrase
|
||||
to gpg via file descriptor (--passphrase-fd) but provide gpg with
|
||||
access to unredirected stdin to get passphrase directly from user.
|
||||
|
||||
Remove also macro %__gpg_check_password_cmd because in this new signing
|
||||
scheme has no sense. rpm doesn't handle passphrase in any way,
|
||||
everything is done in gpg including checking of passphrase.
|
||||
|
||||
We did this modification because of changes in gpg behavior. Since
|
||||
gpg-2.1 option "--passphrase-fd" doesn't work by default, only when
|
||||
it is explicitly allowed in gpg.conf. (rhbz:#1228234)
|
||||
---
|
||||
macros.in | 4 +--
|
||||
python/rpmsmodule.c | 9 +++---
|
||||
rpmsign.c | 82 +++--------------------------------------------------
|
||||
sign/rpmgensig.c | 67 +++++++++----------------------------------
|
||||
sign/rpmsign.h | 3 +-
|
||||
5 files changed, 23 insertions(+), 142 deletions(-)
|
||||
|
||||
diff --git a/macros.in b/macros.in
|
||||
index 414c1be..de89420 100644
|
||||
--- a/macros.in
|
||||
+++ b/macros.in
|
||||
@@ -538,11 +538,9 @@ package or when debugging this package.\
|
||||
# Macro(s) to hold the arguments passed to GPG/PGP for package
|
||||
# signing and verification.
|
||||
#
|
||||
-%__gpg_check_password_cmd %{__gpg} \
|
||||
- gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so -
|
||||
|
||||
%__gpg_sign_cmd %{__gpg} \
|
||||
- gpg --batch --no-verbose --no-armor --passphrase-fd 3 \
|
||||
+ gpg --no-verbose --no-armor \
|
||||
%{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} \
|
||||
--no-secmem-warning \
|
||||
-u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
|
||||
diff --git a/python/rpmsmodule.c b/python/rpmsmodule.c
|
||||
index a8289b5..0601353 100644
|
||||
--- a/python/rpmsmodule.c
|
||||
+++ b/python/rpmsmodule.c
|
||||
@@ -8,19 +8,18 @@ static char rpms__doc__[] =
|
||||
static PyObject * addSign(PyObject * self, PyObject * args, PyObject *kwds)
|
||||
{
|
||||
const char *path = NULL;
|
||||
- const char *passPhrase = NULL;
|
||||
- char * kwlist[] = { "path", "passPhrase", "keyid", "hashalgo", NULL };
|
||||
+ char * kwlist[] = { "path", "keyid", "hashalgo", NULL };
|
||||
struct rpmSignArgs sig, *sigp = NULL;
|
||||
|
||||
memset(&sig, 0, sizeof(sig));
|
||||
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "ss|si", kwlist,
|
||||
- &path, &passPhrase, &sig.keyid, &sig.hashalgo))
|
||||
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|si", kwlist,
|
||||
+ &path, &sig.keyid, &sig.hashalgo))
|
||||
return NULL;
|
||||
|
||||
if (sig.keyid || sig.hashalgo)
|
||||
sigp = &sig;
|
||||
|
||||
- return PyBool_FromLong(rpmPkgSign(path, sigp, passPhrase) == 0);
|
||||
+ return PyBool_FromLong(rpmPkgSign(path, sigp) == 0);
|
||||
}
|
||||
|
||||
static PyObject * delSign(PyObject * self, PyObject * args, PyObject *kwds)
|
||||
diff --git a/rpmsign.c b/rpmsign.c
|
||||
index b8e5598..9b93e39 100644
|
||||
--- a/rpmsign.c
|
||||
+++ b/rpmsign.c
|
||||
@@ -41,72 +41,6 @@ static struct poptOption optionsTable[] = {
|
||||
POPT_TABLEEND
|
||||
};
|
||||
|
||||
-static int checkPassPhrase(const char * passPhrase)
|
||||
-{
|
||||
- int passPhrasePipe[2];
|
||||
- int pid, status;
|
||||
- int rc = -1;
|
||||
- int xx;
|
||||
-
|
||||
- if (passPhrase == NULL)
|
||||
- return -1;
|
||||
-
|
||||
- passPhrasePipe[0] = passPhrasePipe[1] = 0;
|
||||
- if (pipe(passPhrasePipe))
|
||||
- return -1;
|
||||
-
|
||||
- pid = fork();
|
||||
- if (pid < 0) {
|
||||
- close(passPhrasePipe[0]);
|
||||
- close(passPhrasePipe[1]);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- if (pid == 0) {
|
||||
- char * cmd, * gpg_path;
|
||||
- char *const *av;
|
||||
- int fdno;
|
||||
-
|
||||
- close(STDIN_FILENO);
|
||||
- close(STDOUT_FILENO);
|
||||
- close(passPhrasePipe[1]);
|
||||
- if ((fdno = open("/dev/null", O_RDONLY)) != STDIN_FILENO) {
|
||||
- xx = dup2(fdno, STDIN_FILENO);
|
||||
- close(fdno);
|
||||
- }
|
||||
- if ((fdno = open("/dev/null", O_WRONLY)) != STDOUT_FILENO) {
|
||||
- xx = dup2(fdno, STDOUT_FILENO);
|
||||
- close(fdno);
|
||||
- }
|
||||
- xx = dup2(passPhrasePipe[0], 3);
|
||||
-
|
||||
- unsetenv("MALLOC_CHECK_");
|
||||
- gpg_path = rpmExpand("%{?_gpg_path}", NULL);
|
||||
-
|
||||
- if (!rstreq(gpg_path, ""))
|
||||
- setenv("GNUPGHOME", gpg_path, 1);
|
||||
-
|
||||
- cmd = rpmExpand("%{?__gpg_check_password_cmd}", NULL);
|
||||
- rc = poptParseArgvString(cmd, NULL, (const char ***)&av);
|
||||
- if (xx >= 0 && rc == 0) {
|
||||
- rc = execve(av[0], av+1, environ);
|
||||
- fprintf(stderr, _("Could not exec %s: %s\n"), "gpg",
|
||||
- strerror(errno));
|
||||
- }
|
||||
- _exit(EXIT_FAILURE);
|
||||
- }
|
||||
-
|
||||
- close(passPhrasePipe[0]);
|
||||
- xx = write(passPhrasePipe[1], passPhrase, strlen(passPhrase));
|
||||
- xx = write(passPhrasePipe[1], "\n", 1);
|
||||
- close(passPhrasePipe[1]);
|
||||
-
|
||||
- if (xx >= 0 && waitpid(pid, &status, 0) >= 0)
|
||||
- rc = (WIFEXITED(status) && WEXITSTATUS(status) == 0) ? 0 : 1;
|
||||
-
|
||||
- return rc;
|
||||
-}
|
||||
-
|
||||
/* TODO: permit overriding macro setup on the command line */
|
||||
static int doSign(poptContext optCon)
|
||||
{
|
||||
@@ -119,18 +53,10 @@ static int doSign(poptContext optCon)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
- /* XXX FIXME: eliminate obsolete getpass() usage */
|
||||
- passPhrase = getpass(_("Enter pass phrase: "));
|
||||
- passPhrase = (passPhrase != NULL) ? rstrdup(passPhrase) : NULL;
|
||||
- if (checkPassPhrase(passPhrase) == 0) {
|
||||
- const char *arg;
|
||||
- fprintf(stderr, _("Pass phrase is good.\n"));
|
||||
- rc = 0;
|
||||
- while ((arg = poptGetArg(optCon)) != NULL) {
|
||||
- rc += rpmPkgSign(arg, NULL, passPhrase);
|
||||
- }
|
||||
- } else {
|
||||
- fprintf(stderr, _("Pass phrase check failed or gpg key expired\n"));
|
||||
+ const char *arg;
|
||||
+ rc = 0;
|
||||
+ while ((arg = poptGetArg(optCon)) != NULL) {
|
||||
+ rc += rpmPkgSign(arg, NULL);
|
||||
}
|
||||
|
||||
exit:
|
||||
diff --git a/sign/rpmgensig.c b/sign/rpmgensig.c
|
||||
index 9691f0d..24bf39e 100644
|
||||
--- a/sign/rpmgensig.c
|
||||
+++ b/sign/rpmgensig.c
|
||||
@@ -245,11 +245,9 @@ exit:
|
||||
return rc;
|
||||
}
|
||||
|
||||
-static int runGPG(sigTarget sigt, const char *sigfile, const char * passPhrase)
|
||||
+static int runGPG(sigTarget sigt, const char *sigfile)
|
||||
{
|
||||
int pid = 0, status;
|
||||
- int inpipe[2];
|
||||
- FILE * fpipe = NULL;
|
||||
FD_t fnamedPipe = NULL;
|
||||
char *namedPipeName = NULL;
|
||||
unsigned char buf[BUFSIZ];
|
||||
@@ -258,12 +256,6 @@ static int runGPG(sigTarget sigt, const char *sigfile, const char * passPhrase)
|
||||
rpm_loff_t size;
|
||||
int rc = 1; /* assume failure */
|
||||
|
||||
- inpipe[0] = inpipe[1] = 0;
|
||||
- if (pipe(inpipe) < 0) {
|
||||
- rpmlog(RPMLOG_ERR, _("Couldn't create pipe for signing: %m"));
|
||||
- goto exit;
|
||||
- }
|
||||
-
|
||||
namedPipeName = mkTempFifo();
|
||||
|
||||
addMacro(NULL, "__plaintext_filename", NULL, namedPipeName, -1);
|
||||
@@ -274,9 +266,6 @@ static int runGPG(sigTarget sigt, const char *sigfile, const char * passPhrase)
|
||||
char *cmd = NULL;
|
||||
const char *gpg_path = rpmExpand("%{?_gpg_path}", NULL);
|
||||
|
||||
- (void) dup2(inpipe[0], 3);
|
||||
- (void) close(inpipe[1]);
|
||||
-
|
||||
if (gpg_path && *gpg_path != '\0')
|
||||
(void) setenv("GNUPGHOME", gpg_path, 1);
|
||||
(void) setenv("LC_ALL", "C", 1);
|
||||
@@ -295,23 +284,6 @@ static int runGPG(sigTarget sigt, const char *sigfile, const char * passPhrase)
|
||||
delMacro(NULL, "__plaintext_filename");
|
||||
delMacro(NULL, "__signature_filename");
|
||||
|
||||
- (void) close(inpipe[0]);
|
||||
- inpipe[0] = 0;
|
||||
-
|
||||
- fpipe = fdopen(inpipe[1], "w");
|
||||
- if (!fpipe) {
|
||||
- rpmlog(RPMLOG_ERR, _("fdopen failed\n"));
|
||||
- goto exit;
|
||||
- }
|
||||
- inpipe[1] = 0;
|
||||
-
|
||||
- if (fprintf(fpipe, "%s\n", (passPhrase ? passPhrase : "")) < 0) {
|
||||
- rpmlog(RPMLOG_ERR, _("Could not write to pipe\n"));
|
||||
- goto exit;
|
||||
- }
|
||||
- (void) fclose(fpipe);
|
||||
- fpipe = NULL;
|
||||
-
|
||||
fnamedPipe = Fopen(namedPipeName, "w");
|
||||
if (!fnamedPipe) {
|
||||
rpmlog(RPMLOG_ERR, _("Fopen failed\n"));
|
||||
@@ -352,14 +324,6 @@ static int runGPG(sigTarget sigt, const char *sigfile, const char * passPhrase)
|
||||
}
|
||||
|
||||
exit:
|
||||
- if (fpipe)
|
||||
- fclose(fpipe);
|
||||
-
|
||||
- if (inpipe[0])
|
||||
- close(inpipe[0]);
|
||||
-
|
||||
- if (inpipe[1])
|
||||
- close(inpipe[1]);
|
||||
|
||||
if (fnamedPipe)
|
||||
Fclose(fnamedPipe);
|
||||
@@ -383,8 +347,7 @@ exit:
|
||||
* @param passPhrase private key pass phrase
|
||||
* @return 0 on success, 1 on failure
|
||||
*/
|
||||
-static int makeGPGSignature(Header sigh, int ishdr, sigTarget sigt,
|
||||
- const char * passPhrase)
|
||||
+static int makeGPGSignature(Header sigh, int ishdr, sigTarget sigt)
|
||||
{
|
||||
char * sigfile = rstrscat(NULL, sigt->fileName, ".sig", NULL);
|
||||
struct stat st;
|
||||
@@ -392,7 +355,7 @@ static int makeGPGSignature(Header sigh, int ishdr, sigTarget sigt,
|
||||
size_t pktlen = 0;
|
||||
int rc = 1; /* assume failure */
|
||||
|
||||
- if (runGPG(sigt, sigfile, passPhrase))
|
||||
+ if (runGPG(sigt, sigfile))
|
||||
goto exit;
|
||||
|
||||
if (stat(sigfile, &st)) {
|
||||
@@ -431,16 +394,15 @@ exit:
|
||||
return rc;
|
||||
}
|
||||
|
||||
-static int rpmGenSignature(Header sigh, sigTarget sigt1, sigTarget sigt2,
|
||||
- const char * passPhrase)
|
||||
+static int rpmGenSignature(Header sigh, sigTarget sigt1, sigTarget sigt2)
|
||||
{
|
||||
int ret;
|
||||
|
||||
- ret = makeGPGSignature(sigh, 0, sigt1, passPhrase);
|
||||
+ ret = makeGPGSignature(sigh, 0, sigt1);
|
||||
if (ret)
|
||||
goto exit;
|
||||
|
||||
- ret = makeGPGSignature(sigh, 1, sigt2, passPhrase);
|
||||
+ ret = makeGPGSignature(sigh, 1, sigt2);
|
||||
if (ret)
|
||||
goto exit;
|
||||
exit:
|
||||
@@ -486,8 +448,7 @@ static int sameSignature(rpmTagVal sigtag, Header h1, Header h2)
|
||||
return (rc == 0);
|
||||
}
|
||||
|
||||
-static int replaceSignature(Header sigh, sigTarget sigt1, sigTarget sigt2,
|
||||
- const char *passPhrase)
|
||||
+static int replaceSignature(Header sigh, sigTarget sigt1, sigTarget sigt2)
|
||||
{
|
||||
/* Grab a copy of the header so we can compare the result */
|
||||
Header oldsigh = headerCopy(sigh);
|
||||
@@ -500,7 +461,7 @@ static int replaceSignature(Header sigh, sigTarget sigt1, sigTarget sigt2,
|
||||
* rpmGenSignature() internals parse the actual signing result and
|
||||
* adds appropriate tags for DSA/RSA.
|
||||
*/
|
||||
- if (rpmGenSignature(sigh, sigt1, sigt2, passPhrase) == 0) {
|
||||
+ if (rpmGenSignature(sigh, sigt1, sigt2) == 0) {
|
||||
/* Lets see what we got and whether its the same signature as before */
|
||||
rpmTagVal sigtag = headerIsEntry(sigh, RPMSIGTAG_DSA) ?
|
||||
RPMSIGTAG_DSA : RPMSIGTAG_RSA;
|
||||
@@ -517,10 +478,9 @@ static int replaceSignature(Header sigh, sigTarget sigt1, sigTarget sigt2,
|
||||
* Create/modify elements in signature header.
|
||||
* @param rpm path to package
|
||||
* @param deleting adding or deleting signature?
|
||||
- * @param passPhrase passPhrase (ignored when deleting)
|
||||
* @return 0 on success, -1 on error
|
||||
*/
|
||||
-static int rpmSign(const char *rpm, int deleting, const char *passPhrase)
|
||||
+static int rpmSign(const char *rpm, int deleting)
|
||||
{
|
||||
FD_t fd = NULL;
|
||||
FD_t ofd = NULL;
|
||||
@@ -605,7 +565,7 @@ static int rpmSign(const char *rpm, int deleting, const char *passPhrase)
|
||||
sigt2 = sigt1;
|
||||
sigt2.size = headerSizeof(h, HEADER_MAGIC_YES);
|
||||
|
||||
- res = replaceSignature(sigh, &sigt1, &sigt2, passPhrase);
|
||||
+ res = replaceSignature(sigh, &sigt1, &sigt2);
|
||||
if (res != 0) {
|
||||
if (res == 1) {
|
||||
rpmlog(RPMLOG_WARNING,
|
||||
@@ -722,8 +682,7 @@ exit:
|
||||
return res;
|
||||
}
|
||||
|
||||
-int rpmPkgSign(const char *path,
|
||||
- const struct rpmSignArgs * args, const char *passPhrase)
|
||||
+int rpmPkgSign(const char *path, const struct rpmSignArgs * args)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -739,7 +698,7 @@ int rpmPkgSign(const char *path,
|
||||
}
|
||||
}
|
||||
|
||||
- rc = rpmSign(path, 0, passPhrase);
|
||||
+ rc = rpmSign(path, 0);
|
||||
|
||||
if (args) {
|
||||
if (args->hashalgo) {
|
||||
@@ -755,5 +714,5 @@ int rpmPkgSign(const char *path,
|
||||
|
||||
int rpmPkgDelSign(const char *path)
|
||||
{
|
||||
- return rpmSign(path, 1, NULL);
|
||||
+ return rpmSign(path, 1);
|
||||
}
|
||||
diff --git a/sign/rpmsign.h b/sign/rpmsign.h
|
||||
index 15b3e0f..e161aff 100644
|
||||
--- a/sign/rpmsign.h
|
||||
+++ b/sign/rpmsign.h
|
||||
@@ -21,8 +21,7 @@ struct rpmSignArgs {
|
||||
* @param passPhrase passphrase for the signing key
|
||||
* @return 0 on success
|
||||
*/
|
||||
-int rpmPkgSign(const char *path,
|
||||
- const struct rpmSignArgs * args, const char *passPhrase);
|
||||
+int rpmPkgSign(const char *path, const struct rpmSignArgs * args);
|
||||
|
||||
/** \ingroup rpmsign
|
||||
* Delete signature(s) from a package
|
||||
--
|
||||
1.9.3
|
||||
|
39
rpm-4.12.0-payload-ghost.patch
Normal file
39
rpm-4.12.0-payload-ghost.patch
Normal file
@ -0,0 +1,39 @@
|
||||
diff --git a/lib/rpmarchive.h b/lib/rpmarchive.h
|
||||
index fab2d58..85079ca 100644
|
||||
--- a/lib/rpmarchive.h
|
||||
+++ b/lib/rpmarchive.h
|
||||
@@ -23,6 +23,7 @@ enum rpmfilesErrorCodes {
|
||||
RPMERR_ENOENT = -10,
|
||||
RPMERR_ENOTEMPTY = -11,
|
||||
RPMERR_FILE_SIZE = -12,
|
||||
+ RPMERR_ITER_SKIP = -13,
|
||||
|
||||
RPMERR_OPEN_FAILED = -32768,
|
||||
RPMERR_CHMOD_FAILED = -32769,
|
||||
diff --git a/lib/rpmfi.c b/lib/rpmfi.c
|
||||
index 384a6c9..2fba707 100644
|
||||
--- a/lib/rpmfi.c
|
||||
+++ b/lib/rpmfi.c
|
||||
@@ -821,7 +821,10 @@ int rpmfiNext(rpmfi fi)
|
||||
{
|
||||
int next = -1;
|
||||
if (fi != NULL) {
|
||||
- next = fi->next(fi);
|
||||
+ do {
|
||||
+ next = fi->next(fi);
|
||||
+ } while (next == RPMERR_ITER_SKIP);
|
||||
+
|
||||
if (next >= 0 && next < rpmfilesFC(fi->files)) {
|
||||
fi->i = next;
|
||||
fi->j = rpmfilesDI(fi->files, fi->i);
|
||||
@@ -1942,6 +1945,10 @@ static int iterReadArchiveNext(rpmfi fi)
|
||||
rpm_loff_t fsize = 0;
|
||||
rpm_mode_t mode = rpmfilesFMode(fi->files, fx);
|
||||
|
||||
+ /* %ghost in payload, should not be there but rpm < 4.11 sometimes did this */
|
||||
+ if (rpmfilesFFlags(fi->files, fx) & RPMFILE_GHOST)
|
||||
+ return RPMERR_ITER_SKIP;
|
||||
+
|
||||
if (S_ISREG(mode)) {
|
||||
const int * links;
|
||||
uint32_t numlinks = rpmfilesFLinks(fi->files, fx, &links);
|
32
rpm-4.12.0-tslock-nowait.patch
Normal file
32
rpm-4.12.0-tslock-nowait.patch
Normal file
@ -0,0 +1,32 @@
|
||||
commit 6ce2d43e2533505aa252159bfa8cc799965655bb
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Wed Oct 1 09:59:21 2014 +0300
|
||||
|
||||
Dont wait for transaction lock within scriptlets (RhBug:1135596)
|
||||
|
||||
- Packages doing stupid things like rpm -U/-i/-e from their scriptlets
|
||||
can and will get hung waiting on the transaction lock, which can
|
||||
prompt users to kill the entire transaction, possibly with severe
|
||||
consequences. Starting with rpm >= 4.12 we also take the transaction
|
||||
lock for importing public keys, which seems to have caught one of
|
||||
the bigger fishes in the pond (Google Chrome packages).
|
||||
- Only wait when stdin is a tty, this affects more than scriptlets but
|
||||
most likely we dont want to wait for locks in those situations either.
|
||||
|
||||
diff --git a/lib/rpmlock.c b/lib/rpmlock.c
|
||||
index 7696cbe..9c07654 100644
|
||||
--- a/lib/rpmlock.c
|
||||
+++ b/lib/rpmlock.c
|
||||
@@ -124,10 +124,11 @@ rpmlock rpmlockNew(const char *lock_path, const char *descr)
|
||||
int rpmlockAcquire(rpmlock lock)
|
||||
{
|
||||
int locked = 0; /* assume failure */
|
||||
+ int maywait = isatty(STDIN_FILENO); /* dont wait within scriptlets */
|
||||
|
||||
if (lock) {
|
||||
locked = rpmlock_acquire(lock, RPMLOCK_WRITE);
|
||||
- if (!locked && (lock->openmode & RPMLOCK_WRITE)) {
|
||||
+ if (!locked && (lock->openmode & RPMLOCK_WRITE) && maywait) {
|
||||
rpmlog(RPMLOG_WARNING, _("waiting for %s lock on %s\n"),
|
||||
lock->descr, lock->path);
|
||||
locked = rpmlock_acquire(lock, (RPMLOCK_WRITE|RPMLOCK_WAIT));
|
117
rpm-4.12.0-unlimited-macro-expand.patch
Normal file
117
rpm-4.12.0-unlimited-macro-expand.patch
Normal file
@ -0,0 +1,117 @@
|
||||
diff -up rpm-4.12.0.1/build/files.c.umacros rpm-4.12.0.1/build/files.c
|
||||
--- rpm-4.12.0.1/build/files.c.umacros 2014-06-30 10:47:13.928503700 +0200
|
||||
+++ rpm-4.12.0.1/build/files.c 2016-02-29 14:28:40.949514813 +0100
|
||||
@@ -1590,6 +1590,7 @@ static rpmRC readFilesManifest(rpmSpec s
|
||||
FILE *fd = NULL;
|
||||
rpmRC rc = RPMRC_FAIL;
|
||||
unsigned int nlines = 0;
|
||||
+ char *expanded;
|
||||
|
||||
if (*path == '/') {
|
||||
fn = rpmGetPath(path, NULL);
|
||||
@@ -1607,11 +1608,12 @@ static rpmRC readFilesManifest(rpmSpec s
|
||||
while (fgets(buf, sizeof(buf), fd)) {
|
||||
if (handleComments(buf))
|
||||
continue;
|
||||
- if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {
|
||||
+ if(rpmExpandMacros(spec->macros, buf, &expanded, 0) < 0) {
|
||||
rpmlog(RPMLOG_ERR, _("line: %s\n"), buf);
|
||||
goto exit;
|
||||
}
|
||||
- argvAdd(&(pkg->fileList), buf);
|
||||
+ argvAdd(&(pkg->fileList), expanded);
|
||||
+ free(expanded);
|
||||
nlines++;
|
||||
}
|
||||
|
||||
diff -up rpm-4.12.0.1/build/pack.c.umacros rpm-4.12.0.1/build/pack.c
|
||||
--- rpm-4.12.0.1/build/pack.c.umacros 2016-02-29 14:28:30.001660705 +0100
|
||||
+++ rpm-4.12.0.1/build/pack.c 2016-02-29 14:28:40.950514800 +0100
|
||||
@@ -132,11 +132,13 @@ static rpmRC addFileToTag(rpmSpec spec,
|
||||
}
|
||||
|
||||
while (fgets(buf, sizeof(buf), f)) {
|
||||
- if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {
|
||||
+ char *expanded;
|
||||
+ if(rpmExpandMacros(spec->macros, buf, &expanded, 0) < 0) {
|
||||
rpmlog(RPMLOG_ERR, _("%s: line: %s\n"), fn, buf);
|
||||
goto exit;
|
||||
}
|
||||
- appendStringBuf(sb, buf);
|
||||
+ appendStringBuf(sb, expanded);
|
||||
+ free(expanded);
|
||||
}
|
||||
headerPutString(h, tag, getStringBuf(sb));
|
||||
rc = RPMRC_OK;
|
||||
diff -up rpm-4.12.0.1/build/parseSpec.c.umacros rpm-4.12.0.1/build/parseSpec.c
|
||||
--- rpm-4.12.0.1/build/parseSpec.c.umacros 2014-09-15 09:17:36.378270111 +0200
|
||||
+++ rpm-4.12.0.1/build/parseSpec.c 2016-02-29 14:32:05.618787380 +0100
|
||||
@@ -207,11 +207,16 @@ static int copyNextLineFromOFI(rpmSpec s
|
||||
spec->lbufOff = 0;
|
||||
|
||||
/* Don't expand macros (eg. %define) in false branch of %if clause */
|
||||
- if (spec->readStack->reading &&
|
||||
- expandMacros(spec, spec->macros, spec->lbuf, spec->lbufSize)) {
|
||||
+ if (spec->readStack->reading) {
|
||||
+ char *expanded;
|
||||
+ if (rpmExpandMacros(spec->macros, spec->lbuf, &expanded, 0) < 0) {
|
||||
rpmlog(RPMLOG_ERR, _("line %d: %s\n"),
|
||||
spec->lineNum, spec->lbuf);
|
||||
return -1;
|
||||
+ }
|
||||
+ free(spec->lbuf);
|
||||
+ spec->lbuf = expanded;
|
||||
+ spec->lbufSize = strlen(spec->lbuf) + 1;
|
||||
}
|
||||
spec->nextline = spec->lbuf;
|
||||
}
|
||||
diff -up rpm-4.12.0.1/rpmio/macro.c.umacros rpm-4.12.0.1/rpmio/macro.c
|
||||
--- rpm-4.12.0.1/rpmio/macro.c.umacros 2014-07-01 11:07:07.070211597 +0200
|
||||
+++ rpm-4.12.0.1/rpmio/macro.c 2016-02-29 14:28:40.951514786 +0100
|
||||
@@ -1462,6 +1462,25 @@ int expandMacros(void * spec, rpmMacroCo
|
||||
return rc;
|
||||
}
|
||||
|
||||
+
|
||||
+int rpmExpandMacros(rpmMacroContext mc, const char * sbuf, char ** obuf, int flags)
|
||||
+{
|
||||
+ char *target = NULL;
|
||||
+ int rc;
|
||||
+
|
||||
+ mc = rpmmctxAcquire(mc);
|
||||
+ rc = doExpandMacros(mc, sbuf, &target);
|
||||
+ rpmmctxRelease(mc);
|
||||
+
|
||||
+ if (rc) {
|
||||
+ free(target);
|
||||
+ return -1;
|
||||
+ } else {
|
||||
+ *obuf = target;
|
||||
+ return 1;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void
|
||||
rpmDumpMacroTable(rpmMacroContext mc, FILE * fp)
|
||||
{
|
||||
diff -up rpm-4.12.0.1/rpmio/rpmmacro.h.umacros rpm-4.12.0.1/rpmio/rpmmacro.h
|
||||
--- rpm-4.12.0.1/rpmio/rpmmacro.h.umacros 2014-06-30 10:47:14.105503272 +0200
|
||||
+++ rpm-4.12.0.1/rpmio/rpmmacro.h 2016-02-29 14:28:40.952514773 +0100
|
||||
@@ -66,6 +66,17 @@ int expandMacros (void * spec, rpmMacroC
|
||||
size_t slen);
|
||||
|
||||
/** \ingroup rpmmacro
|
||||
+ * Expand macro into buffer.
|
||||
+ * @param mc macro context (NULL uses global context).
|
||||
+ * @param sbuf input macro to expand
|
||||
+ * @param obuf macro expansion (malloc'ed)
|
||||
+ * @param flags flags (currently unused)
|
||||
+ * @return negative on failure
|
||||
+ */
|
||||
+int rpmExpandMacros (rpmMacroContext mc, const char * sbuf,
|
||||
+ char ** obuf, int flags);
|
||||
+
|
||||
+/** \ingroup rpmmacro
|
||||
* Add macro to context.
|
||||
* @deprecated Use rpmDefineMacro().
|
||||
* @param mc macro context (NULL uses global context).
|
157
rpm-4.12.0-whatrecommends.patch
Normal file
157
rpm-4.12.0-whatrecommends.patch
Normal file
@ -0,0 +1,157 @@
|
||||
diff --git a/doc/rpm.8 b/doc/rpm.8
|
||||
index e583009..283e8ac 100644
|
||||
--- a/doc/rpm.8
|
||||
+++ b/doc/rpm.8
|
||||
@@ -58,6 +58,8 @@ rpm \- RPM Package Manager
|
||||
[\fB--hdrid \fISHA1\fB\fR] [\fB--pkgid \fIMD5\fB\fR] [\fB--tid \fITID\fB\fR]
|
||||
[\fB--querybynumber \fIHDRNUM\fB\fR] [\fB--triggeredby \fIPACKAGE_NAME\fB\fR]
|
||||
[\fB--whatprovides \fICAPABILITY\fB\fR] [\fB--whatrequires \fICAPABILITY\fB\fR]
|
||||
+ [\fB--whatrecommends \fICAPABILITY\fB\fR] [\fB--whatsuggests \fICAPABILITY\fB\fR]
|
||||
+ [\fB--whatsupplements \fICAPABILITY\fB\fR] [\fB--whatenhances \fICAPABILITY\fB\fR]
|
||||
|
||||
.SS "query-options"
|
||||
.PP
|
||||
@@ -588,6 +590,18 @@ Query all packages that provide the \fICAPABILITY\fR capability.
|
||||
.TP
|
||||
\fB--whatrequires \fICAPABILITY\fB\fR
|
||||
Query all packages that require \fICAPABILITY\fR for proper functioning.
|
||||
+.TP
|
||||
+\fB--whatrecommends \fICAPABILITY\fB\fR
|
||||
+Query all packages that recommend \fICAPABILITY\fR.
|
||||
+.TP
|
||||
+\fB--whatsuggests \fICAPABILITY\fB\fR
|
||||
+Query all packages that suggest \fICAPABILITY\fR.
|
||||
+.TP
|
||||
+\fB--whatsupplements \fICAPABILITY\fB\fR
|
||||
+Query all packages that supplement \fICAPABILITY\fR.
|
||||
+.TP
|
||||
+\fB--whatenhances \fICAPABILITY\fB\fR
|
||||
+Query all packages that enhance \fICAPABILITY\fR.
|
||||
.SS "PACKAGE QUERY OPTIONS:"
|
||||
.PP
|
||||
.TP
|
||||
diff --git a/lib/poptQV.c b/lib/poptQV.c
|
||||
index 3db17b0..80edce7 100644
|
||||
--- a/lib/poptQV.c
|
||||
+++ b/lib/poptQV.c
|
||||
@@ -21,6 +21,10 @@ struct rpmQVKArguments_s rpmQVKArgs;
|
||||
#define POPT_QUERYBYPKGID -1007
|
||||
#define POPT_QUERYBYHDRID -1008
|
||||
#define POPT_QUERYBYTID -1010
|
||||
+#define POPT_WHATRECOMMENDS -1011
|
||||
+#define POPT_WHATSUGGESTS -1012
|
||||
+#define POPT_WHATSUPPLEMENTS -1013
|
||||
+#define POPT_WHATENHANCES -1014
|
||||
|
||||
/* ========== Query/Verify/Signature source args */
|
||||
static void rpmQVSourceArgCallback( poptContext con,
|
||||
@@ -45,6 +49,10 @@ static void rpmQVSourceArgCallback( poptContext con,
|
||||
case 'p': qva->qva_source |= RPMQV_RPM; break;
|
||||
case POPT_WHATPROVIDES: qva->qva_source |= RPMQV_WHATPROVIDES; break;
|
||||
case POPT_WHATREQUIRES: qva->qva_source |= RPMQV_WHATREQUIRES; break;
|
||||
+ case POPT_WHATRECOMMENDS: qva->qva_source |= RPMQV_WHATRECOMMENDS; break;
|
||||
+ case POPT_WHATSUGGESTS: qva->qva_source |= RPMQV_WHATSUGGESTS; break;
|
||||
+ case POPT_WHATSUPPLEMENTS: qva->qva_source |= RPMQV_WHATSUPPLEMENTS; break;
|
||||
+ case POPT_WHATENHANCES: qva->qva_source |= RPMQV_WHATENHANCES; break;
|
||||
case POPT_TRIGGEREDBY: qva->qva_source |= RPMQV_TRIGGEREDBY; break;
|
||||
case POPT_QUERYBYPKGID: qva->qva_source |= RPMQV_PKGID; break;
|
||||
case POPT_QUERYBYHDRID: qva->qva_source |= RPMQV_HDRID; break;
|
||||
@@ -93,6 +101,14 @@ struct poptOption rpmQVSourcePoptTable[] = {
|
||||
N_("query/verify the package(s) which require a dependency"), "CAPABILITY" },
|
||||
{ "whatprovides", '\0', 0, 0, POPT_WHATPROVIDES,
|
||||
N_("query/verify the package(s) which provide a dependency"), "CAPABILITY" },
|
||||
+ { "whatrecommends", '\0', 0, 0, POPT_WHATRECOMMENDS,
|
||||
+ N_("query/verify the package(s) which recommends a dependency"), "CAPABILITY" },
|
||||
+ { "whatsuggests", '\0', 0, 0, POPT_WHATSUGGESTS,
|
||||
+ N_("query/verify the package(s) which suggests a dependency"), "CAPABILITY" },
|
||||
+ { "whatsupplements", '\0', 0, 0, POPT_WHATSUPPLEMENTS,
|
||||
+ N_("query/verify the package(s) which supplements a dependency"), "CAPABILITY" },
|
||||
+ { "whatenhances", '\0', 0, 0, POPT_WHATENHANCES,
|
||||
+ N_("query/verify the package(s) which enhances a dependency"), "CAPABILITY" },
|
||||
|
||||
{ "noglob", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &giFlags, RPMGI_NOGLOB,
|
||||
N_("do not glob arguments"), NULL},
|
||||
diff --git a/lib/query.c b/lib/query.c
|
||||
index 896ebe3..b15b99b 100644
|
||||
--- a/lib/query.c
|
||||
+++ b/lib/query.c
|
||||
@@ -384,6 +384,34 @@ static rpmdbMatchIterator initQueryIterator(QVA_t qva, rpmts ts, const char * ar
|
||||
}
|
||||
break;
|
||||
|
||||
+ case RPMQV_WHATRECOMMENDS:
|
||||
+ mi = rpmtsInitIterator(ts, RPMDBI_RECOMMENDNAME, arg, 0);
|
||||
+ if (mi == NULL) {
|
||||
+ rpmlog(RPMLOG_NOTICE, _("no package recommends %s\n"), arg);
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case RPMQV_WHATSUGGESTS:
|
||||
+ mi = rpmtsInitIterator(ts, RPMDBI_SUGGESTNAME, arg, 0);
|
||||
+ if (mi == NULL) {
|
||||
+ rpmlog(RPMLOG_NOTICE, _("no package suggests %s\n"), arg);
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case RPMQV_WHATSUPPLEMENTS:
|
||||
+ mi = rpmtsInitIterator(ts, RPMDBI_SUPPLEMENTNAME, arg, 0);
|
||||
+ if (mi == NULL) {
|
||||
+ rpmlog(RPMLOG_NOTICE, _("no package supplements %s\n"), arg);
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case RPMQV_WHATENHANCES:
|
||||
+ mi = rpmtsInitIterator(ts, RPMDBI_ENHANCENAME, arg, 0);
|
||||
+ if (mi == NULL) {
|
||||
+ rpmlog(RPMLOG_NOTICE, _("no package enhances %s\n"), arg);
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
case RPMQV_WHATPROVIDES:
|
||||
if (arg[0] != '/' && arg[0] != '.') {
|
||||
mi = rpmtsInitIterator(ts, RPMDBI_PROVIDENAME, arg, 0);
|
||||
diff --git a/lib/rpmcli.h b/lib/rpmcli.h
|
||||
index 48e8250..4adb3d1 100644
|
||||
--- a/lib/rpmcli.h
|
||||
+++ b/lib/rpmcli.h
|
||||
@@ -91,6 +91,10 @@ enum rpmQVSources_e {
|
||||
RPMQV_HDRID, /*!< ... from header id (immutable header SHA1). */
|
||||
RPMQV_TID, /*!< ... from install transaction id (time stamp). */
|
||||
RPMQV_SPECSRPM, /*!< ... from spec file source (query only). */
|
||||
+ RPMQV_WHATRECOMMENDS, /*!< ... from recommends db search. */
|
||||
+ RPMQV_WHATSUGGESTS, /*!< ... from suggests db search. */
|
||||
+ RPMQV_WHATSUPPLEMENTS, /*!< ... from supplements db search. */
|
||||
+ RPMQV_WHATENHANCES, /*!< ... from enhances db search. */
|
||||
};
|
||||
|
||||
typedef rpmFlags rpmQVSources;
|
||||
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
|
||||
index b6d3247..baa1974 100644
|
||||
--- a/lib/rpmdb.c
|
||||
+++ b/lib/rpmdb.c
|
||||
@@ -493,6 +493,10 @@ static rpmdb newRpmdb(const char * root, const char * home,
|
||||
RPMDBI_INSTALLTID,
|
||||
RPMDBI_SIGMD5,
|
||||
RPMDBI_SHA1HEADER,
|
||||
+ RPMDBI_RECOMMENDNAME,
|
||||
+ RPMDBI_SUGGESTNAME,
|
||||
+ RPMDBI_SUPPLEMENTNAME,
|
||||
+ RPMDBI_ENHANCENAME,
|
||||
};
|
||||
|
||||
if (!(db_home && db_home[0] != '%')) {
|
||||
diff --git a/lib/rpmtag.h b/lib/rpmtag.h
|
||||
index 12a2a50..1dc1c2b 100644
|
||||
--- a/lib/rpmtag.h
|
||||
+++ b/lib/rpmtag.h
|
||||
@@ -353,6 +353,10 @@ typedef enum rpmDbiTag_e {
|
||||
RPMDBI_SIGMD5 = RPMTAG_SIGMD5,
|
||||
RPMDBI_SHA1HEADER = RPMTAG_SHA1HEADER,
|
||||
RPMDBI_INSTFILENAMES = RPMTAG_INSTFILENAMES,
|
||||
+ RPMDBI_RECOMMENDNAME = RPMTAG_RECOMMENDNAME,
|
||||
+ RPMDBI_SUGGESTNAME = RPMTAG_SUGGESTNAME,
|
||||
+ RPMDBI_SUPPLEMENTNAME = RPMTAG_SUPPLEMENTNAME,
|
||||
+ RPMDBI_ENHANCENAME = RPMTAG_ENHANCENAME,
|
||||
} rpmDbiTag;
|
||||
|
||||
/** \ingroup signature
|
16
rpm-4.12.0.x-CVE-2013-6435.patch
Normal file
16
rpm-4.12.0.x-CVE-2013-6435.patch
Normal file
@ -0,0 +1,16 @@
|
||||
--- rpm-4.12.0.1/lib/fsm.c.orig 2014-12-12 16:05:51.683430313 +0100
|
||||
+++ rpm-4.12.0.1/lib/fsm.c 2014-12-12 16:08:28.046025597 +0100
|
||||
@@ -215,7 +215,12 @@ static int expandRegular(rpmfi fi, const
|
||||
FD_t wfd = NULL;
|
||||
int rc = 0;
|
||||
|
||||
- wfd = Fopen(dest, "w.ufdio");
|
||||
+ /* Create the file with 000 permissions. */
|
||||
+ {
|
||||
+ mode_t old_umask = umask(0777);
|
||||
+ wfd = Fopen(dest, "w.ufdio");
|
||||
+ umask(old_umask);
|
||||
+ }
|
||||
if (Ferror(wfd)) {
|
||||
rc = RPMERR_OPEN_FAILED;
|
||||
goto exit;
|
14
rpm-4.12.0.x-CVE-2014-8118.patch
Normal file
14
rpm-4.12.0.x-CVE-2014-8118.patch
Normal file
@ -0,0 +1,14 @@
|
||||
diff --git a/lib/cpio.c b/lib/cpio.c
|
||||
index 253ff0f..600633a 100644
|
||||
--- a/lib/cpio.c
|
||||
+++ b/lib/cpio.c
|
||||
@@ -399,6 +399,9 @@ int rpmcpioHeaderRead(rpmcpio_t cpio, char ** path, int * fx)
|
||||
|
||||
GET_NUM_FIELD(hdr.filesize, fsize);
|
||||
GET_NUM_FIELD(hdr.namesize, nameSize);
|
||||
+ if (nameSize <= 0 || nameSize > 4096) {
|
||||
+ return RPMERR_BAD_HEADER;
|
||||
+ }
|
||||
|
||||
char name[nameSize + 1];
|
||||
read = Fread(name, nameSize, 1, cpio->fd);
|
63
rpm-4.12.x-weakdeps-manpage.patch
Normal file
63
rpm-4.12.x-weakdeps-manpage.patch
Normal file
@ -0,0 +1,63 @@
|
||||
From c336b1474402a566d5351ff41c45559d02a3389a Mon Sep 17 00:00:00 2001
|
||||
From: Florian Festi <ffesti@redhat.com>
|
||||
Date: Wed, 24 Jun 2015 15:48:23 +0200
|
||||
Subject: [PATCH] Add --enhances, --recommends, --suggests and --supplements to
|
||||
the man page
|
||||
|
||||
---
|
||||
doc/rpm.8 | 22 ++++++++++++++++++----
|
||||
1 file changed, 18 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/doc/rpm.8 b/doc/rpm.8
|
||||
index c91ce3b..136a595 100644
|
||||
--- a/doc/rpm.8
|
||||
+++ b/doc/rpm.8
|
||||
@@ -66,10 +66,12 @@ rpm \- RPM Package Manager
|
||||
|
||||
|
||||
[\fB--changelog\fR] [\fB-c,--configfiles\fR] [\fB--conflicts\fR]
|
||||
- [\fB-d,--docfiles\fR] [\fB--dump\fR] [\fB--filesbypkg\fR] [\fB-i,--info\fR]
|
||||
- [\fB--last\fR] [\fB-l,--list\fR] [\fB--obsoletes\fR] [\fB--provides\fR]
|
||||
- [\fB--qf,--queryformat \fIQUERYFMT\fB\fR] [\fB-R,--requires\fR]
|
||||
- [\fB--scripts\fR] [\fB-s,--state\fR] [\fB--triggers,--triggerscripts\fR]
|
||||
+ [\fB-d,--docfiles\fR] [\fB--dump\fR] [\fB--enhances\fR] [\fB--filesbypkg\fR]
|
||||
+ [\fB-i,--info\fR] [\fB--last\fR] [\fB-l,--list\fR] [\fB--obsoletes\fR]
|
||||
+ [\fB--provides\fR] [\fB--qf,--queryformat \fIQUERYFMT\fB\fR]
|
||||
+ [\fB--recommends\fR] [\fB-R,--requires\fR] [\fB--suggests\fR]
|
||||
+ [\fB--supplements\fR] [\fB--scripts\fR] [\fB-s,--state\fR]
|
||||
+ [\fB--triggers,--triggerscripts\fR]
|
||||
|
||||
.SS "verify-options"
|
||||
.PP
|
||||
@@ -628,6 +630,9 @@ path size mtime digest mode owner group isconfig isdoc rdev symlink
|
||||
.fi
|
||||
.RE
|
||||
.TP
|
||||
+\fB--enhances\fR
|
||||
+List capabilities enhanced by package(s)
|
||||
+.TP
|
||||
\fB--filesbypkg\fR
|
||||
List all the files in each selected package.
|
||||
.TP
|
||||
@@ -651,9 +656,18 @@ List packages this package obsoletes.
|
||||
\fB--provides\fR
|
||||
List capabilities this package provides.
|
||||
.TP
|
||||
+\fB--recommends\fR
|
||||
+List capabilities recommended by package(s)
|
||||
+.TP
|
||||
\fB-R, --requires\fR
|
||||
List capabilities on which this package depends.
|
||||
.TP
|
||||
+\fB--suggests\fR
|
||||
+List capabilities suggested by package(s)
|
||||
+.TP
|
||||
+\fB--supplements\fR
|
||||
+List capabilities supplemented by package(s)
|
||||
+.TP
|
||||
\fB--scripts\fR
|
||||
List the package specific scriptlet(s) that are used as part
|
||||
of the installation and uninstallation processes.
|
||||
--
|
||||
2.1.0
|
||||
|
27
rpm-4.13.0-rpmtd-out-of-bounds.patch
Normal file
27
rpm-4.13.0-rpmtd-out-of-bounds.patch
Normal file
@ -0,0 +1,27 @@
|
||||
From b722cf86200505b3e3fcbb2095c4ff61f1f5a2ab Mon Sep 17 00:00:00 2001
|
||||
From: Lubos Kardos <lkardos@redhat.com>
|
||||
Date: Mon, 25 Apr 2016 13:31:08 +0200
|
||||
Subject: [PATCH 1/2] Fix reading rpmtd behind its size in formatValue()
|
||||
(rhbz:1316896)
|
||||
|
||||
When it is read from index higher than size of rpmtd, return "(none)".
|
||||
---
|
||||
lib/headerfmt.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/headerfmt.c b/lib/headerfmt.c
|
||||
index fb29d6f..f6fd707 100644
|
||||
--- a/lib/headerfmt.c
|
||||
+++ b/lib/headerfmt.c
|
||||
@@ -623,7 +623,7 @@ static char * formatValue(headerSprintfArgs hsa, sprintfTag tag, int element)
|
||||
char * t, * te;
|
||||
rpmtd td;
|
||||
|
||||
- if ((td = getData(hsa, tag->tag))) {
|
||||
+ if ((td = getData(hsa, tag->tag)) && td->count > element) {
|
||||
td->ix = element; /* Ick, use iterators instead */
|
||||
val = tag->fmt(td);
|
||||
} else {
|
||||
--
|
||||
1.9.3
|
||||
|
33
rpm-4.13.0-stringFormat-sigsegv.patch
Normal file
33
rpm-4.13.0-stringFormat-sigsegv.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From cddf43a56f19711866371f02f378dc4095b0fadd Mon Sep 17 00:00:00 2001
|
||||
From: Lubos Kardos <lkardos@redhat.com>
|
||||
Date: Mon, 25 Apr 2016 14:38:47 +0200
|
||||
Subject: [PATCH 2/2] Fix sigsegv in stringFormat() (rhbz:1316903)
|
||||
|
||||
Just skip duping of NULL and return it. Returned NULL is handled in
|
||||
upper layer.
|
||||
---
|
||||
lib/formats.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/formats.c b/lib/formats.c
|
||||
index e3626ed..bad0b2d 100644
|
||||
--- a/lib/formats.c
|
||||
+++ b/lib/formats.c
|
||||
@@ -44,9 +44,12 @@ static char * stringFormat(rpmtd td)
|
||||
case RPM_NUMERIC_CLASS:
|
||||
rasprintf(&val, "%" PRIu64, rpmtdGetNumber(td));
|
||||
break;
|
||||
- case RPM_STRING_CLASS:
|
||||
- val = xstrdup(rpmtdGetString(td));
|
||||
+ case RPM_STRING_CLASS: {
|
||||
+ const char *str = rpmtdGetString(td);
|
||||
+ if (str)
|
||||
+ val = xstrdup(str);
|
||||
break;
|
||||
+ }
|
||||
case RPM_BINARY_CLASS:
|
||||
val = pgpHexStr(td->data, td->count);
|
||||
break;
|
||||
--
|
||||
1.9.3
|
||||
|
12
rpm-4.8.1-use-gpg2.patch
Normal file
12
rpm-4.8.1-use-gpg2.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -up rpm-4.8.1/macros.in.gpg2 rpm-4.8.1/macros.in
|
||||
--- rpm-4.8.0/macros.in.gpg2 2011-01-17 12:17:38.000000000 +0200
|
||||
+++ rpm-4.8.0/macros.in 2011-01-17 12:17:59.000000000 +0200
|
||||
@@ -40,7 +40,7 @@
|
||||
%__cp @__CP@
|
||||
%__cpio @__CPIO@
|
||||
%__file @__FILE@
|
||||
-%__gpg @__GPG@
|
||||
+%__gpg %{_bindir}/gpg2
|
||||
%__grep @__GREP@
|
||||
%__gzip @__GZIP@
|
||||
%__id @__ID@
|
@ -2,14 +2,14 @@ diff -up rpm-4.9.1.1/macros.in.jx rpm-4.9.1.1/macros.in
|
||||
--- rpm-4.9.1.1/macros.in.jx 2011-08-03 16:19:05.000000000 -0400
|
||||
+++ rpm-4.9.1.1/macros.in 2011-08-08 09:41:52.981064316 -0400
|
||||
@@ -674,9 +674,10 @@ print (t)\
|
||||
RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
|
||||
RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
|
||||
RPM_OPT_FLAGS=\"%{optflags}\"\
|
||||
+ RPM_LD_FLAGS=\"%{?build_ldflags}\"\
|
||||
+ RPM_LD_FLAGS=\"%{?__global_ldflags}\"\
|
||||
RPM_ARCH=\"%{_arch}\"\
|
||||
RPM_OS=\"%{_os}\"\
|
||||
RPM_BUILD_NCPUS=\"%{_smp_build_ncpus}\"\
|
||||
- export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS RPM_BUILD_NCPUS\
|
||||
+ export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_LD_FLAGS RPM_ARCH RPM_OS RPM_BUILD_NCPUS RPM_LD_FLAGS\
|
||||
- export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
|
||||
+ export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_LD_FLAGS RPM_ARCH RPM_OS\
|
||||
RPM_DOC_DIR=\"%{_docdir}\"\
|
||||
export RPM_DOC_DIR\
|
||||
RPM_PACKAGE_NAME=\"%{NAME}\"\
|
||||
RPM_PACKAGE_NAME=\"%{name}\"\
|
78
rpm-4.9.90-fedora-specspo.patch
Normal file
78
rpm-4.9.90-fedora-specspo.patch
Normal file
@ -0,0 +1,78 @@
|
||||
diff --git a/lib/tagexts.c b/lib/tagexts.c
|
||||
index dc0e0fb..e0a5d1f 100644
|
||||
--- a/lib/tagexts.c
|
||||
+++ b/lib/tagexts.c
|
||||
@@ -478,59 +478,29 @@ static const char * const _macro_i18ndomains = "%{?_i18ndomains}";
|
||||
*/
|
||||
static int i18nTag(Header h, rpmTag tag, rpmtd td, headerGetFlags hgflags)
|
||||
{
|
||||
- int rc;
|
||||
+ int rc = headerGet(h, tag, td, HEADERGET_ALLOC);
|
||||
#if defined(ENABLE_NLS)
|
||||
- char * dstring = rpmExpand(_macro_i18ndomains, NULL);
|
||||
-
|
||||
- td->type = RPM_STRING_TYPE;
|
||||
- td->data = NULL;
|
||||
- td->count = 0;
|
||||
-
|
||||
- if (dstring && *dstring) {
|
||||
- char *domain, *de;
|
||||
- const char * langval;
|
||||
- char * msgkey;
|
||||
- const char * msgid;
|
||||
-
|
||||
- rasprintf(&msgkey, "%s(%s)", headerGetString(h, RPMTAG_NAME),
|
||||
- rpmTagGetName(tag));
|
||||
-
|
||||
- /* change to en_US for msgkey -> msgid resolution */
|
||||
- langval = getenv(language);
|
||||
- (void) setenv(language, "en_US", 1);
|
||||
- ++_nl_msg_cat_cntr;
|
||||
+ if (rc) {
|
||||
+ char *de, *dstring = rpmExpand(_macro_i18ndomains, NULL);
|
||||
+ const char *domain;
|
||||
|
||||
- msgid = NULL;
|
||||
for (domain = dstring; domain != NULL; domain = de) {
|
||||
+ const char *msgid = td->data;
|
||||
+ const char *msg = NULL;
|
||||
+
|
||||
de = strchr(domain, ':');
|
||||
if (de) *de++ = '\0';
|
||||
- msgid = dgettext(domain, msgkey);
|
||||
- if (msgid != msgkey) break;
|
||||
- }
|
||||
-
|
||||
- /* restore previous environment for msgid -> msgstr resolution */
|
||||
- if (langval)
|
||||
- (void) setenv(language, langval, 1);
|
||||
- else
|
||||
- unsetenv(language);
|
||||
- ++_nl_msg_cat_cntr;
|
||||
-
|
||||
- if (domain && msgid) {
|
||||
- td->data = dgettext(domain, msgid);
|
||||
- td->data = xstrdup(td->data); /* XXX xstrdup has side effects. */
|
||||
- td->count = 1;
|
||||
- td->flags = RPMTD_ALLOCED;
|
||||
+ msg = dgettext(domain, td->data);
|
||||
+ if (msg != msgid) {
|
||||
+ free(td->data);
|
||||
+ td->data = xstrdup(msg);
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
- dstring = _free(dstring);
|
||||
- free(msgkey);
|
||||
- if (td->data)
|
||||
- return 1;
|
||||
+ free(dstring);
|
||||
}
|
||||
-
|
||||
- free(dstring);
|
||||
#endif
|
||||
|
||||
- rc = headerGet(h, tag, td, HEADERGET_ALLOC);
|
||||
return rc;
|
||||
}
|
||||
|
@ -1,19 +0,0 @@
|
||||
[Unit]
|
||||
Description=RPM database rebuild
|
||||
ConditionPathExists=/var/lib/rpm/.rebuilddb
|
||||
|
||||
# This should run before any daemons that may open the rpmdb
|
||||
DefaultDependencies=no
|
||||
After=sysinit.target
|
||||
Before=basic.target shutdown.target
|
||||
Conflicts=shutdown.target
|
||||
# In case /var is remote-mounted
|
||||
RequiresMountsFor=/var
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/rpmdb --rebuilddb
|
||||
ExecStartPost=rm -f /var/lib/rpm/.rebuilddb
|
||||
|
||||
[Install]
|
||||
WantedBy=basic.target
|
Loading…
Reference in New Issue
Block a user