summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/rpm
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/rpm/rpm')
-rw-r--r--meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch48
-rw-r--r--meta/recipes-devtools/rpm/rpm/dbconvert.patch27
-rw-r--r--meta/recipes-devtools/rpm/rpm/debugedit-segv.patch98
-rw-r--r--meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch65
-rw-r--r--meta/recipes-devtools/rpm/rpm/fstack-protector-configure-check.patch21
-rw-r--r--meta/recipes-devtools/rpm/rpm/header-include-fix.patch26
-rw-r--r--meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch33
-rwxr-xr-xmeta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh50
-rw-r--r--meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch33
-rwxr-xr-xmeta/recipes-devtools/rpm/rpm/pythondeps.sh16
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-CVE-2013-6435.patch109
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-CVE-2014-8118.patch43
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-autogen.patch25
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch136
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch19
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch162
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch77
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch65
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-disable-Wno-override-init.patch32
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch36
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch30
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch43
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch22
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch15
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch24
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-lua.patch33
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-macros.patch64
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch19
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch47
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch23
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch25
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch146
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch37
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch28
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-platform.patch137
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-platform2.patch105
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-py-init.patch27
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-realpath.patch24
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch31
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-remove-sykcparse-decl.patch14
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch40
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-fix.patch67
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch160
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-showrc.patch26
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch50
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch24
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch40
-rwxr-xr-xmeta/recipes-devtools/rpm/rpm/rpm2cpio39
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpmatch.patch42
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch194
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch32
-rw-r--r--meta/recipes-devtools/rpm/rpm/uclibc-support.patch63
-rw-r--r--meta/recipes-devtools/rpm/rpm/verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch38
53 files changed, 2830 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch b/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch
new file mode 100644
index 0000000000..d8ecf0f7bd
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch
@@ -0,0 +1,48 @@
1From 64851c6622aff64787a9fcea26cccde183b7c743 Mon Sep 17 00:00:00 2001
2From: "Roy.Li" <rongqing.li@windriver.com>
3Date: Tue, 11 Nov 2014 16:28:22 +0800
4Subject: [PATCH] using poptParseArgvString to parse the
5 _gpg_check_password_cmd
6
7Upstream-Status: Pending
8
9Both __gpg_check_password_cmd and __gpg_sign_cmd include "%{_gpg_name}", but
10strace shows that gpg_name has a quote when run _gpg_check_password,
11but not when run __gpg_sign_cmd; for example, if gpg_name is "tester"
12
13 execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose",
14 "--passphrase-fd", "3", "-u", "\"tester\"", "-so", "-"], [/* 20 vars */]) = 0
15
16 execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose", "--no-armor",
17 "--passphrase-fd", "3", "--no-secmem-warning", "-u", "tester", "-sbo"..,) = 0
18
19it can be fixed by removing the quote around %{gpg_name} when define
20__gpg_check_password_cmd in macros/macros, like below, but if gpg_name includes
21space, it will not work.
22
23 %__gpg_check_password_cmd %{__gpg} \
24 gpg --batch --no-verbose --passphrase-fd 3 -u %{_gpg_name} -so -
25
26The poptParseArgvString function is used to parse _gpg_sign_cmd, so using
27poptParseArgvString to parse __gpg_check_password_cmd to fix this issue.
28
29Signed-off-by: Roy.Li <rongqing.li@windriver.com>
30---
31 rpmdb/signature.c | 2 +-
32 1 file changed, 1 insertion(+), 1 deletion(-)
33
34diff --git a/rpmdb/signature.c b/rpmdb/signature.c
35index c35e0ab..016e8d1 100644
36--- a/rpmdb/signature.c
37+++ b/rpmdb/signature.c
38@@ -529,7 +529,7 @@ int rpmCheckPassPhrase(const char * passPhrase)
39 (void) setenv("GNUPGHOME", gpg_path, 1);
40
41 cmd = rpmExpand("%{?__gpg_check_password_cmd}", NULL);
42- rc = argvSplit(&av, cmd, NULL);
43+ rc = poptParseArgvString(cmd, NULL, (const char ***)&av);
44 if (!rc)
45 rc = execve(av[0], (char *const *)av+1, environ);
46
47--
481.9.1
diff --git a/meta/recipes-devtools/rpm/rpm/dbconvert.patch b/meta/recipes-devtools/rpm/rpm/dbconvert.patch
new file mode 100644
index 0000000000..78de7d99d2
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/dbconvert.patch
@@ -0,0 +1,27 @@
1Upstream-Status: Not applicable
2
3Hack to prevent unneeded demo app from building on older libc
4where it will break the build
5
6Index: rpm-5.4.14/tools/Makefile.am
7===================================================================
8--- rpm-5.4.14.orig/tools/Makefile.am
9+++ rpm-5.4.14/tools/Makefile.am
10@@ -29,7 +29,7 @@ EXTRA_PROGRAMS = nix-copy-closure nix-en
11 xiu-instantiate xiu-store
12 noinst_PROGRAMS =
13
14-EXTRA_PROGRAMS += augtool cudftool dbconvert debugedit \
15+EXTRA_PROGRAMS += augtool cudftool debugedit \
16 nix-build nix-channel nix-collect-garbage \
17 nix-log2xml nix-prefetch-url nix-pull nix-push \
18 xiu-echo xiu-hash \
19@@ -64,7 +64,7 @@ pkgbin_PROGRAMS = \
20 rpmcache rpmdigest rpmrepo rpmspecdump \
21 rpmcmp rpmdeps rpmdeps-oecore sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@
22 if WITH_DB
23-pkgbin_PROGRAMS += dbconvert
24+pkgbin_PROGRAMS +=
25 endif
26 dist_man_MANS = rpmgrep.1
27
diff --git a/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch b/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch
new file mode 100644
index 0000000000..beef5edd9d
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch
@@ -0,0 +1,98 @@
1During the recalculation of the buildid, it's necessary to change the word
2back to the original endian. However, if we do this in-place, we've also
3affected the headers that we're also working on. The side effect of this is
4we can no longer rely on 'sh_type' as it may have been changed.
5
6This patch ensures that any time we translate the loaded data to the machine
7format, we only do it in a backup copy and never the original copy.
8
9Note: in all other places a backup copy was used, just not buildid processing.
10
11Also the process (...) function was modified to verify the data is not
12NULL as well. This is an extra check and is not strictly necessary.
13
14Upstream-Status: Pending
15
16Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
17
18Index: rpm-5.4.14/tools/debugedit.c
19===================================================================
20--- rpm-5.4.14.orig/tools/debugedit.c
21+++ rpm-5.4.14/tools/debugedit.c
22@@ -1445,21 +1445,24 @@ handle_build_id (DSO *dso, Elf_Data *bui
23 auto inline void process (const void *data, size_t size)
24 {
25 memchunk chunk = { .data = (void *) data, .size = size };
26- hashFunctionContextUpdateMC (&ctx, &chunk);
27+ if (data != NULL && size != 0)
28+ hashFunctionContextUpdateMC (&ctx, &chunk);
29 }
30 union
31 {
32 GElf_Ehdr ehdr;
33 GElf_Phdr phdr;
34 GElf_Shdr shdr;
35- } u;
36- Elf_Data x = { .d_version = EV_CURRENT, .d_buf = &u };
37+ } u1, u2;
38+ Elf_Data src = { .d_version = EV_CURRENT, .d_buf = &u1 };
39+ Elf_Data dest = { .d_version = EV_CURRENT, .d_buf = &u2 };
40
41- x.d_type = ELF_T_EHDR;
42- x.d_size = sizeof u.ehdr;
43- u.ehdr = dso->ehdr;
44- u.ehdr.e_phoff = u.ehdr.e_shoff = 0;
45- if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
46+ src.d_type = ELF_T_EHDR;
47+ src.d_size = sizeof u1.ehdr;
48+ dest.d_size = sizeof u2.ehdr;
49+ u1.ehdr = dso->ehdr;
50+ u1.ehdr.e_phoff = u1.ehdr.e_shoff = 0;
51+ if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL)
52 {
53 bad:
54 fprintf (stderr, "Failed to compute header checksum: %s\n",
55@@ -1467,29 +1470,31 @@ handle_build_id (DSO *dso, Elf_Data *bui
56 exit (1);
57 }
58
59- x.d_type = ELF_T_PHDR;
60- x.d_size = sizeof u.phdr;
61+ src.d_type = ELF_T_PHDR;
62+ src.d_size = sizeof u1.phdr;
63+ dest.d_size = sizeof u2.phdr;
64 for (i = 0; i < dso->ehdr.e_phnum; ++i)
65 {
66- if (gelf_getphdr (dso->elf, i, &u.phdr) == NULL)
67+ if (gelf_getphdr (dso->elf, i, &u1.phdr) == NULL)
68 goto bad;
69- if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
70+ if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL)
71 goto bad;
72- process (x.d_buf, x.d_size);
73+ process (dest.d_buf, dest.d_size);
74 }
75
76- x.d_type = ELF_T_SHDR;
77- x.d_size = sizeof u.shdr;
78+ src.d_type = ELF_T_SHDR;
79+ src.d_size = sizeof u1.shdr;
80+ dest.d_size = sizeof u2.shdr;
81 for (i = 0; i < dso->ehdr.e_shnum; ++i)
82 if (dso->scn[i] != NULL)
83 {
84- u.shdr = dso->shdr[i];
85- u.shdr.sh_offset = 0;
86- if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
87+ u1.shdr = dso->shdr[i];
88+ u1.shdr.sh_offset = 0;
89+ if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL)
90 goto bad;
91- process (x.d_buf, x.d_size);
92+ process (dest.d_buf, dest.d_size);
93
94- if (u.shdr.sh_type != SHT_NOBITS)
95+ if (u1.shdr.sh_type != SHT_NOBITS)
96 {
97 Elf_Data *d = elf_rawdata (dso->scn[i], NULL);
98 if (d == NULL)
diff --git a/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch b/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch
new file mode 100644
index 0000000000..f7c31006b4
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch
@@ -0,0 +1,65 @@
1debugedit: fix segment fault while file's bss offset have a large number
2
3While ELF_C_RDWR_MMAP was used, elf_begin invoked mmap() to map file
4into memory. While the file's bss Offset has a large number, elf_update
5caculated file size by __elf64_updatenull_wrlock and the size was
6enlarged.
7
8In this situation, elf_update invoked ftruncate to enlarge the file,
9and memory size (elf->maximum_size) also was incorrectly updated.
10There was segment fault in elf_end which invoked munmap with the
11length is the enlarged file size, not the mmap's length.
12
13Before the above operations, invoke elf_begin/elf_update/elf_end
14with ELF_C_RDWR and ELF_F_LAYOUT set to enlarge the above file, it
15could make sure the file is safe for the following elf operations.
16
17Upstream-Status: Pending
18Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
19---
20 tools/debugedit.c | 25 +++++++++++++++++++++++++
21 1 file changed, 25 insertions(+)
22
23Index: rpm-5.4.14/tools/debugedit.c
24===================================================================
25--- rpm-5.4.14.orig/tools/debugedit.c
26+++ rpm-5.4.14/tools/debugedit.c
27@@ -1525,6 +1525,28 @@ handle_build_id (DSO *dso, Elf_Data *bui
28 }
29 }
30
31+/* It avoided the segment fault while file's bss offset have a large number.
32+ See https://bugzilla.redhat.com/show_bug.cgi?id=1019707
33+ https://bugzilla.redhat.com/show_bug.cgi?id=1020842 for detail. */
34+void valid_file(int fd)
35+{
36+ Elf *elf = elf_begin (fd, ELF_C_RDWR, NULL);
37+ if (elf == NULL)
38+ {
39+ error (1, 0, "elf_begin: %s", elf_errmsg (-1));
40+ return;
41+ }
42+
43+ elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT);
44+
45+ if (elf_update (elf, ELF_C_WRITE) < 0)
46+ error (1, 0, "elf_update: %s", elf_errmsg (-1));
47+
48+ elf_end (elf);
49+
50+ return;
51+}
52+
53 int
54 main (int argc, char *argv[])
55 {
56@@ -1621,6 +1643,9 @@ main (int argc, char *argv[])
57 exit (1);
58 }
59
60+ /* Make sure the file is valid. */
61+ valid_file(fd);
62+
63 dso = fdopen_dso (fd, file);
64 if (dso == NULL)
65 exit (1);
diff --git a/meta/recipes-devtools/rpm/rpm/fstack-protector-configure-check.patch b/meta/recipes-devtools/rpm/rpm/fstack-protector-configure-check.patch
new file mode 100644
index 0000000000..976af486fb
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/fstack-protector-configure-check.patch
@@ -0,0 +1,21 @@
1Some options checked in this loop are needing linking to find out
2if the option can be used or not e.g. -fstack-protector which needs
3libssp to be staged and available for compiler to link against
4Therefore we change the compile only check to compile and link check
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7Upstream-Status: Pending
8
9Index: rpm-5.4.14/configure.ac
10===================================================================
11--- rpm-5.4.14.orig/configure.ac
12+++ rpm-5.4.14/configure.ac
13@@ -201,7 +201,7 @@ dnl # GNU GCC (usually "gcc")
14 my_save_cflags="$CFLAGS"
15 CFLAGS=$c
16 AC_MSG_CHECKING([whether GCC supports $c])
17- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
18+ AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
19 [AC_MSG_RESULT([yes])]
20 [my_cflags=$c],
21 [AC_MSG_RESULT([no])]
diff --git a/meta/recipes-devtools/rpm/rpm/header-include-fix.patch b/meta/recipes-devtools/rpm/rpm/header-include-fix.patch
new file mode 100644
index 0000000000..5ffb187ff3
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/header-include-fix.patch
@@ -0,0 +1,26 @@
1Upstream-Status: Pending
2
3Index: rpm-5.4.14/rpmdb/rpmdb.h
4===================================================================
5--- rpm-5.4.14.orig/rpmdb/rpmdb.h
6+++ rpm-5.4.14/rpmdb/rpmdb.h
7@@ -9,6 +9,7 @@
8
9 #include <assert.h>
10 #include <mire.h>
11+#include <errno.h>
12
13 #include <rpmtypes.h>
14 #include <rpmtag.h> /* XXX Header typedef */
15Index: rpm-5.4.14/rpmdb/rpmtag.h
16===================================================================
17--- rpm-5.4.14.orig/rpmdb/rpmtag.h
18+++ rpm-5.4.14/rpmdb/rpmtag.h
19@@ -7,6 +7,7 @@
20
21 #include <rpmiotypes.h>
22 #include <rpmsw.h>
23+#include <stdint.h>
24
25 #ifdef __cplusplus
26 extern "C" {
diff --git a/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch b/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch
new file mode 100644
index 0000000000..8fab9eb42f
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch
@@ -0,0 +1,33 @@
1rpm: Resolve parallel install issue when installing lua
2
3When lua is being installed on some systems that are being run with high levels
4of parallelization there are cases where install-data-am and install-exec-hook
5are processed at the same or a very short time apart. This causes
6install-pkgbinPROGRAMS, which is a dependency of both, to be run at around the
7same time This sometimes causes file contention and will sometimes be in a state
8where install-exec-hook is looking for a file that is being installed or both
9install-pkgbinPROGRAMS being run are installing the same file and fail because
10it cannon create a new file.
11
12This patch allows install-exec-hook to be called by install-data-am instead of
13install-exec-am. It also removed the dependency in install-data-hook on
14install-pkgbinPROGRAMS. This means install-pkgbinPROGRAMS will only be run once
15so there whould be any file contention.
16
17Upstream-Status: Pending
18
19Signed-off-by: Morgan Little <morgan.little@windriver.com>
20
21Index: rpm-5.4.14/lua/Makefile.am
22===================================================================
23--- rpm-5.4.14.orig/lua/Makefile.am
24+++ rpm-5.4.14/lua/Makefile.am
25@@ -326,7 +326,7 @@ clean-local:
26 # XXX Build & install as rpmlua/rpmluac with hardlinks to lua/luac post install.
27 # XXX CVS has lua/luac sub-directories in the Attic that collide with the
28 # XXX lua/luac executable names when using cvs update.
29-install-exec-hook: install-pkgbinPROGRAMS
30+install-data-hook:
31 mkdir -p $(DESTDIR)$(pkgbindir)
32 $(__RM) -f $(DESTDIR)$(pkgbindir)/lua
33 $(__LN) $(DESTDIR)$(pkgbindir)/rpmlua $(DESTDIR)$(pkgbindir)/lua
diff --git a/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh b/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh
new file mode 100755
index 0000000000..b72c9f0265
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh
@@ -0,0 +1,50 @@
1#!/bin/bash
2
3: ${RPMDEPS:=rpmdeps}
4
5process() {
6 while read file_name ; do
7 printf "%s\t" ${file_name}
8 if [ ! -d $file_name ]; then
9 printf "%s " $($RPMDEPS $1 $file_name | sed -e 's,rpmlib(.*,,' -e 's,\([<>\=]\+ \+[^ ]*\),(\1),g')
10 fi
11 printf "\n"
12 done
13}
14
15usage() {
16 echo "$0 {-P|--provides} {-R|--requires} FILE ..."
17}
18
19while [ $# -gt 0 ]; do
20 case "$1" in
21 --rpmdeps)
22 RPMDEPS=$2
23 shift
24 shift
25 ;;
26 -R|--requires)
27 process_type=--requires
28 shift
29 ;;
30 -P|--provides)
31 process_type=--provides
32 shift
33 ;;
34 *)
35 break;
36 ;;
37 esac
38done
39
40if [ -z "$process_type" ]; then
41 usage
42 exit 1
43fi
44
45if [ $# -gt 0 ]; then
46 find "$@" | process $process_type
47 exit $?
48fi
49
50process $process_type
diff --git a/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch b/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch
new file mode 100644
index 0000000000..a538a60bb9
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch
@@ -0,0 +1,33 @@
1rpmmodule.c: Export a few additional RPMSENSE values
2
3We want to see the RPMSENSE_SCRIPT values for use with SMART. We also
4want to see the MISSINGOK value so we can avoid recommended packages causing
5failures.
6
7Upstream-Status: Pending
8
9Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
10
11Index: rpm-5.4.14/python/rpmmodule.c
12===================================================================
13--- rpm-5.4.14.orig/python/rpmmodule.c
14+++ rpm-5.4.14/python/rpmmodule.c
15@@ -494,12 +494,16 @@ void init_rpm(void)
16 REGISTER_ENUM(RPMSENSE_EQUAL);
17 REGISTER_ENUM(RPMSENSE_NOTEQUAL);
18 REGISTER_ENUM(RPMSENSE_FIND_REQUIRES);
19-#if defined(RPM_VENDOR_MANDRIVA)
20+#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
21 REGISTER_ENUM(RPMSENSE_PREREQ);
22 REGISTER_ENUM(RPMSENSE_SCRIPT_PRE);
23 REGISTER_ENUM(RPMSENSE_SCRIPT_POST);
24 REGISTER_ENUM(RPMSENSE_SCRIPT_PREUN);
25- REGISTER_ENUM(RPMSENSE_SCRIPT_POSTUN)
26+ REGISTER_ENUM(RPMSENSE_SCRIPT_POSTUN);
27+#endif
28+
29+#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
30+ REGISTER_ENUM(RPMSENSE_MISSINGOK);
31 #endif
32
33 REGISTER_ENUM(RPMDEPS_FLAG_NOUPGRADE);
diff --git a/meta/recipes-devtools/rpm/rpm/pythondeps.sh b/meta/recipes-devtools/rpm/rpm/pythondeps.sh
new file mode 100755
index 0000000000..083b174f17
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/pythondeps.sh
@@ -0,0 +1,16 @@
1#!/bin/sh
2
3[ $# -ge 1 ] || {
4 cat > /dev/null
5 exit 0
6}
7
8case $1 in
9-R|--requires)
10 shift
11 grep "/usr/\(lib[^/]*\|share\)/python[^/]*/" >/dev/null && echo "python"
12 exit 0
13 ;;
14esac
15
16exit 0
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-CVE-2013-6435.patch b/meta/recipes-devtools/rpm/rpm/rpm-CVE-2013-6435.patch
new file mode 100644
index 0000000000..b107e8f047
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-CVE-2013-6435.patch
@@ -0,0 +1,109 @@
1From 08105acda1da63d32fbb18596a3d6c3e0aa106d1 Mon Sep 17 00:00:00 2001
2From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
3Date: Wed, 10 Jun 2015 14:36:56 +0000
4Subject: [PATCH 2/2] rpm: CVE-2013-6435
5
6Upstream-Status: Backport
7
8Reference:
9https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2013-6435
10
11Description:
12It was found that RPM wrote file contents to the target installation
13directory under a temporary name, and verified its cryptographic signature
14only after the temporary file has been written completely. Under certain
15conditions, the system interprets the unverified temporary file contents
16and extracts commands from it. This could allow an attacker to modify
17signed RPM files in such a way that they would execute code chosen
18by the attacker during package installation.
19
20Original Patch:
21https://bugzilla.redhat.com/attachment.cgi?id=956207
22
23Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
24---
25 lib/fsm.c | 2 +-
26 rpmio/rpmio.c | 18 ++++++++++++++----
27 2 files changed, 15 insertions(+), 5 deletions(-)
28
29diff --git a/lib/fsm.c b/lib/fsm.c
30index 1ee7e67..094eb1d 100644
31--- a/lib/fsm.c
32+++ b/lib/fsm.c
33@@ -726,7 +726,7 @@ static int expandRegular(FSM_t fsm, rpmpsm psm, rpmcpio_t archive, int nodigest)
34 {
35 FD_t wfd = NULL;
36 const struct stat * st = &fsm->sb;
37- rpm_loff_t left = st->st_size;
38+ rpm_loff_t left = rpmfiFSizeIndex(fsmGetFi(fsm), fsm->ix);
39 const unsigned char * fidigest = NULL;
40 pgpHashAlgo digestalgo = 0;
41 int rc = 0;
42diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
43index cd223e8..0b12e31 100644
44--- a/rpmio/rpmio.c
45+++ b/rpmio/rpmio.c
46@@ -1309,15 +1309,19 @@ int Fclose(FD_t fd)
47 * - bzopen: [1-9] is block size (modulo 100K)
48 * - bzopen: 's' is smallmode
49 * - HACK: '.' terminates, rest is type of I/O
50+ * - 'U' sets *mode to zero (no permissions) instead of 0666
51 */
52 static void cvtfmode (const char *m,
53 char *stdio, size_t nstdio,
54 char *other, size_t nother,
55- const char **end, int * f)
56+ const char **end, int *f, mode_t *mode)
57 {
58 int flags = 0;
59 char c;
60
61+ if (mode)
62+ *mode = 0666;
63+
64 switch (*m) {
65 case 'a':
66 flags |= O_WRONLY | O_CREAT | O_APPEND;
67@@ -1357,6 +1361,10 @@ static void cvtfmode (const char *m,
68 if (--nstdio > 0) *stdio++ = c;
69 continue;
70 break;
71+ case 'U':
72+ if (mode)
73+ *mode = 0;
74+ break;
75 default:
76 if (--nother > 0) *other++ = c;
77 continue;
78@@ -1385,7 +1393,8 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n", fd, fmode, fdbg(fd));
79 if (fd == NULL || fmode == NULL)
80 return NULL;
81
82- cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, NULL);
83+ cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, NULL,
84+ NULL);
85 if (stdio[0] == '\0')
86 return NULL;
87 zstdio[0] = '\0';
88@@ -1436,7 +1445,7 @@ FD_t Fopen(const char *path, const char *fmode)
89 {
90 char stdio[20], other[20];
91 const char *end = NULL;
92- mode_t perms = 0666;
93+ mode_t perms;
94 int flags = 0;
95 FD_t fd;
96
97@@ -1444,7 +1453,8 @@ FD_t Fopen(const char *path, const char *fmode)
98 return NULL;
99
100 stdio[0] = '\0';
101- cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, &flags);
102+ cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, &flags,
103+ &perms);
104 if (stdio[0] == '\0')
105 return NULL;
106
107--
1081.8.4.5
109
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-CVE-2014-8118.patch b/meta/recipes-devtools/rpm/rpm/rpm-CVE-2014-8118.patch
new file mode 100644
index 0000000000..bf1795ca49
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-CVE-2014-8118.patch
@@ -0,0 +1,43 @@
1From 71c812edf1431a9967bd99ba6ffa6ab89eb7ec7c Mon Sep 17 00:00:00 2001
2From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
3Date: Wed, 10 Jun 2015 12:56:55 +0000
4Subject: [PATCH 1/2] rpm: CVE-2014-8118
5
6Upstream-Status: Backport
7
8Reference:
9https://bugzilla.redhat.com/show_bug.cgi?id=1168715
10
11Description:
12It was found that RPM could encounter an integer overflow,
13leading to a stack-based overflow, while parsing a crafted
14CPIO header in the payload section of an RPM file. This could
15allow an attacker to modify signed RPM files in such a way that
16they would execute code chosen by the attacker during package
17installation.
18
19Original Patch:
20https://bugzilla.redhat.com/attachment.cgi?id=962159
21
22Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
23---
24 lib/cpio.c | 3 +++
25 1 file changed, 3 insertions(+)
26
27diff --git a/lib/cpio.c b/lib/cpio.c
28index 382eeb6..74ddd9c 100644
29--- a/lib/cpio.c
30+++ b/lib/cpio.c
31@@ -296,6 +296,9 @@ int rpmcpioHeaderRead(rpmcpio_t cpio, char ** path, struct stat * st)
32 st->st_rdev = makedev(major, minor);
33
34 GET_NUM_FIELD(hdr.namesize, nameSize);
35+ if (nameSize <= 0 || nameSize > 4096) {
36+ return CPIOERR_BAD_HEADER;
37+ }
38
39 *path = xmalloc(nameSize + 1);
40 read = Fread(*path, nameSize, 1, cpio->fd);
41--
421.8.4.5
43
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch b/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch
new file mode 100644
index 0000000000..8771235d30
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch
@@ -0,0 +1,25 @@
1Remove the sanity checking from the rpm autogen.sh. This is required because
2we may have slightly different, but yet compatible versions. If we do end
3up breaking things, we'll deal with it at that time.
4
5Upstream-Status: Inappropriate [configuration]
6
7Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
8
9Index: rpm-5.4.14/syck/autogen.sh
10===================================================================
11--- rpm-5.4.14.orig/syck/autogen.sh
12+++ rpm-5.4.14/syck/autogen.sh
13@@ -34,12 +34,6 @@ libtoolize () {
14 eval $_libtoolize $_libtoolize_args
15 }
16
17-# requirements sanity check
18-[ "`automake --version | head -1`" != "$AMV" ] && echo "$USAGE" # && exit 1
19-[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1
20-[ "`libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1
21-[ "`gettextize --version | head -1 | sed -e 's;^.*/\\(gettextize\\);\\1;'`" != "$GTT" ] && echo "$USAGE" # && exit 1
22-
23 echo "---> generate files via GNU libtool (libtoolize)"
24 libtoolize --quiet --copy --force --install
25 echo "---> generate files via GNU autoconf (aclocal, autoheader)"
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch b/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch
new file mode 100644
index 0000000000..41ab498a0f
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch
@@ -0,0 +1,136 @@
1lib/rpmrc.c: Update --target processing to support full GNU canonical arch
2
3Prior to this patch, when using --target, RPM supported the format:
4 <arch>
5 <arch>-<os>
6 <arch>-<os>-gnu
7 <arch>-<arbitrary items>-<os>
8 <arch>-<arbitrary items>-<os>-gnu
9
10This patch changes the list of supported items to:
11 <arch>
12 <arch>-<os>
13 <arch>-<os>-gnu
14 <arch>-<vendor>-<os>
15 <arch>-<vendor>-<os>-<extension>
16
17Upstream-Status: Pending
18
19Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
20
21Index: rpm-5.4.14/lib/rpmrc.c
22===================================================================
23--- rpm-5.4.14.orig/lib/rpmrc.c
24+++ rpm-5.4.14/lib/rpmrc.c
25@@ -925,8 +925,8 @@ static void getMachineInfo(int type, /*@
26
27 static void rpmRebuildTargetVars(const char ** target, const char ** canontarget)
28 {
29-
30- char *ca = NULL, *co = NULL, *ct = NULL;
31+ /* ca = arch, cv = vendor, co = os, ce = extension, ct = canon target */
32+ char *ca = NULL, *cv = NULL, *co = NULL, *ce = NULL, *ct = NULL;
33 int x;
34
35 /* Rebuild the compat table to recalculate the current target arch. */
36@@ -936,23 +936,60 @@ static void rpmRebuildTargetVars(const c
37 rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS);
38
39 if (target && *target) {
40+ /* GNU canonical format is:
41+ * <arch>-<vendor>-<os>[-extension]
42+ *
43+ * We support the both the GNU canonical format
44+ * as well as the traditional RPM formats:
45+ * <arch>
46+ * <arch>-<os>[-gnu]
47+ */
48 char *c;
49 /* Set arch and os from specified build target */
50 ca = xstrdup(*target);
51- if ((c = strchr(ca, '-')) != NULL) {
52+ if ((c = strchr(ca, '-')) == NULL) {
53+ /* Format is <arch> */
54+ ;
55+ } else {
56 *c++ = '\0';
57-
58- if ((co = strrchr(c, '-')) == NULL) {
59- co = c;
60+ cv = c;
61+
62+ if ((c = strchr(c, '-')) == NULL) {
63+ /* Format is <arch>-<os> */
64+ co = cv;
65+ cv = NULL;
66 } else {
67- if (!xstrcasecmp(co, "-gnu"))
68- *co = '\0';
69- if ((co = strrchr(c, '-')) == NULL)
70- co = c;
71- else
72- co++;
73+ *c++ = '\0';
74+ co = c;
75+
76+ if ((c = strchr(c, '-')) == NULL) {
77+ /* Might be:
78+ * <arch>-<vendor>-<os>
79+ * <arch>-<os>-gnu
80+ */
81+ if (!xstrcasecmp(co, "gnu")) {
82+ /* Format was <arch>-<os>-gnu */
83+ ce = co;
84+ co = cv;
85+ cv = NULL;
86+ }
87+ } else {
88+ /* Format was <arch>-<vendor>-<os>-<extension> */
89+ *c++ = '\0';
90+ ce = c;
91+ }
92 }
93+ if (cv != NULL) cv = xstrdup(cv);
94 if (co != NULL) co = xstrdup(co);
95+ if (ce != NULL) {
96+ /* We need to prefix it with a "-" */
97+ char * lce = NULL;
98+
99+ lce = xmalloc(strlen(ce) + sizeof("-"));
100+ sprintf(lce, "-%s", ce);
101+
102+ ce = lce;
103+ }
104 }
105 } else {
106 const char *a = NULL;
107@@ -995,8 +1032,16 @@ static void rpmRebuildTargetVars(const c
108 addMacro(NULL, "_target", NULL, ct, RMIL_RPMRC);
109 delMacro(NULL, "_target_cpu");
110 addMacro(NULL, "_target_cpu", NULL, ca, RMIL_RPMRC);
111+ if (cv) {
112+ delMacro(NULL, "_target_vendor");
113+ addMacro(NULL, "_target_vendor", NULL, cv, RMIL_RPMRC);
114+ }
115 delMacro(NULL, "_target_os");
116 addMacro(NULL, "_target_os", NULL, co, RMIL_RPMRC);
117+ if (ce) {
118+ delMacro(NULL, "_gnu");
119+ addMacro(NULL, "_gnu", NULL, ce, RMIL_RPMRC);
120+ }
121
122 if (canontarget)
123 *canontarget = ct;
124@@ -1004,8 +1049,12 @@ static void rpmRebuildTargetVars(const c
125 ct = _free(ct);
126 ca = _free(ca);
127 /*@-usereleased@*/
128+ cv = _free(cv);
129+ /*@-usereleased@*/
130 co = _free(co);
131 /*@=usereleased@*/
132+ ce = _free(ce);
133+ /*@-usereleased@*/
134 }
135
136 void rpmFreeRpmrc(void)
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch b/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch
new file mode 100644
index 0000000000..c869376538
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch
@@ -0,0 +1,19 @@
1Upstream-Status: Inappropriate [configuration]
2
3Change cache size to reduce the usage of disk space from 62MB to 26MB.
4
5Signed-off-by: Mei Lei <lei.mei@intel.com>
6
7Index: rpm-5.4.14/rpmdb/DB_CONFIG.in
8===================================================================
9--- rpm-5.4.14.orig/rpmdb/DB_CONFIG.in
10+++ rpm-5.4.14/rpmdb/DB_CONFIG.in
11@@ -29,7 +29,7 @@ set_thread_count 64
12
13 # ================ Memory Pool
14 #XXX initializing dbenv with set_cachesize has unimplemented prerequsites
15-#set_cachesize 0 1048576 0
16+set_cachesize 0 1048576 0
17 set_mp_mmapsize 268435456
18
19 # ================ Locking
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch b/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch
new file mode 100644
index 0000000000..edb6ea2f47
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch
@@ -0,0 +1,162 @@
1Support both db5 and db6.
2
3Upstream-status: Inappropriate [configuration]
4
5Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
6
7Index: rpm/configure.ac
8===================================================================
9--- rpm.orig/configure.ac
10+++ rpm/configure.ac
11@@ -547,8 +547,6 @@ else
12 MYPATH=$PATH
13 fi
14
15-DBXY=db60
16-
17 AC_PATH_PROG(__BASH, bash, %{_bindir}/bash, $MYPATH)
18 AC_PATH_PROG(__BZIP2, bzip2, %{_bindir}/bzip2, $MYPATH)
19 AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH)
20@@ -560,22 +558,6 @@ AC_PATH_PROG(__CMAKE, cmake, %{_bindir}/
21 AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH)
22 AC_PATH_PROG(__CURL, curl, %{_bindir}/curl, $MYPATH)
23 AC_PATH_PROG(__CVS, cvs, %{_bindir}/cvs, $MYPATH)
24-AC_PATH_PROG(__DB_ARCHIVE, ${DBXY}_archive, %{_bindir}/${DBXY}_archive, $MYPATH)
25-AC_PATH_PROG(__DB_CHECKPOINT, ${DBXY}_checkpoint, %{_bindir}/${DBXY}_checkpoint, $MYPATH)
26-AC_PATH_PROG(__DB_DEADLOCK, ${DBXY}_deadlock, %{_bindir}/${DBXY}_deadlock, $MYPATH)
27-AC_PATH_PROG(__DB_DUMP, ${DBXY}_dump, %{_bindir}/${DBXY}_dump, $MYPATH)
28-AC_PATH_PROG(__DB_HOTBACKUP, ${DBXY}_hotbackup, %{_bindir}/${DBXY}_hotbackup, $MYPATH)
29-AC_PATH_PROG(__DB_LOAD, ${DBXY}_load, %{_bindir}/${DBXY}_load, $MYPATH)
30-AC_PATH_PROG(__DB_LOG_VERIFY, ${DBXY}_log_verify, %{_bindir}/${DBXY}_log_verify, $MYPATH)
31-AC_PATH_PROG(__DB_PRINTLOG, ${DBXY}_printlog, %{_bindir}/${DBXY}_printlog, $MYPATH)
32-AC_PATH_PROG(__DB_RECOVER, ${DBXY}_recover, %{_bindir}/${DBXY}_recover, $MYPATH)
33-AC_PATH_PROG(__DB_REPLICATE, ${DBXY}_replicate, %{_bindir}/${DBXY}_replicate, $MYPATH)
34-AC_PATH_PROG(__DBSQL, ${DBXY}sql, %{_bindir}/${DBXY}sql, $MYPATH)
35-AC_PATH_PROG(__DB_SQL_CODEGEN, ${DBXY}_sql_codegen, %{_bindir}/${DBXY}_sql_codegen, $MYPATH)
36-AC_PATH_PROG(__DB_STAT, ${DBXY}_stat, %{_bindir}/${DBXY}_stat, $MYPATH)
37-AC_PATH_PROG(__DB_TUNER, ${DBXY}_tuner, %{_bindir}/${DBXY}_tuner, $MYPATH)
38-AC_PATH_PROG(__DB_UPGRADE, ${DBXY}_upgrade, %{_bindir}/${DBXY}_upgrade, $MYPATH)
39-AC_PATH_PROG(__DB_VERIFY, ${DBXY}_verify, %{_bindir}/${DBXY}_verify, $MYPATH)
40 AC_PATH_PROG(__DIFF, diff, /bin/diff, $MYPATH)
41 AC_PATH_PROG(__DITTO, ditto, %{_bindir}/ditto, $MYPATH)
42 AC_PATH_PROG(__FILE, file, %{_bindir}/file, $MYPATH)
43@@ -1604,13 +1586,18 @@ RPM_CHECK_LIB(
44
45 dnl # Berkeley-DB & SQLite
46 DBLIBSRCS=""
47+DBXY=db
48+
49 # XXX won't handle --includedir override
50-CPPFLAGS="${CPPFLAGS} -I${prefix}/include/${DBXY}"
51+CPPFLAGS_save="${CPPFLAGS}"
52+CPPFLAGS="${CPPFLAGS_save} -I${prefix}/include/db-6.0"
53+with_db_save="${with_db}"
54 RPM_CHECK_LIB(
55 [Berkeley-DB], [db],
56 [db-6.0], [db_create], [db.h],
57- [yes,external], [db3],
58+ [yes,external], [db6],
59 [ DBLIBSRCS="$DBLIBSRCS db3.c"
60+ DBXY=db60
61 AM_CONDITIONAL(WITH_DB, [ true ])
62 AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ])
63 if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
64@@ -1619,10 +1606,32 @@ RPM_CHECK_LIB(
65 WITH_DB_SUBDIR=""
66 fi
67 ],
68- [ AM_CONDITIONAL(WITH_DB, [ false ])
69- AM_CONDITIONAL(WITH_DB_INTERNAL, [ false ])
70+ [ # Reset a few variables to fresh
71+ with_db="${with_db_save}"
72+ CPPFLAGS="${CPPFLAGS_save} -I${prefix}/include/db-5.3"
73+ RPM_CHECK_LIB(
74+ [Berkeley-DB], [db],
75+ [db-5.3], [db_create], [db.h],
76+ [yes,external], [db53],
77+ [ DBLIBSRCS="$DBLIBSRCS db3.c"
78+ DBXY=db53
79+ AM_CONDITIONAL(WITH_DB, [ true ])
80+ AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ])
81+ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
82+ AC_DEFINE(HAVE_DB_H, 1, [Have <db.h> header])
83+ else
84+ WITH_DB_SUBDIR=""
85+ fi
86+ ],
87+ [ AM_CONDITIONAL(WITH_DB, [ false ])
88+ AM_CONDITIONAL(WITH_DB_INTERNAL, [ false ])
89+ ])
90 ])
91
92+if test ".$ac_cv_lib_db_6_0_db_create" != .yes -a ".$ac_cv_lib_db_5_3_db_create" != .yes; then
93+ CPPFLAGS="${CPPFLAGS_save}"
94+fi
95+
96 dnl # Sqlite external
97 RPM_CHECK_LIB(
98 [SQLite], [sqlite],
99@@ -1633,10 +1642,11 @@ RPM_CHECK_LIB(
100
101 dnl # Sqlite 3.7.0.1 from db-5.1.19
102 dnl XXX error: `db3' is already registered with AC_CONFIG_SUBDIRS.
103+if test ".$ac_cv_lib_db_6_0_db_create" = .yes; then
104 RPM_CHECK_LIB(
105 [Berkeley-DB (+SQLite3)], [dbsql],
106 [db_sql-6.0], [sqlite3_open], [dbsql.h],
107- [yes,external], [db3/sql],
108+ [yes,external], [db6/sql],
109 [
110 AM_CONDITIONAL(WITH_DBSQL, [ true ])
111 AC_DEFINE(WITH_SQLITE, 1, [Define as 1 if building with SQLite library])
112@@ -1650,12 +1660,50 @@ RPM_CHECK_LIB(
113 ], [
114 AM_CONDITIONAL(WITH_DBSQL, [ false ])
115 ])
116+elif test ".$ac_cv_lib_db_5_3_db_create" = .yes; then
117+RPM_CHECK_LIB(
118+ [Berkeley-DB (+SQLite3)], [dbsql],
119+ [db_sql-5.3], [sqlite3_open], [dbsql.h],
120+ [yes,external], [db53/sql],
121+ [
122+ AM_CONDITIONAL(WITH_DBSQL, [ true ])
123+ AC_DEFINE(WITH_SQLITE, 1, [Define as 1 if building with SQLite library])
124+ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
125+ WITH_DB_CPPFLAGS="${WITH_DB_CPPFLAGS} -I\$(top_srcdir)/db/sql/generated"
126+ WITH_DB_LIBS="${WITH_DBSQL_LIBS}"
127+ DBLIBSRCS="$DBLIBSRCS sqlite.c"
128+ else
129+ WITH_DBSQL_SUBDIR=""
130+ fi
131+ ], [
132+ AM_CONDITIONAL(WITH_DBSQL, [ false ])
133+ ])
134+else
135+AM_CONDITIONAL(WITH_DBSQL, [ false ])
136+fi
137
138 DBLIBOBJS=`echo $DBLIBSRCS | sed -e "s/\.c/\.lo/g"`
139
140 AC_SUBST(DBLIBSRCS)
141 AC_SUBST(DBLIBOBJS)
142
143+AC_PATH_PROG(__DB_ARCHIVE, ${DBXY}_archive, %{_bindir}/${DBXY}_archive, $MYPATH)
144+AC_PATH_PROG(__DB_CHECKPOINT, ${DBXY}_checkpoint, %{_bindir}/${DBXY}_checkpoint, $MYPATH)
145+AC_PATH_PROG(__DB_DEADLOCK, ${DBXY}_deadlock, %{_bindir}/${DBXY}_deadlock, $MYPATH)
146+AC_PATH_PROG(__DB_DUMP, ${DBXY}_dump, %{_bindir}/${DBXY}_dump, $MYPATH)
147+AC_PATH_PROG(__DB_HOTBACKUP, ${DBXY}_hotbackup, %{_bindir}/${DBXY}_hotbackup, $MYPATH)
148+AC_PATH_PROG(__DB_LOAD, ${DBXY}_load, %{_bindir}/${DBXY}_load, $MYPATH)
149+AC_PATH_PROG(__DB_LOG_VERIFY, ${DBXY}_log_verify, %{_bindir}/${DBXY}_log_verify, $MYPATH)
150+AC_PATH_PROG(__DB_PRINTLOG, ${DBXY}_printlog, %{_bindir}/${DBXY}_printlog, $MYPATH)
151+AC_PATH_PROG(__DB_RECOVER, ${DBXY}_recover, %{_bindir}/${DBXY}_recover, $MYPATH)
152+AC_PATH_PROG(__DB_REPLICATE, ${DBXY}_replicate, %{_bindir}/${DBXY}_replicate, $MYPATH)
153+AC_PATH_PROG(__DBSQL, ${DBXY}sql, %{_bindir}/${DBXY}sql, $MYPATH)
154+AC_PATH_PROG(__DB_SQL_CODEGEN, ${DBXY}_sql_codegen, %{_bindir}/${DBXY}_sql_codegen, $MYPATH)
155+AC_PATH_PROG(__DB_STAT, ${DBXY}_stat, %{_bindir}/${DBXY}_stat, $MYPATH)
156+AC_PATH_PROG(__DB_TUNER, ${DBXY}_tuner, %{_bindir}/${DBXY}_tuner, $MYPATH)
157+AC_PATH_PROG(__DB_UPGRADE, ${DBXY}_upgrade, %{_bindir}/${DBXY}_upgrade, $MYPATH)
158+AC_PATH_PROG(__DB_VERIFY, ${DBXY}_verify, %{_bindir}/${DBXY}_verify, $MYPATH)
159+
160 AC_ARG_WITH(db-largefile, AS_HELP_STRING([--with-db-largefile], [build Berkeley-DB with LARGEFILE support]))
161 AC_ARG_WITH(db-mutex, AS_HELP_STRING([--with-db-mutex=ARG], [build Berkeley-DB with MUTEX type ARG]))
162
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch b/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch
new file mode 100644
index 0000000000..16b8e30a1d
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch
@@ -0,0 +1,77 @@
1In certain cases with BerkleyDB 5.3.x we are getting the error:
2
3db3.c:1443: dbcursor->pget(-30999): BDB0063 DB_BUFFER_SMALL: User memory too small for return value
4
5See https://bugs.launchpad.net/rpm/+bug/934420 for more information.
6
7It appears to be some type of a bug in the BerkleyDB 5.3.x. In an attempt
8to workaround the problem, when we encounter this situation we attempt
9to adjust the size of the mmap buffer until the call works, or we
10end up trying 10 times. The new size is either the updated vp->size
11from the failed pget call, or the previous size + 1024.
12
13If DBI debugging is enabled, additional diagnostics are printed, otherwise
14a basic retry and success message is added to show that the failure was
15resolved.
16
17Upstream-Status: Inappropriate (workaround)
18
19Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
20
21Index: rpm-5.4.14/rpmdb/rpmdb.c
22===================================================================
23--- rpm-5.4.14.orig/rpmdb/rpmdb.c
24+++ rpm-5.4.14/rpmdb/rpmdb.c
25@@ -2212,8 +2212,12 @@ static int rpmmiGet(dbiIndex dbi, DBC *
26 vp->flags |= DB_DBT_USERMEM;
27 rc = dbiGet(dbi, dbcursor, kp, vp, flags);
28 if (rc == DB_BUFFER_SMALL) {
29+ int retry = 0;
30+ size_t origlen = vp->size;
31 size_t uhlen = vp->size;
32- void * uh = mmap(NULL, uhlen, _prot, _flags, _fdno, _off);
33+ void * uh;
34+retry_get:
35+ uh = mmap(NULL, uhlen, _prot, _flags, _fdno, _off);
36 if (uh == NULL || uh == (void *)-1)
37 fprintf(stderr,
38 "==> mmap(%p[%u], 0x%x, 0x%x, %d, 0x%x) error(%d): %s\n",
39@@ -2235,6 +2239,25 @@ static int rpmmiGet(dbiIndex dbi, DBC *
40 if (munmap(uh, uhlen) != 0)
41 fprintf(stderr, "==> munmap(%p[%u]) error(%d): %s\n",
42 uh, (unsigned)uhlen, errno, strerror(errno));
43+ /* We want to be sure to limit the number of retry attempts to avoid a loop! */
44+ if (rc == DB_BUFFER_SMALL && retry < 10) {
45+ /* If we got a largr vp-size back, use that, otherwise increment the size by 1k */
46+ uhlen = vp->size > uhlen ? vp->size : uhlen + 1024;
47+ retry++;
48+ if ((dbi)->dbi_debug)
49+ fprintf(stderr, "==> DB_BUFFER_SMALL orig requested (%d), configured (%d), forcing larger buffer (%d), new size (%d)\n",
50+ origlen, vp->ulen, uhlen, vp->size);
51+ else
52+ fprintf(stderr, "==> retry (%d) db3cpget (%d)\n", retry, uhlen);
53+ goto retry_get;
54+ }
55+ }
56+ if (retry) {
57+ if ((dbi)->dbi_debug)
58+ fprintf(stderr, "==> success orig requested (%d), configured buffer (%d), buffer (%d), size after dbiGet (%d)\n",
59+ origlen, vp->ulen, uhlen, vp->size);
60+ else
61+ fprintf(stderr, "==> success\n");
62 }
63 }
64 } else
65Index: rpm-5.4.14/rpmdb/db3.c
66===================================================================
67--- rpm-5.4.14.orig/rpmdb/db3.c
68+++ rpm-5.4.14/rpmdb/db3.c
69@@ -1509,7 +1509,7 @@ assert(db != NULL);
70 #endif
71 }
72
73-DBIDEBUG(dbi, (stderr, "<-- %s(%p,%p,%p,%p,%p,0x%x) rc %d %s%s\n", __FUNCTION__, dbi, dbcursor, key, pkey, data, flags, rc, _DBCFLAGS(flags), _KEYDATA(key, pkey, data, NULL)));
74+DBIDEBUG(dbi, (stderr, "<-- %s(%p,%p,%p,%p,%p,0x%x) rc %d %s%s\n", __FUNCTION__, dbi, dbcursor, key, pkey, data, flags, rc, _DBCFLAGS(flags), _KEYDATA(key, pkey, rc == DB_BUFFER_SMALL ? NULL : data, NULL)));
75 return rc;
76 }
77 /*@=mustmod@*/
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch b/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
new file mode 100644
index 0000000000..2eb6e0f26b
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
@@ -0,0 +1,65 @@
1Debug the platform score generation...
2
3Index: rpm-5.4.14/lib/rpmrc.c
4===================================================================
5--- rpm-5.4.14.orig/lib/rpmrc.c
6+++ rpm-5.4.14/lib/rpmrc.c
7@@ -465,6 +465,8 @@ static rpmRC rpmPlatform(const char * pl
8
9 rc = (rpmRC) rpmiobSlurp(platform, &iob);
10
11+ fprintf(stderr, "D: rpmPlatform file %s\n", platform);
12+
13 if (rc || iob == NULL) {
14 rc = RPMRC_FAIL;
15 goto exit;
16@@ -486,6 +488,7 @@ static rpmRC rpmPlatform(const char * pl
17 while (--t > p && xisspace(*t))
18 *t = '\0';
19 if (t > p) {
20+ fprintf(stderr, "D: rpmPlatform mireAppend REGEX %s\n", p);
21 xx = mireAppend(RPMMIRE_REGEX, 0, p, NULL, &mi_re, &mi_nre);
22 }
23 continue;
24@@ -503,6 +506,11 @@ static rpmRC rpmPlatform(const char * pl
25 _gnu = rpmExpand("-", cvog->gnu, NULL);
26
27 addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
28+ fprintf(stderr, "D: rpmPlatform addMacro %s-%s-%s(%s)\n",
29+ rpmExpand("%{_platform_cpu}", NULL),
30+ rpmExpand("%{_platform_vendor}", NULL),
31+ rpmExpand("%{_platform_os}", NULL),
32+ rpmExpand("%{_platform_gnu}", NULL));
33 #else
34 addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
35 addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
36@@ -510,6 +518,7 @@ static rpmRC rpmPlatform(const char * pl
37 #endif
38 }
39
40+ fprintf(stderr, "D: rpmPlatform mireAppend STRCMP %s -- ", p);
41 #if !defined(RPM_VENDOR_OE) /* Skip the explicit-platform */
42 #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
43 /* do not use vendor and GNU attribution */
44@@ -519,6 +528,7 @@ static rpmRC rpmPlatform(const char * pl
45 (cvog && *cvog->gnu ? "-" : NULL),
46 (cvog ? cvog->gnu : NULL), NULL);
47 #endif
48+ fprintf(stderr, "%s\n", p);
49 xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre);
50 p = _free(p);
51 #endif
52@@ -688,9 +698,12 @@ int rpmPlatformScore(const char * platfo
53
54 if ((mire = (miRE) mi_re) != NULL)
55 for (i = 0; i < mi_nre; i++) {
56- if (mireRegexec(mire + i, platform, 0) >= 0)
57+ if (mireRegexec(mire + i, platform, 0) >= 0) {
58+ fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, i + 1);
59 return (i + 1);
60+ }
61 }
62+ fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, 0);
63 return 0;
64 }
65 /*@=onlytrans@*/
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-disable-Wno-override-init.patch b/meta/recipes-devtools/rpm/rpm/rpm-disable-Wno-override-init.patch
new file mode 100644
index 0000000000..8b5f8d66c8
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-disable-Wno-override-init.patch
@@ -0,0 +1,32 @@
1From 70d881873b443c9bad502db9665595455d4f0ac9 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Tue, 8 Jul 2014 07:41:10 +0800
4Subject: [PATCH] configure.ac: disable -Wno-override-init
5
6Fixed rpm-native.do_configure error on CentOS 5.x:
7
8cc1: error: unrecognized command line option "-Wno-override-init"
9
10Upstream-Status: Pending
11
12Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
13---
14 configure.ac | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/configure.ac b/configure.ac
18index adeffe0..6746b4c 100644
19--- a/configure.ac
20+++ b/configure.ac
21@@ -163,7 +163,7 @@ AC_ARG_ENABLE(build-warnings,
22 # XXX gcc-4.2 on Mac OS X hasn't
23 # CFLAGS="$CFLAGS -Wno-unused-but-set-variable"
24 # XXX rpmio/set.c needs this
25- CFLAGS="$CFLAGS -Wno-override-init"
26+# CFLAGS="$CFLAGS -Wno-override-init"
27 elif test ".`$CC -V 2>&1 | grep 'Sun C'`" != .; then
28 dnl # Sun Studio (usually "cc")
29 CFLAGS="$CFLAGS -v"
30--
311.8.2.1
32
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch b/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch
new file mode 100644
index 0000000000..b1db6fff72
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch
@@ -0,0 +1,36 @@
1rpmfc.c: Always generate per-file information
2
3Even when the per-file dependency generate is disabled, we want to generate
4per file classification and other associated data.
5
6Note: this is a temporary workaround. Eventually we will want to have a way
7to seed per-file dependency and other information in order to generate a
8package from previously determined information.
9
10Upstream-Status: Pending
11
12Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
13
14Index: rpm-5.4.14/lib/rpmfc.c
15===================================================================
16--- rpm-5.4.14.orig/lib/rpmfc.c
17+++ rpm-5.4.14/lib/rpmfc.c
18@@ -1734,7 +1734,6 @@ rpmRC rpmfcGenerateDepends(void * _spec,
19 /* ... then generate dependencies using %{__find_requires} et al. */
20 rc = rpmfcGenerateDependsHelper(spec, pkg, fi);
21 printDeps(pkg->header);
22- return rc;
23 }
24
25 /* Generate scriptlet Dependencies. */
26@@ -1762,8 +1761,8 @@ rpmRC rpmfcGenerateDepends(void * _spec,
27 av[ac] = NULL;
28
29 fc = rpmfcNew();
30- fc->skipProv = !pkg->autoProv;
31- fc->skipReq = !pkg->autoReq;
32+ fc->skipProv = !pkg->autoProv || !internaldeps;
33+ fc->skipReq = !pkg->autoReq || !internaldeps;
34 fc->tracked = 0;
35
36 { const char * buildRootURL;
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch b/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch
new file mode 100644
index 0000000000..fa1ff43d6c
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch
@@ -0,0 +1,30 @@
1Occasionally the cp -p fails with a non-zero return code. This will cause
2the system abort the build.
3
4Upstream-status: Pending
5
6Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
7
8Index: rpm/rpmdb/Makefile.am
9===================================================================
10--- rpm.orig/rpmdb/Makefile.am
11+++ rpm/rpmdb/Makefile.am
12@@ -234,11 +234,14 @@ lcov-report:
13 #lcov-upload: lcov
14 # rsync -rvz -e ssh --delete lcov/* ???
15
16+$(builddir)/logio_recover_template: $(srcdir)/logio_recover_template
17+ @if test ".$(builddir)" != ".$(srcdir)"; then \
18+ cp -fp $(srcdir)/logio_recover_template \
19+ $(builddir)/logio_recover_template ; \
20+ fi
21+
22 logio_BUILT = logio_auto.c logio_autop.c logio_auto.h logio_template
23-$(logio_BUILT): logio.awk logio.src logio_recover_template
24- @test -e $(builddir)/logio_recover_template || \
25- cp -p $(srcdir)/logio_recover_template \
26- $(builddir)/logio_recover_template
27+$(logio_BUILT): logio.awk logio.src $(builddir)/logio_recover_template
28 @rm -f $(logio_BUILT)
29 @$(AWK) -f $(srcdir)/logio.awk \
30 -v header_file=logio_auto.h \
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch
new file mode 100644
index 0000000000..5deb2323ef
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch
@@ -0,0 +1,43 @@
1We need to sanity check that the nlink size and our linksLeft counter
2do match. If an rpm is badly constructed with identical inode values
3for multiple hardlinked files, such an rpm will otherwise access memory
4out of array bounds and cause memory corruption and crashes.
5
6The fix is to add in the sanity check and exit if bad circumstances
7are found. We need to fix the caller to check the return code too.
8
9RP 2014/6/10
10
11Upstream-Status: Pending
12
13Index: rpm-5.4.14/lib/fsm.c
14===================================================================
15--- rpm-5.4.14.orig/lib/fsm.c
16+++ rpm-5.4.14/lib/fsm.c
17@@ -495,6 +495,11 @@ static int saveHardLink(/*@special@*/ /*
18 }
19
20 if (fsm->goal == IOSM_PKGBUILD) --fsm->li->linksLeft;
21+ if (fsm->li->linksLeft > st->st_nlink) {
22+ rpmlog(RPMLOG_ERR, _("Corrupted hardlinks found (count %d does not match %d), exiting.\n"), fsm->li->linksLeft, st->st_nlink);
23+ return -1;
24+ }
25+
26 fsm->li->filex[fsm->li->linksLeft] = fsm->ix;
27 /*@-observertrans -dependenttrans@*/
28 fsm->li->nsuffix[fsm->li->linksLeft] = fsm->nsuffix;
29@@ -1878,8 +1883,13 @@ if (!(fsmGetFi(fsm)->mapflags & IOSM_PAY
30 fsm->postpone = iosmFileActionSkipped(fsm->action);
31 if (fsm->goal == IOSM_PKGINSTALL || fsm->goal == IOSM_PKGBUILD) {
32 /*@-evalorder@*/ /* FIX: saveHardLink can modify fsm */
33- if (S_ISREG(st->st_mode) && st->st_nlink > 1)
34+ if (S_ISREG(st->st_mode) && st->st_nlink > 1) {
35 fsm->postpone = saveHardLink(fsm);
36+ if (fsm->postpone < 0) {
37+ rc = RPMRC_FAIL;
38+ break;
39+ }
40+ }
41 /*@=evalorder@*/
42 }
43 if (fsmGetFi(fsm)->mapflags & IOSM_PAYLOAD_LIST) fsm->postpone = 1;
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch
new file mode 100644
index 0000000000..042e412ede
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch
@@ -0,0 +1,22 @@
1During installation, the libtool relink attempts to link to -lrpm...
2The problem is that it hasn't been installed yet! So small change causes
3the libtool to instead use the build version.
4
5Upstream-Status: Pending
6
7Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
8
9Index: rpm-5.4.14/lib/Makefile.am
10===================================================================
11--- rpm-5.4.14.orig/lib/Makefile.am
12+++ rpm-5.4.14/lib/Makefile.am
13@@ -120,6 +120,9 @@ librpm.la: $(librpm_la_OBJECTS) $(librpm
14 #libsql_la_SOURCES = libsql.c
15 #libsql_la_LIBADD = librpm.la $(RPMDB_LDADD_COMMON)
16
17+# pkglib libraries needs to have usrlib libraries already installed!
18+install-pkglibLTLIBRARIES: install-usrlibLTLIBRARIES
19+
20 install-data-hook:
21 if !ENABLE_BUILD_LAFILES
22 -for l in $(usrlib_LTLIBRARIES); do \
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch b/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch
new file mode 100644
index 0000000000..3153f7a386
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch
@@ -0,0 +1,15 @@
1
2Upstream-Status: Inappropriate [configuration]
3
4Index: rpm-5.4.14/rpmdb/DB_CONFIG.in
5===================================================================
6--- rpm-5.4.14.orig/rpmdb/DB_CONFIG.in
7+++ rpm-5.4.14/rpmdb/DB_CONFIG.in
8@@ -4,6 +4,7 @@ set_data_dir .
9 set_create_dir .
10 set_lg_dir ./log
11 set_tmp_dir ./tmp
12+set_flags db_log_autoremove on
13
14 # -- thread_count must be >= 8
15 set_thread_count 64
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch b/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch
new file mode 100644
index 0000000000..790a662170
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch
@@ -0,0 +1,24 @@
1Enable platform tag matching workaround in OE.
2
3When installing some LSB packages the 'platform' field in the package
4appears to be invalid. Instead of relying solely on the platform comparison
5we also want to generate a perceived platform based on the valid rpm contents
6of arch and os.
7
8Upstream-Status: Pending
9
10Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
11
12Index: rpm-5.4.14/lib/depends.c
13===================================================================
14--- rpm-5.4.14.orig/lib/depends.c
15+++ rpm-5.4.14/lib/depends.c
16@@ -595,7 +595,7 @@ int rpmtsAddInstallElement(rpmts ts, Hea
17 platform = rpmExpand(arch, "-unknown-", os, NULL);
18
19 rc = rpmPlatformScore(platform, platpat, nplatpat);
20-#if defined(RPM_VENDOR_MANDRIVA)
21+#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE)
22 /*
23 * If no match on platform tag, we'll try again with arch tag
24 * in case platform tag is inconsistent with it, which is the case
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-lua.patch b/meta/recipes-devtools/rpm/rpm/rpm-lua.patch
new file mode 100644
index 0000000000..a9930d6705
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-lua.patch
@@ -0,0 +1,33 @@
1Add support for cross compiling lua
2
3Upstream-Status: Pending
4
5Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
6
7Index: rpm-5.4.14/configure.ac
8===================================================================
9--- rpm-5.4.14.orig/configure.ac
10+++ rpm-5.4.14/configure.ac
11@@ -121,6 +121,9 @@ AC_PROG_YACC
12
13 AC_PATH_PROG(AS, as, as)
14
15+CC_FOR_BUILD=${CC_FOR_BUILD-\$(CC)}
16+AC_SUBST(CC_FOR_BUILD)
17+
18 dnl # GCC specifics
19 AC_PROG_GCC_TRADITIONAL
20 AC_ARG_ENABLE(build-pic,
21Index: rpm-5.4.14/lua/Makefile.am
22===================================================================
23--- rpm-5.4.14.orig/lua/Makefile.am
24+++ rpm-5.4.14/lua/Makefile.am
25@@ -41,7 +41,7 @@ rpmluac_LDADD = liblua.la
26
27 # --- bin2c doesn't need anything but a compiler
28 bin2c$(EXEEXT): bin2c.c
29- $(CC) -o $@ $<
30+ $(CC_FOR_BUILD) -o $@ $<
31
32 liblua_la_SOURCES =
33 liblua_la_CFLAGS = @WITH_LUA_SUBDIR_DEF@
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-macros.patch b/meta/recipes-devtools/rpm/rpm/rpm-macros.patch
new file mode 100644
index 0000000000..c7ab2d2bb7
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-macros.patch
@@ -0,0 +1,64 @@
1macros/macros.in: Revert settings to the same as RPM 5.4.0
2
3Enable a reasonable set of rpmdeps dependency helper macros. These sets
4were used by RPM 5.4.0.
5
6Upstream-Status: Inappropriate [configuration]
7
8Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
9
10Index: rpm-5.4.14/macros/macros.in
11===================================================================
12--- rpm-5.4.14.orig/macros/macros.in
13+++ rpm-5.4.14/macros/macros.in
14@@ -1022,7 +1022,7 @@ $_arbitrary_tags_tests Foo:Bar
15
16 #==============================================================================
17 # ---- rpmbuild macros.
18-#%%{load:%{_usrlibrpm}/macros.rpmbuild}
19+%{load:%{_usrlibrpm}/macros.rpmbuild}
20
21 #------------------------------------------------------------------------
22 # cmake(...) configuration
23@@ -1038,15 +1038,15 @@ $_arbitrary_tags_tests Foo:Bar
24
25 #------------------------------------------------------------------------
26 # perl(...) configuration
27-#%%{load:%{_usrlibrpm}/macros.d/perl}
28+%{load:%{_usrlibrpm}/macros.d/perl}
29
30 #------------------------------------------------------------------------
31 # python(...) configuration.
32-#%%{load:%{_usrlibrpm}/macros.d/python}
33+%{load:%{_usrlibrpm}/macros.d/python}
34
35 #------------------------------------------------------------------------
36 # php(...) configuration.
37-#%%{load:%{_usrlibrpm}/macros.d/php}
38+%{load:%{_usrlibrpm}/macros.d/php}
39
40 #------------------------------------------------------------------------
41 # java(...) configuration.
42@@ -1054,11 +1054,11 @@ $_arbitrary_tags_tests Foo:Bar
43
44 #------------------------------------------------------------------------
45 # libtool(...) configuration.
46-#%%{load:%{_usrlibrpm}/macros.d/libtool}
47+%{load:%{_usrlibrpm}/macros.d/libtool}
48
49 #------------------------------------------------------------------------
50 # pkgconfig(...) configuration.
51-#%%{load:%{_usrlibrpm}/macros.d/pkgconfig}
52+%{load:%{_usrlibrpm}/macros.d/pkgconfig}
53
54 #------------------------------------------------------------------------
55 # mono(...) configuration.
56@@ -1070,7 +1070,7 @@ $_arbitrary_tags_tests Foo:Bar
57
58 #------------------------------------------------------------------------
59 # tcl(...) configuration.
60-#%%{load:%{_usrlibrpm}/macros.d/tcl}
61+%{load:%{_usrlibrpm}/macros.d/tcl}
62
63 #------------------------------------------------------------------------
64 # typelib(...) configuration.
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch b/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch
new file mode 100644
index 0000000000..ab6ed2c3a4
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch
@@ -0,0 +1,19 @@
1lib/order.c: Make the dependency loop messages into debug msgs
2
3Upstream-Status: Pending
4
5Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
6
7Index: rpm-5.4.14/lib/order.c
8===================================================================
9--- rpm-5.4.14.orig/lib/order.c
10+++ rpm-5.4.14/lib/order.c
11@@ -2175,7 +2175,7 @@ rescan:
12 const char * dp;
13 rpmlogLvl msglvl = (anaconda || (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS))
14 ? RPMLOG_WARNING : RPMLOG_ERR;
15-#if defined(RPM_VENDOR_MANDRIVA) /* loop-detection-optional-loglevel */
16+#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE) /* loop-detection-optional-loglevel */
17 // Report loops as debug-level message by default (7 = RPMLOG_DEBUG), overridable
18 msglvl = rpmExpandNumeric("%{?_loop_detection_loglevel}%{?!_loop_detection_loglevel:7}");
19 #endif
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch b/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch
new file mode 100644
index 0000000000..58182296cf
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch
@@ -0,0 +1,47 @@
1Disable perl-URPM support
2
3This causes a configure failure when perl-URPM is not used.
4
5| configure.ac:1159: required file `perl-URPM/Makefile.PL.in' not found
6| configure.ac:1159: required file `perl-URPM/Makefile.in' not found
7
8Upstream-Status: Inappropriate [disable feature]
9
10Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
11
12Index: rpm-5.4.14/configure.ac
13===================================================================
14--- rpm-5.4.14.orig/configure.ac
15+++ rpm-5.4.14/configure.ac
16@@ -1186,30 +1186,10 @@ AC_SUBST(WITH_PERL_SUBDIR)
17 AC_SUBST(WITH_PERL_SUBPACKAGE)
18 AC_SUBST(WITH_PERL_LIBS)
19
20-dnl # optional Perl-URPM language bindings
21+dnl # disable Perl-URPM language bindings
22 WITH_PERL_URPM_SUBDIR=""
23 WITH_PERL_URPM_SUBPACKAGE=0
24 WITH_PERL_URPM_LIBS=""
25-if test ".$WITH_PTHREADS" = .yes; then
26- WITH_PERL_URPM_LIBS="$LIBS"
27-fi
28-AC_ARG_WITH(perl-urpm, AS_HELP_STRING([--with-perl-urpm], [build with Perl URPM language bindings]), [
29- if test ".$withval" != .no; then
30- PERL_URPM_INSTALLDIRS=""
31- if test "$withval" == "vendor"; then
32- PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'vendor',"
33- fi
34- if test "$withval" == "site"; then
35- PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'site',"
36- fi
37- AC_DEFINE_UNQUOTED([PERL_URPM_INSTALLDIRS], [$PERL_URPM_INSTALLDIRS], [Perl install directory (vendor/site)])
38- AC_SUBST(PERL_URPM_INSTALLDIRS)
39- WITH_PERL_URPM_SUBDIR=perl-URPM
40- WITH_PERL_URPM_SUBPACKAGE=1
41- AC_CONFIG_FILES([perl-URPM/Makefile.PL])
42- AC_CONFIG_FILES([perl-URPM/Makefile])
43- fi
44-])
45 AC_SUBST(WITH_PERL_URPM_SUBDIR)
46 AC_SUBST(WITH_PERL_URPM_SUBPACKAGE)
47 AC_SUBST(WITH_PERL_URPM_LIBS)
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch b/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch
new file mode 100644
index 0000000000..691aba9ea3
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch
@@ -0,0 +1,23 @@
1Fix integration of ossp-uuid
2
3We need to avoid including the util-linux uuid library, instead
4we need ossp-uuid. There is a related hack in do_configure to
5make sure that we use the right .pc file as well.
6
7Upstream-Status: Inappropriate [disable feature]
8
9Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
10
11Index: rpm-5.4.14/configure.ac
12===================================================================
13--- rpm-5.4.14.orig/configure.ac
14+++ rpm-5.4.14/configure.ac
15@@ -1951,7 +1951,7 @@ grep -v 'define HAVE_UNISTD_H' confdefs.
16 esac
17 RPM_CHECK_LIB(
18 [OSSP uuid], [uuid],
19- [ossp-uuid uuid], [uuid_import], [uuid.h],
20+ [ossp-uuid], [uuid_import], [uuid.h],
21 [no,external:none], [],
22 [ dnl # enable OSSP uuid native API support for embedded Lua
23 if test ".$WITH_LUA" = .yes; then
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch b/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
new file mode 100644
index 0000000000..c15e12405d
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
@@ -0,0 +1,25 @@
1Add the ability to query the packageorigin
2
3Written by jbj at rpm5.org
4
5Upstream-Status: Inappropriate [not author]
6
7Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
8
9Index: rpm-5.4.14/rpmdb/hdrfmt.c
10===================================================================
11--- rpm-5.4.14.orig/rpmdb/hdrfmt.c
12+++ rpm-5.4.14/rpmdb/hdrfmt.c
13@@ -2409,8 +2409,10 @@ static int pkgoriginTag(Header h, HE_t h
14 int rc = 1;
15
16 he->tag = RPMTAG_PACKAGEORIGIN;
17- if (!headerGet(h, he, HEADERGET_NOEXTENSION)
18- && (origin = headerGetOrigin(h)) != NULL)
19+ /* XXX two sources for tag data: what search precedence? */
20+ if (headerGet(h, he, HEADERGET_NOEXTENSION))
21+ rc = 0;
22+ else if ((origin = headerGetOrigin(h)) != NULL)
23 {
24 he->t = RPM_STRING_TYPE;
25 he->p.str = xstrdup(origin);
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch b/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch
new file mode 100644
index 0000000000..9cd02a0f92
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch
@@ -0,0 +1,146 @@
1If we run builds on a filesystem with 64 bit inodes like XFS, we need to
2map the inode numbers to something 32 bit since the cpio header only allows
3for 32 bit inode values. If we don't do this:
4
5#define SET_NUM_FIELD(phys, val, space) \
6 sprintf(space, "%8.8lx", (unsigned long) (val)); \
7 memcpy(phys, space, 8)
8
9from cpio.c will print larger that 8 character values and then truncate the
10LSBs. This generates cpio files where hardlinked files may have the same
11inode number. The resulting rpms are then corrupted.
12
13There is a separate patch for the crash the identical inode numbers causes
14when extracting the rpm.
15
16Patch taken from http://git.pld-linux.org/?p=packages/rpm.git;a=commitdiff;h=10526c23aac60b7b636e4c93862887dbef8e8f15
17
18RP 2014/6/10
19
20Upstream-Status: Pending
21
22Index: rpm-5.4.14/build/files.c
23===================================================================
24--- rpm-5.4.14.orig/build/files.c
25+++ rpm-5.4.14/build/files.c
26@@ -1328,6 +1328,26 @@ static rpmuint32_t getDigestAlgo(Header
27 return dalgo;
28 }
29
30+static int isHardLink(FileListRec flp, FileListRec tlp)
31+{
32+ return ((S_ISREG(flp->fl_mode) && S_ISREG(tlp->fl_mode)) &&
33+ ((flp->fl_nlink > 1) && (flp->fl_nlink == tlp->fl_nlink)) &&
34+ (flp->fl_ino == tlp->fl_ino) &&
35+ (flp->fl_dev == tlp->fl_dev));
36+}
37+
38+static int seenHardLink(FileList fl, FileListRec flp, ino_t *fileid)
39+{
40+ FileListRec ilp;
41+ for (ilp = fl->fileList; ilp < flp; ilp++) {
42+ if (isHardLink(flp, ilp)) {
43+ *fileid = ilp - fl->fileList;
44+ return 1;
45+ }
46+ }
47+ return 0;
48+}
49+
50 /**
51 * Add file entries to header.
52 * @todo Should directories have %doc/%config attributes? (#14531)
53@@ -1374,6 +1394,7 @@ memset(buf, 0, sizeof(buf)); /* XXX valg
54
55 for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) {
56 const char *s;
57+ ino_t fileid = flp - fl->fileList;
58
59 /* Merge duplicate entries. */
60 while (i < (fl->fileListRecsUsed - 1) &&
61@@ -1436,6 +1457,13 @@ memset(buf, 0, sizeof(buf)); /* XXX valg
62 /* Leave room for both dirname and basename NUL's */
63 dpathlen += (strlen(flp->diskURL) + 2);
64
65+ /* Excludes and dupes have been filtered out by now. */
66+ if (S_ISREG(flp->fl_mode)) {
67+ if (flp->fl_nlink == 1 || !seenHardLink(fl, flp, &fileid)) {
68+ fl->totalFileSize += flp->fl_size;
69+ }
70+ }
71+
72 /*
73 * Make the header, the OLDFILENAMES will get converted to a
74 * compressed file list write before we write the actual package to
75@@ -1518,7 +1546,11 @@ memset(buf, 0, sizeof(buf)); /* XXX valg
76
77 /* XXX Hash instead of 64b->32b truncate to prevent aliasing. */
78 { ino_t _ino = flp->fl_ino;
79+ /* don't use hash here, as hash collisions which happen on large packages
80+ cause bus errors in rpmbuild
81 ui32 = hashFunctionString(0, &_ino, sizeof(_ino));
82+ */
83+ ui32 = fileid + 1;
84 }
85 he->tag = RPMTAG_FILEINODES;
86 he->t = RPM_UINT32_TYPE;
87@@ -1751,39 +1783,6 @@ if (_rpmbuildFlags & 4) {
88 IOSM_MAP_TYPE | IOSM_MAP_MODE | IOSM_MAP_UID | IOSM_MAP_GID;
89 if (isSrc)
90 fi->fmapflags[i] |= IOSM_FOLLOW_SYMLINKS;
91-
92- if (S_ISREG(flp->fl_mode)) {
93- int bingo = 1;
94- /* Hard links need be tallied only once. */
95- if (flp->fl_nlink > 1) {
96- FileListRec jlp = flp + 1;
97- int j = i + 1;
98- for (; (unsigned)j < fi->fc; j++, jlp++) {
99- /* follow outer loop logic */
100- while (((jlp - fl->fileList) < (fl->fileListRecsUsed - 1)) &&
101- !strcmp(jlp->fileURL, jlp[1].fileURL))
102- jlp++;
103- if (jlp->flags & RPMFILE_EXCLUDE) {
104- j--;
105- /*@innercontinue@*/ continue;
106- }
107- if (jlp->flags & RPMFILE_GHOST)
108- /*@innercontinue@*/ continue;
109- if (!S_ISREG(jlp->fl_mode))
110- /*@innercontinue@*/ continue;
111- if (flp->fl_nlink != jlp->fl_nlink)
112- /*@innercontinue@*/ continue;
113- if (flp->fl_ino != jlp->fl_ino)
114- /*@innercontinue@*/ continue;
115- if (flp->fl_dev != jlp->fl_dev)
116- /*@innercontinue@*/ continue;
117- bingo = 0; /* don't tally hardlink yet. */
118- /*@innerbreak@*/ break;
119- }
120- }
121- if (bingo)
122- fl->totalFileSize += flp->fl_size;
123- }
124 }
125
126 ui32 = fl->totalFileSize;
127Index: rpm-5.4.14/lib/fsm.c
128===================================================================
129--- rpm-5.4.14.orig/lib/fsm.c
130+++ rpm-5.4.14/lib/fsm.c
131@@ -904,6 +904,7 @@ int fsmMapAttrs(IOSM_t fsm)
132
133 if (fi && i >= 0 && i < (int) fi->fc) {
134 mode_t perms = (S_ISDIR(st->st_mode) ? fi->dperms : fi->fperms);
135+ ino_t finalInode = (fi->finodes ? (ino_t)fi->finodes[i] : 0);
136 mode_t finalMode = (fi->fmodes ? (mode_t)fi->fmodes[i] : perms);
137 dev_t finalRdev = (dev_t)(fi->frdevs ? fi->frdevs[i] : 0);
138 rpmuint32_t finalMtime = (fi->fmtimes ? fi->fmtimes[i] : 0);
139@@ -943,6 +944,7 @@ int fsmMapAttrs(IOSM_t fsm)
140 if ((S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode))
141 && st->st_nlink == 0)
142 st->st_nlink = 1;
143+ st->st_ino = finalInode;
144 st->st_rdev = finalRdev;
145 st->st_mtime = finalMtime;
146 }
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch b/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch
new file mode 100644
index 0000000000..5d182ad9fe
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch
@@ -0,0 +1,37 @@
1pkgconfigdeps.sh: Change to restricting pkgconfig to the local directory
2
3Using PKG_CONFIG_PATH will allow pkg-config to fall back to the system paths,
4we don't want this as it may lead to inaccurate results in some corner cases.
5
6PKG_CONFIG_LIBDIR will ensure pkg-config stays within the install directory.
7
8Upstream-Status: Inappropriate [configuration]
9
10Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
11
12Index: rpm-5.4.14/scripts/pkgconfigdeps.sh
13===================================================================
14--- rpm-5.4.14.orig/scripts/pkgconfigdeps.sh
15+++ rpm-5.4.14/scripts/pkgconfigdeps.sh
16@@ -18,8 +18,8 @@ case $1 in
17 *.pc)
18 # Query the dependencies of the package.
19 DIR=`dirname ${filename}`
20- PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
21- export PKG_CONFIG_PATH
22+ PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig"
23+ export PKG_CONFIG_LIBDIR
24 $pkgconfig --print-provides "$filename" 2> /dev/null | while read n r v ; do
25 [ -n "$n" ] || continue
26 # We have a dependency. Make a note that we need the pkgconfig
27@@ -42,8 +42,8 @@ case $1 in
28 [ -n "$oneshot" ] && echo "$oneshot"; oneshot=""
29 # Query the dependencies of the package.
30 DIR=`dirname ${filename}`
31- PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
32- export PKG_CONFIG_PATH
33+ PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig"
34+ export PKG_CONFIG_LIBDIR
35 $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do
36 [ -n "$n" ] || continue
37 if [ -n "$r" ] && [ -n "$v" ]; then
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch
new file mode 100644
index 0000000000..f26a6e79da
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch
@@ -0,0 +1,28 @@
1Don't add the first line of /etc/rpm/platform to the list of patterns
2to match when computing an arch score, use it just for getting
3information about the platform (cpu/vendor/os). Fixes #3864.
4
5Upstream-Status: Inappropriate [embedded specific]
6
7Index: rpm-5.4.14/lib/rpmrc.c
8===================================================================
9--- rpm-5.4.14.orig/lib/rpmrc.c
10+++ rpm-5.4.14/lib/rpmrc.c
11@@ -510,6 +510,7 @@ static rpmRC rpmPlatform(const char * pl
12 #endif
13 }
14
15+#if !defined(RPM_VENDOR_OE) /* Skip the explicit-platform */
16 #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
17 /* do not use vendor and GNU attribution */
18 p = rpmExpand("%{_host_cpu}-%{_host_os}", NULL);
19@@ -520,7 +521,8 @@ static rpmRC rpmPlatform(const char * pl
20 #endif
21 xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre);
22 p = _free(p);
23-
24+#endif
25+
26 init_platform++;
27 }
28 rc = (init_platform ? RPMRC_OK : RPMRC_FAIL);
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
new file mode 100644
index 0000000000..11fd039036
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
@@ -0,0 +1,137 @@
1Fix up platform and related sysinfo file loading.
2
3Upstream-Status: Pending
4
5This ensures that RPM knows the compatible set of package types at all times.
6
7Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
8
9Index: rpm-5.4.14/lib/depends.c
10===================================================================
11--- rpm-5.4.14.orig/lib/depends.c
12+++ rpm-5.4.14/lib/depends.c
13@@ -250,7 +250,7 @@ static int rpmtsAddUpgrades(rpmts ts, rp
14 he->p.ptr = _free(he->p.ptr);
15 }
16
17-#if defined(RPM_VENDOR_WINDRIVER)
18+#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE)
19 /*
20 * If we're capable of installing multiple colors
21 * but at least one of the packages are white (0), we
22@@ -507,7 +507,7 @@ assert(lastx >= 0 && lastx < ts->orderCo
23 return 0;
24 }
25
26-#if defined(RPM_VENDOR_WINDRIVER)
27+#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE)
28 /* Is "compat" compatible w/ arch? */
29 int _isCompatibleArch(const char * arch, const char * compat)
30 {
31@@ -663,7 +663,7 @@ assert(he->p.str != NULL);
32
33 if (arch == NULL || (parch = rpmteA(p)) == NULL)
34 continue;
35-#if defined(RPM_VENDOR_WINDRIVER)
36+#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE)
37 /* XXX hackery for alias matching. */
38 if (!_isCompatibleArch(arch, parch))
39 continue;
40@@ -829,6 +829,12 @@ int rpmtsAddEraseElement(rpmts ts, Heade
41 return rc;
42 }
43
44+#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
45+#define _ETC_RPM_SYSINFO "%{_etcrpm}/sysinfo"
46+#else
47+#define _ETC_RPM_SYSINFO SYSCONFIGDIR "/sysinfo"
48+#endif
49+
50 /*@only@*/ /*@null@*/ /*@unchecked@*/
51 static char *sysinfo_path = NULL;
52
53@@ -1311,7 +1317,7 @@ retry:
54 sysinfo_path = rpmExpand("%{?_rpmds_sysinfo_path}", NULL);
55 if (!(sysinfo_path != NULL && *sysinfo_path == '/')) {
56 sysinfo_path = _free(sysinfo_path);
57- sysinfo_path = xstrdup(SYSCONFIGDIR "/sysinfo");
58+ sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL);
59 }
60 }
61
62Index: rpm-5.4.14/lib/rpmds.c
63===================================================================
64--- rpm-5.4.14.orig/lib/rpmds.c
65+++ rpm-5.4.14/lib/rpmds.c
66@@ -1759,7 +1759,7 @@ int rpmdsSysinfo(rpmPRCO PRCO, const cha
67 /*@-observertrans @*/
68 _sysinfo_path = _free(_sysinfo_path);
69 /*@=observertrans @*/
70- _sysinfo_path = xstrdup(_ETC_RPM_SYSINFO);
71+ _sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL);
72 }
73 }
74 /*@=modobserver@*/
75Index: rpm-5.4.14/lib/rpmrc.c
76===================================================================
77--- rpm-5.4.14.orig/lib/rpmrc.c
78+++ rpm-5.4.14/lib/rpmrc.c
79@@ -38,7 +38,13 @@
80 static const char * configTarget = NULL;
81
82 /*@observer@*/ /*@unchecked@*/
83-static const char * platform = SYSCONFIGDIR "/platform";
84+#if defined(RPM_VENDOR_WINDRIVER)
85+#define _ETC_RPM_PLATFORM "%{_etcrpm}/platform"
86+#else
87+#define _ETC_RPM_PLATFORM SYSCONFIGDIR "/platform"
88+#endif
89+
90+static const char * _platform = NULL;
91
92 /*@only@*/ /*@relnull@*/ /*@unchecked@*/
93 void * platpat = NULL;
94@@ -694,16 +700,17 @@ static void defaultMachine(/*@out@*/ con
95 int rc;
96
97 while (!gotDefaults) {
98-#if defined(RPM_VENDOR_WINDRIVER)
99- const char * _platform = rpmGetPath(__etcrpm, "/platform", NULL);
100-#else
101- const char * _platform = platform;
102-#endif
103+ if (_platform == NULL) {
104+ _platform = rpmExpand("%{?_rpmrc_platform_path}", NULL);
105+ /* XXX may need to validate path existence somewhen. */
106+ if (!(_platform != NULL && *_platform == '/')) {
107+ _platform = _free(_platform);
108+ _platform = rpmExpand(_ETC_RPM_PLATFORM, NULL);
109+ }
110+ }
111 CVOG_t cvog = NULL;
112 #if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */
113 const char *cp;
114-#endif
115-#if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */
116 /* utsname fields on some platforms (like HP-UX) are very small
117 (just about 8 characters). This is too small for OpenPKG, so cheat! */
118 rc = uname(&un_real);
119@@ -780,9 +787,7 @@ static void defaultMachine(/*@out@*/ con
120 if (cp != NULL && cp != _platform)
121 cp = _free(cp);
122 #endif
123-#if defined(RPM_VENDOR_WINDRIVER)
124 _platform = _free(_platform);
125-#endif
126
127 if (configTarget && !parseCVOG(configTarget, &cvog) && cvog != NULL) {
128 gotDefaults = 1;
129@@ -1101,6 +1106,8 @@ int rpmReadConfigFiles(/*@unused@*/ cons
130
131 #ifdef PREMACROFILES
132 if (rpmReadRC(PREMACROFILES)) return -1;
133+#else
134+ if (rpmReadRC(NULL)) return -1;
135 #endif
136
137 /* Reset umask to its default umask(2) value. */
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
new file mode 100644
index 0000000000..fed54e5f11
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
@@ -0,0 +1,105 @@
1Fix up platform and related sysinfo file loading (part 2).
2
3Upstream-Status: Pending
4
5We need to ensure that we set the _gnu flag somehow. We do this by reading
6from the platform file, and setting a new _platform_gnu and related vars.
7
8The default values of _host_cpu, _host_vendor and _host_os are changed to
9reference either the automatically determined _target_... or _platform_...
10values. The macros file uses the configure time defaults in _platform_...
11versions have not been defined. This preserves existing behavior, but
12ensures reasonable defaults are always available.
13
14Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
15
16Index: rpm-5.4.14/lib/rpmrc.c
17===================================================================
18--- rpm-5.4.14.orig/lib/rpmrc.c
19+++ rpm-5.4.14/lib/rpmrc.c
20@@ -328,10 +328,15 @@ static void setDefaults(void)
21 /*@modifies rpmGlobalMacroContext, internalState @*/
22 {
23
24-#if defined(RPM_VENDOR_WINDRIVER)
25+#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
26 addMacro(NULL, "_usrlibrpm", NULL, __usrlibrpm, RMIL_DEFAULT);
27 addMacro(NULL, "_etcrpm", NULL, __etcrpm, RMIL_DEFAULT);
28 addMacro(NULL, "_vendor", NULL, "%{?_host_vendor}%{!?_host_vendor:wrs}", RMIL_DEFAULT);
29+
30+ addMacro(NULL, "_host_cpu", NULL, "%{?_platform_cpu}%{!?_platform_cpu:%{?_target_cpu}}", RMIL_DEFAULT);
31+ addMacro(NULL, "_host_vendor", NULL, "%{?_platform_vendor}%{!?_platform_cpu:%{?_target_vendor}}", RMIL_DEFAULT);
32+ addMacro(NULL, "_host_os", NULL, "%{?_platform_os}%{!?_platform_os:%{?_target_os}}", RMIL_DEFAULT);
33+ addMacro(NULL, "_host_gnu", NULL, "%{?_platform_gnu}%{!?_platform_gnu:%{?_gnu}}", RMIL_DEFAULT);
34 #endif
35
36 addMacro(NULL, "_usr", NULL, USRPREFIX, RMIL_DEFAULT);
37@@ -487,9 +492,22 @@ static rpmRC rpmPlatform(const char * pl
38 }
39
40 if (!parseCVOG(p, &cvog) && cvog != NULL) {
41+#if defined(RPM_VENDOR_OE)
42+ char * _gnu = NULL;
43+
44+ addMacro(NULL, "_platform_cpu", NULL, cvog->cpu, -1);
45+ addMacro(NULL, "_platform_vendor", NULL, cvog->vendor, -1);
46+ addMacro(NULL, "_platform_os", NULL, cvog->os, -1);
47+
48+ if (cvog->gnu && cvog->gnu[0] != '\0')
49+ _gnu = rpmExpand("-", cvog->gnu, NULL);
50+
51+ addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
52+#else
53 addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
54 addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
55 addMacro(NULL, "_host_os", NULL, cvog->os, -1);
56+#endif
57 }
58
59 #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
60Index: rpm-5.4.14/macros/macros.in
61===================================================================
62--- rpm-5.4.14.orig/macros/macros.in
63+++ rpm-5.4.14/macros/macros.in
64@@ -900,9 +900,9 @@ $_arbitrary_tags_tests Foo:Bar
65 %_os @RPMCANONOS@
66 %_gnu @RPMCANONGNU@
67
68-%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}
69-%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
70-%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu}
71+%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
72+%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
73+%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
74
75 #==============================================================================
76 # ---- configure macros.
77@@ -945,9 +945,10 @@ $_arbitrary_tags_tests Foo:Bar
78 %_build_os %{_host_os}
79 %_host @host@
80 %_host_alias @host_alias@%{nil}
81-%_host_cpu @host_cpu@
82-%_host_vendor @host_vendor@
83-%_host_os @host_os@
84+%_host_cpu %{?_platform_cpu}%{!?_platform_cpu:%{_arch}}
85+%_host_vendor %{?_platform_vendor}%{!?_platform_vendor:%{_vendor}}
86+%_host_os %{?_platform_os}%{!?_platform_os:%{_os}}
87+%_host_gnu %{?_platform_gnu}%{!?_platform_gnu:%{_gnu}}
88 %_target %{_host}
89 %_target_alias %{_host_alias}
90 %_target_cpu %{_host_cpu}
91Index: rpm-5.4.14/python/rpmmodule.c
92===================================================================
93--- rpm-5.4.14.orig/python/rpmmodule.c
94+++ rpm-5.4.14/python/rpmmodule.c
95@@ -65,8 +65,8 @@ static PyObject * archScore(PyObject * s
96 if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &arch))
97 return NULL;
98
99-#if defined(RPM_VENDOR_WINDRIVER)
100- platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_gnu}", NULL);
101+#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
102+ platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}", NULL);
103 #else
104 platform = rpmExpand(arch, "-", "%{_vendor}", "-", "%{_os}", NULL);
105 #endif
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch b/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch
new file mode 100644
index 0000000000..07d407d36a
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch
@@ -0,0 +1,27 @@
1python/rpmmodules.c: Change the way the python module loads the RPM config
2
3In order to support the RPM_VENDOR_WINDRIVER enhancement of dynamic
4runtime relocation paths, we need to call rpmcliInit instead of
5rpmReadConfigFiles. The rpmcliInit will end up calling rpmReadConfigFiles
6after the necessary relocation processing (if enabled).
7
8Code derived from changes suggested by Paul Eggleton.
9
10Upstream-Status: Pending
11
12Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
13
14Index: rpm-5.4.14/python/rpmmodule.c
15===================================================================
16--- rpm-5.4.14.orig/python/rpmmodule.c
17+++ rpm-5.4.14/python/rpmmodule.c
18@@ -392,7 +392,8 @@ void init_rpm(void)
19 if (Py_AtExit(rpm_exithook) == -1)
20 return;
21
22- rpmReadConfigFiles(NULL, NULL);
23+ const char *argv[1] = {"rpmmodule", 0};
24+ rpmcliInit(1, argv, NULL);
25
26 d = PyModule_GetDict(m);
27
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch b/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch
new file mode 100644
index 0000000000..58863774f6
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch
@@ -0,0 +1,24 @@
1chroot: realpath is required before expanding _dbpath
2
3_usr turned out to be a relative path to support dyanmic config, but it's
4being used somewhere as a indicator to locate substrings, so we must get
5the real path of it in advance.
6
7Upstream-Status: Inapproriate (OpenEmbedded specific)
8
9Signed-off-by: Ming Liu <ming.liu@windriver.com>
10
11diff -urpN a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c
12--- a/rpmio/rpmrpc.c
13+++ b/rpmio/rpmrpc.c
14@@ -257,7 +257,9 @@ int Open(const char * path, int flags, m
15 /* XXX if the open(2) fails, try to strip a possible chroot(2) prefix. */
16 if (fdno < 0 && errno == ENOENT) {
17 const char *dbpath = rpmExpand("%{?_dbpath}/", NULL);
18- const char * fn = strstr(path + 1, dbpath);
19+ char resolved_dbpath[PATH_MAX];
20+ realpath(dbpath, resolved_dbpath);
21+ const char * fn = strstr(path + 1, resolved_dbpath);
22 if (fn)
23 fdno = open(fn, flags, mode);
24 dbpath = _free(dbpath);
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch b/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch
new file mode 100644
index 0000000000..0a5f5a4d72
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch
@@ -0,0 +1,31 @@
1macros: Use dyanmic config vs hard coded settings
2
3When the dynamic, runtime relocation is enables we need to make sure that the
4RPM macro file does not override the dynamic settings. Fix this by forcing the
5dynamic version to be used in all cases.
6
7Upstream-Status: Inapproriate (OpenEmbedded specific)
8
9Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
10
11Index: rpm-5.4.14/macros/macros.in
12===================================================================
13--- rpm-5.4.14.orig/macros/macros.in
14+++ rpm-5.4.14/macros/macros.in
15@@ -27,11 +27,12 @@
16 #==============================================================================
17 # ---- filesystem macros.
18 #
19-%_usr @usrprefix@
20+%_usr %{_usrlibrpm}/../..
21 %_usrsrc %{_usr}/src
22-%_var @varprefix@
23-%_usrlibrpm @USRLIBRPM@
24-%_etcrpm @SYSCONFIGDIR@
25+%_var %{_usr}/../var
26+# The dynamic relocation code sets the following two items
27+#%_usrlibrpm @USRLIBRPM@
28+#%_etcrpm @SYSCONFIGDIR@
29
30 %__objext @objext@
31 %__libext @libext@
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-remove-sykcparse-decl.patch b/meta/recipes-devtools/rpm/rpm/rpm-remove-sykcparse-decl.patch
new file mode 100644
index 0000000000..769016b564
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-remove-sykcparse-decl.patch
@@ -0,0 +1,14 @@
1Index: rpm-5.4.14/syck/lib/syck.h
2===================================================================
3--- rpm-5.4.14.orig/syck/lib/syck.h
4+++ rpm-5.4.14/syck/lib/syck.h
5@@ -621,9 +621,6 @@ long syck_seq_count( SyckNode *seq )
6 */
7 void syckerror( char *msg )
8 /*@*/;
9-int syckparse( void * )
10- /*@globals fileSystem @*/
11- /*@modifies fileSystem @*/;
12 /* XXX union YYSTYPE *sycklval has issues on Mac OS X. */
13 int sycklex( void *_sycklval, SyckParser *parser )
14 /*@modifies _sycklval, parser @*/;
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch b/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch
new file mode 100644
index 0000000000..56a243d5f7
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch
@@ -0,0 +1,40 @@
1lib/rpmts.c: Ensure that we check both providename and filepaths
2
3When looking up a missing dependencies, such as /bin/sh, we need to lookup
4in both the providename and filepaths DB, not just the filepaths DB.
5
6Upstream-Status: Pending
7
8Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
9
10Index: rpm-5.4.14/lib/rpmts.c
11===================================================================
12--- rpm-5.4.14.orig/lib/rpmts.c
13+++ rpm-5.4.14/lib/rpmts.c
14@@ -410,8 +410,8 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __
15 if (sdb == NULL)
16 continue;
17
18- /* Look for a matching Provides: in suggested universe. */
19- rpmtag = (*keyp == '/' ? RPMTAG_FILEPATHS : RPMTAG_PROVIDENAME);
20+ rpmtag = RPMTAG_PROVIDENAME;
21+ do {
22 mi = rpmmiInit(sdb, rpmtag, keyp, keylen);
23 while ((h = rpmmiNext(mi)) != NULL) {
24 size_t hnamelen;
25@@ -446,6 +446,15 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __
26 bhnamelen = hnamelen;
27 }
28 mi = rpmmiFree(mi);
29+
30+ if (bh == NULL && *keyp == '/' && rpmtag == RPMTAG_PROVIDENAME) {
31+ rpmtag = RPMTAG_FILEPATHS;
32+ continue;
33+ }
34+
35+ break;
36+ } while (1);
37+
38 }
39
40 /* Is there a suggested resolution? */
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-fix.patch
new file mode 100644
index 0000000000..fcbc25df0e
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-fix.patch
@@ -0,0 +1,67 @@
1rpmpgp.c: Add missing if defs around crypto implementations
2
3Without these, the system will error trying to find the correct crypto
4library to use.
5
6Upstream-status: Pending
7
8Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
9
10Index: rpm/rpmio/rpmpgp.c
11===================================================================
12--- rpm.orig/rpmio/rpmpgp.c
13+++ rpm/rpmio/rpmpgp.c
14@@ -1339,16 +1339,26 @@ int pgpExportPubkey(pgpDig dig)
15 {
16 int rc = 0; /* assume failure */
17
18+#if defined(WITH_BEECRYPT)
19 if (pgpImplVecs == &rpmbcImplVecs)
20 rc = rpmbcExportPubkey(dig);
21+#endif
22+#if defined(WITH_SSL)
23 if (pgpImplVecs == &rpmsslImplVecs)
24 rc = rpmsslExportPubkey(dig);
25+#endif
26+#if defined(WITH_NSS)
27 if (pgpImplVecs == &rpmnssImplVecs)
28 rc = rpmnssExportPubkey(dig);
29+#endif
30+#if defined(WITH_GCRYPT)
31 if (pgpImplVecs == &rpmgcImplVecs)
32 rc = rpmgcExportPubkey(dig);
33+#endif
34+#if defined(WITH_TOMCRYPT)
35 if (pgpImplVecs == &rpmltcImplVecs)
36 rc = rpmltcExportPubkey(dig);
37+#endif
38 return rc;
39 }
40
41@@ -1356,16 +1366,26 @@ int pgpExportSignature(pgpDig dig, DIGES
42 {
43 int rc = 0; /* assume failure */
44
45+#if defined(WITH_BEECRYPT)
46 if (pgpImplVecs == &rpmbcImplVecs)
47 rc = rpmbcExportSignature(dig, ctx);
48+#endif
49+#if defined(WITH_SSL)
50 if (pgpImplVecs == &rpmsslImplVecs)
51 rc = rpmsslExportSignature(dig, ctx);
52+#endif
53+#if defined(WITH_NSS)
54 if (pgpImplVecs == &rpmnssImplVecs)
55 rc = rpmnssExportSignature(dig, ctx);
56+#endif
57+#if defined(WITH_GCRYPT)
58 if (pgpImplVecs == &rpmgcImplVecs)
59 rc = rpmgcExportSignature(dig, ctx);
60+#endif
61+#if defined(WITH_TOMCRYPT)
62 if (pgpImplVecs == &rpmltcImplVecs)
63 rc = rpmltcExportSignature(dig, ctx);
64+#endif
65 return rc;
66 }
67
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch b/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch
new file mode 100644
index 0000000000..f825372e82
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch
@@ -0,0 +1,160 @@
1Enable a cross-install scriptlet helper.
2
3The helper is called from outside of the chroot with the arguments:
4
5<root> <prog> <script> <arg1> [<arg2> ... <argN>]
6
7The helper script is used by oe-core to facilitate shell script actions that
8can not be run from within a chroot on a foreign target system during a
9cross install.
10
11Upstream-Status: Pending
12
13Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
14
15Index: rpm-5.4.14/lib/psm.c
16===================================================================
17--- rpm-5.4.14.orig/lib/psm.c
18+++ rpm-5.4.14/lib/psm.c
19@@ -806,6 +806,10 @@ static rpmRC runScript(rpmpsm psm, Heade
20 int xx;
21 int i;
22
23+#ifdef RPM_VENDOR_OE
24+ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
25+#endif
26+
27 if (psm->sstates != NULL && ix >= 0 && ix < RPMSCRIPT_MAX)
28 ssp = psm->sstates + ix;
29 if (ssp != NULL)
30@@ -872,14 +876,29 @@ assert(he->p.str != NULL);
31 (F_ISSET(psm, UNORDERED) ? "a" : ""));
32
33 if (Phe->p.argv == NULL) {
34- argv = (const char **) alloca(5 * sizeof(*argv));
35- argv[0] = "/bin/sh";
36- argc = 1;
37+ argv = (const char **) alloca(7 * sizeof(*argv));
38+ argc = 0;
39+ } else {
40+ argv = (const char **) alloca((Phe->c + 6) * sizeof(*argv));
41+ argc = 0;
42+ }
43+
44+#ifdef RPM_VENDOR_OE
45+ if (scriptletWrapper && *scriptletWrapper) {
46+ argv[argc++] = scriptletWrapper;
47+ argv[argc] = rpmtsRootDir(ts);
48+ if (!argv[argc] || !*argv[argc])
49+ argv[argc] = "/";
50+ argc++;
51+ }
52+#endif
53+
54+ if (Phe->p.argv == NULL) {
55+ argv[argc++] = "/bin/sh";
56 ldconfig_done = 0;
57 } else {
58- argv = (const char **) alloca((Phe->c + 4) * sizeof(*argv));
59- memcpy(argv, Phe->p.argv, Phe->c * sizeof(*argv));
60- argc = Phe->c;
61+ memcpy((argv + argc), Phe->p.argv, Phe->c * sizeof(*argv));
62+ argc += Phe->c;
63 ldconfig_done = (ldconfig_path && !strcmp(argv[0], ldconfig_path)
64 ? 1 : 0);
65 }
66@@ -930,7 +949,12 @@ assert(he->p.str != NULL);
67 goto exit;
68
69 if (rpmIsDebug() &&
70- (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash")))
71+ (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash"))
72+#ifdef RPM_VENDOR_OE
73+ || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/sh"))
74+ || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/bash"))
75+#endif
76+ )
77 {
78 static const char set_x[] = "set -x\n";
79 nw = Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd);
80@@ -1065,12 +1089,22 @@ assert(he->p.str != NULL);
81
82 { const char * rootDir = rpmtsRootDir(ts);
83 if (!rpmtsChrootDone(ts) && rootDir != NULL &&
84+#ifdef RPM_VENDOR_OE
85+ !(scriptletWrapper && *scriptletWrapper) &&
86+#endif
87 !(rootDir[0] == '/' && rootDir[1] == '\0'))
88 {
89 /*@-modobserver@*/
90 xx = Chroot(rootDir);
91 /*@=modobserver@*/
92 }
93+#ifdef RPM_VENDOR_OE
94+ if (!rpmtsChrootDone(ts) && rootDir != NULL &&
95+ (scriptletWrapper && *scriptletWrapper) &&
96+ !(rootDir[0] == '/' && rootDir[1] == '\0'))
97+ xx = Chdir(rootDir);
98+ else
99+#endif
100 xx = Chdir("/");
101 rpmlog(RPMLOG_DEBUG, D_("%s: %s(%s)\texecv(%s) pid %d\n"),
102 psm->stepName, sln, NVRA,
103@@ -2985,6 +3019,13 @@ assert(psm->te != NULL);
104 case PSM_SCRIPT: /* Run current package scriptlets. */
105 /* XXX running %verifyscript/%sanitycheck doesn't have psm->te */
106 { rpmtxn _parent = (psm && psm->te ? psm->te->txn : NULL);
107+
108+#ifdef RPM_VENDOR_OE
109+ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
110+ if (scriptletWrapper && *scriptletWrapper)
111+ rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
112+#endif
113+
114 xx = rpmtxnBegin(rpmtsGetRdb(ts), _parent, NULL);
115 rc = runInstScript(psm);
116 if (rc)
117@@ -2992,11 +3033,24 @@ assert(psm->te != NULL);
118 else
119 xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn);
120 rpmtsGetRdb(ts)->db_txn = NULL;
121+#ifdef RPM_VENDOR_OE
122+ if (scriptletWrapper && *scriptletWrapper)
123+ rc = rpmpsmNext(psm, PSM_CHROOT_IN);
124+#endif
125 } break;
126 case PSM_TRIGGERS:
127 /* Run triggers in other package(s) this package sets off. */
128 if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break;
129+#ifdef RPM_VENDOR_OE
130+ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
131+ if (scriptletWrapper && *scriptletWrapper)
132+ rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
133+#endif
134 rc = runTriggers(psm);
135+#ifdef RPM_VENDOR_OE
136+ if (scriptletWrapper && *scriptletWrapper)
137+ rc = rpmpsmNext(psm, PSM_CHROOT_IN);
138+#endif
139 break;
140 case PSM_IMMED_TRIGGERS:
141 /* Run triggers in this package other package(s) set off. */
142@@ -3006,7 +3060,18 @@ assert(psm->te != NULL);
143 F_SET(psm, GOTTRIGGERS);
144 }
145 if (psm->triggers != NULL)
146+#ifdef RPM_VENDOR_OE
147+ {
148+ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
149+ if (scriptletWrapper && *scriptletWrapper)
150+ rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
151+#endif
152 rc = runImmedTriggers(psm);
153+#ifdef RPM_VENDOR_OE
154+ if (scriptletWrapper && *scriptletWrapper)
155+ rc = rpmpsmNext(psm, PSM_CHROOT_IN);
156+ }
157+#endif
158 break;
159
160 case PSM_RPMIO_FLAGS:
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch b/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch
new file mode 100644
index 0000000000..ec38b95f2e
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch
@@ -0,0 +1,26 @@
1Workaround for a memory leak in --showrc.
2
3Upstream-Status: Pending
4
5Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
6
7Index: rpm-5.4.14/lib/rpmrc.c
8===================================================================
9--- rpm-5.4.14.orig/lib/rpmrc.c
10+++ rpm-5.4.14/lib/rpmrc.c
11@@ -1228,11 +1228,15 @@ int rpmShowRC(FILE * fp)
12 if (DNEVR != NULL)
13 fprintf(fp, " %s\n", DNEVR+2);
14 }
15+#if 0
16 (void)rpmdsFree(ds);
17 ds = NULL;
18+#endif
19 fprintf(fp, "\n");
20 }
21+#if 0
22 PRCO = rpmdsFreePRCO(PRCO);
23+#endif
24 }
25
26 if (rpmIsVerbose()) {
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch
new file mode 100644
index 0000000000..683275cb18
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch
@@ -0,0 +1,50 @@
1fix a endian incompatible error in generating rpm tag
2
3A flaw was found in the way rpm generating arbitrary tags, which leads to a
4incorrect query result, this issue is introduced by a incompatible endianess
5when the generating process is executed on different architectures.
6
7This patch resolves it by taking the byte order that host uses.
8
9Upstream-Status: Pending
10
11Signed-off-by: Ming Liu <ming.liu@windriver.com>
12---
13 tagname.c | 16 ++++++++++++++++
14 1 file changed, 16 insertions(+)
15
16Index: rpm-5.4.14/rpmdb/tagname.c
17===================================================================
18--- rpm-5.4.14.orig/rpmdb/tagname.c
19+++ rpm-5.4.14/rpmdb/tagname.c
20@@ -3,6 +3,19 @@
21 */
22
23 #include "system.h"
24+#include <endian.h>
25+
26+/* Don't redefine this macro if it already exists */
27+#ifndef le32toh
28+#ifdef __USE_BSD
29+#include <byteswap.h>
30+#if __BYTE_ORDER == __LITTLE_ENDIAN
31+#define le32toh(x) (x)
32+#else
33+#define le32toh(x) __bswap_32(x)
34+#endif
35+#endif /* __USE_BSD */
36+#endif /* le32toh */
37
38 #include <rpmio_internal.h> /* XXX DIGEST_CTX, xtolower, xstrcasecmp */
39 #include <rpmmacro.h>
40@@ -152,7 +165,10 @@ static rpmTag _tagGenerate(const char *s
41 xx = rpmDigestUpdate(ctx, s, nb);
42 xx = rpmDigestFinal(ctx, &digest, &digestlen, 0);
43 if (digest && digestlen > 4) {
44+ /* The tag is stored in a uniform byte order for cross-endian compatibility.
45+ Swap to the host uses. */
46 memcpy(&tag, digest + (digestlen - 4), 4);
47+ tag = le32toh(tag);
48 tag = (rpmTag) (tag & 0x3fffffff);
49 tag = (rpmTag) (tag | 0x40000000);
50 }
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch b/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch
new file mode 100644
index 0000000000..cb85bebfc0
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch
@@ -0,0 +1,24 @@
1Source: None
2Upstream-Status: Pending
3Author: Khem Raj <raj.khem@gmail.com>
4Date: 2011-03-03
5Description:
6This patch fixes build issue found when compiling rpm-native on ubuntu
711.04-alpha. Problem is that linker does not get correct set of dependent
8libraries when linking mtree binary which results in undefined symbols
9in librpmio.so. This patch adds correct flags to mtree_LDADD to account
10for rpmio deps
11
12Index: rpm-5.4.14/tools/Makefile.am
13===================================================================
14--- rpm-5.4.14.orig/tools/Makefile.am
15+++ rpm-5.4.14/tools/Makefile.am
16@@ -186,7 +186,7 @@ grep_LDADD = $(RPMIO_LDADD_COMMON)
17
18 mtree_SOURCES = rpmmtree.c
19 mtree_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
20-mtree_LDADD = $(RPM_LDADD_COMMON)
21+mtree_LDADD = $(RPMIO_LDADD_COMMON)
22
23 rpmrepo_SOURCES = rpmrepo.c
24 rpmrepo_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/scripts -I$(top_builddir)/scripts $(CPPFLAGS)
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch b/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch
new file mode 100644
index 0000000000..713f84ee27
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch
@@ -0,0 +1,40 @@
1A patch to fix a problem when compiling with uuid.
2
3When attempting to build with uuid and all tests compiling will error because
4uuid.h doesn't exist in the rpm tarball. Fix this by changing the include to
5use the one in ossp which solves the issue.
6
7The recipe already depends on ossp so ossp/uuid.h will be there when rpm-native
8is built.
9
10Upstream-Status: Pending
11
12Signed-off-by: Morgan Little <morgan.little@windriver.com>
13
14
15Index: rpm-5.4.14/lua/local/luuid.c
16===================================================================
17--- rpm-5.4.14.orig/lua/local/luuid.c
18+++ rpm-5.4.14/lua/local/luuid.c
19@@ -21,7 +21,7 @@
20
21 #ifdef LUA_USE_UUID
22
23-#include "uuid.h"
24+#include <ossp/uuid.h>
25
26 /* Lua method: <uuid> = uuid.generate(<version>[, <uuid-namespace>, <data>]) */
27 static int luuid_generate(lua_State *L)
28Index: rpm-5.4.14/rpmio/rpmuuid.c
29===================================================================
30--- rpm-5.4.14.orig/rpmio/rpmuuid.c
31+++ rpm-5.4.14/rpmio/rpmuuid.c
32@@ -16,7 +16,7 @@
33 #include "rpmlog.h"
34 #include "rpmuuid.h"
35 #ifdef WITH_UUID
36-#include "uuid.h"
37+#include <ossp/uuid.h>
38 #endif
39 #include "debug.h"
40
diff --git a/meta/recipes-devtools/rpm/rpm/rpm2cpio b/meta/recipes-devtools/rpm/rpm/rpm2cpio
new file mode 100755
index 0000000000..6bcef6a4ce
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm2cpio
@@ -0,0 +1,39 @@
1#!/bin/sh
2
3# Prevent gawk >= 4.0.x from getting funny ideas wrt UTF in printf()
4LANG=C
5
6pkg=$1
7if [ "$pkg" = "" -o ! -e "$pkg" ]; then
8 echo "no package supplied" 1>&2
9 exit 1
10fi
11
12leadsize=96
13o=`expr $leadsize + 8`
14set `od -j $o -N 8 -t u1 $pkg`
15il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
16dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
17# echo "sig il: $il dl: $dl"
18
19sigsize=`expr 8 + 16 \* $il + $dl`
20o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`
21set `od -j $o -N 8 -t u1 $pkg`
22il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
23dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
24# echo "hdr il: $il dl: $dl"
25
26hdrsize=`expr 8 + 16 \* $il + $dl`
27o=`expr $o + $hdrsize`
28comp=`dd if=$pkg ibs=$o skip=1 count=1 2>/dev/null | dd bs=3 count=1 2> /dev/null`
29
30gz="`echo . | awk '{ printf("%c%c", 0x1f, 0x8b); }'`"
31lzma="`echo . | awk '{ printf("%cLZ", 0xff); }'`"
32xz="`echo . | awk '{ printf("%c7z", 0xfd); }'`"
33case "$comp" in
34 BZh) dd if="$pkg" ibs=$o skip=1 2>/dev/null | bunzip2 ;;
35 "$gz"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | gunzip ;;
36 "$xz"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | xzcat ;;
37 "$lzma"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | unlzma ;;
38 *) echo "Unrecognized rpm file: $pkg"; exit 1 ;;
39esac
diff --git a/meta/recipes-devtools/rpm/rpm/rpmatch.patch b/meta/recipes-devtools/rpm/rpm/rpmatch.patch
new file mode 100644
index 0000000000..20d13aa08c
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpmatch.patch
@@ -0,0 +1,42 @@
1Add configure check for rpmatch() and
2creates a compatable macro if it is not provided by the C library.
3
4This is needed for uclibc since it does not have the above function
5implemented.
6
7Upstream-Status: Pending
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Index: rpm-5.4.14/configure.ac
12===================================================================
13--- rpm-5.4.14.orig/configure.ac
14+++ rpm-5.4.14/configure.ac
15@@ -943,7 +943,7 @@ AC_CHECK_FUNCS([dnl
16 ftok getaddrinfo getattrlist getcwd getdelim getline getmode getnameinfo dnl
17 getpassphrase getxattr getwd iconv inet_aton lchflags lchmod lchown dnl
18 lgetxattr lsetxattr lutimes madvise mempcpy mkdtemp mkstemp mtrace dnl
19- posix_fadvise posix_fallocate putenv realpath regcomp secure_getenv __secure_getenv dnl
20+ posix_fadvise posix_fallocate putenv realpath regcomp rpmatch secure_getenv __secure_getenv dnl
21 setattrlist setenv setlocale setmode setxattr dnl
22 sigaddset sigdelset sigemptyset sighold sigrelse sigpause dnl
23 sigprocmask sigsuspend sigaction dnl
24Index: rpm-5.4.14/system.h
25===================================================================
26--- rpm-5.4.14.orig/system.h
27+++ rpm-5.4.14/system.h
28@@ -353,6 +353,14 @@ extern int _tolower(int) __THROW /*@*/;
29 #include <libgen.h>
30 #endif
31
32+#ifndef HAVE_RPMATCH
33+#define rpmatch(line) \
34+ ( (line == NULL)? -1 : \
35+ (*line == 'y' || *line == 'Y')? 1 : \
36+ (*line == 'n' || *line == 'N')? 0 : \
37+ -1 )
38+#endif
39+
40 /* -- Retrofit glibc __progname */
41 #if defined __GLIBC__ && __GLIBC__ >= 2
42 #if __GLIBC_MINOR__ >= 1
diff --git a/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch b/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch
new file mode 100644
index 0000000000..9bdd1d4908
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch
@@ -0,0 +1,194 @@
1Add an "rpmdeps-oecore" binary which allows batch processing of individual file
2dependencies in a similar manner to rpmdeps --provides --requires -v, prefixing
3each line of output with the filename that has the dependency.
4
5This is much faster than individually calling rpmdeps on each file.
6
7This binary is used by package.bbclass.
8
9Upstream-Status: Inappropriate [OE Specific]
10
11RP 2012/2/7
12
13---
14 tools/Makefile.am | 6 ++-
15 tools/rpmdeps-oecore.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++++
16 2 files changed, 152 insertions(+), 1 deletions(-)
17 create mode 100644 tools/rpmdeps-oecore.c
18
19Index: rpm-5.4.14/tools/Makefile.am
20===================================================================
21--- rpm-5.4.14.orig/tools/Makefile.am
22+++ rpm-5.4.14/tools/Makefile.am
23@@ -62,7 +62,7 @@ pkgbin_PROGRAMS = \
24 @WITH_AUGEAS_AUGTOOL@ chroot cp @WITH_CUDF_CUDFTOOL@ find mtree \
25 @WITH_SEMANAGE_SEMODULE@ wget \
26 rpmcache rpmdigest rpmrepo rpmspecdump \
27- rpmcmp rpmdeps sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@
28+ rpmcmp rpmdeps rpmdeps-oecore sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@
29 if WITH_DB
30 pkgbin_PROGRAMS += dbconvert
31 endif
32@@ -172,6 +172,10 @@ rpmdeps_SOURCES = rpmdeps.c
33 rpmdeps_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
34 rpmdeps_LDADD = $(RPM_LDADD_COMMON)
35
36+rpmdeps_oecore_SOURCES = rpmdeps-oecore.c
37+rpmdeps_oecore_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
38+rpmdeps_oecore_LDADD = $(RPM_LDADD_COMMON)
39+
40 rpmdigest_SOURCES = rpmdigest.c
41 rpmdigest_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
42 rpmdigest_LDADD = $(RPMIO_LDADD_COMMON)
43Index: rpm-5.4.14/tools/rpmdeps-oecore.c
44===================================================================
45--- /dev/null
46+++ rpm-5.4.14/tools/rpmdeps-oecore.c
47@@ -0,0 +1,147 @@
48+#include "system.h"
49+const char *__progname;
50+
51+#include <rpmio.h>
52+#include <rpmiotypes.h>
53+#include <rpmcb.h>
54+#include <argv.h>
55+#include <rpmtypes.h>
56+#include <rpmtag.h>
57+
58+#include <rpmds.h>
59+#define _RPMFC_INTERNAL /* XXX for debugging */
60+#include <rpmfc.h>
61+
62+#include <rpmcli.h>
63+
64+#include "debug.h"
65+
66+/*@unchecked@*/
67+char *progname;
68+
69+#define RPMDEP_RPMFC 1
70+
71+static int rpmdepPrint(char *filename, rpmds ds, FILE * fp)
72+{
73+ if (fp == NULL) fp = stderr;
74+
75+ ds = rpmdsInit(ds);
76+ while (rpmdsNext(ds) >= 0) {
77+ fprintf(fp, "%s %s: %s\n", filename, rpmdsType(ds), rpmdsDNEVR(ds)+2);
78+ }
79+ return 0;
80+}
81+
82+static struct poptOption optionsTable[] = {
83+
84+ { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0,
85+ N_("Common options:"),
86+ NULL },
87+
88+ POPT_AUTOALIAS
89+ POPT_AUTOHELP
90+ POPT_TABLEEND
91+};
92+
93+
94+int
95+main(int argc, char *argv[])
96+{
97+ poptContext optCon;
98+ ARGV_t av = NULL;
99+ rpmfc fc = NULL;
100+ FILE * fp = NULL;
101+ int flags = 0;
102+ int ac = 0;
103+ int ec = 1;
104+ int xx;
105+ int i;
106+ char buf[BUFSIZ];
107+ int nddict;
108+ const char * s;
109+ char * se;
110+ const char * fn;
111+ const char * N;
112+ const char * EVR;
113+ evrFlags Flags;
114+ unsigned char deptype;
115+ int ix;
116+ rpmds ds;
117+
118+/*@-modobserver@*/
119+ if ((progname = strrchr(argv[0], '/')) != NULL)
120+ progname++;
121+ else
122+ progname = argv[0];
123+/*@=modobserver@*/
124+
125+ optCon = rpmcliInit(argc, argv, optionsTable);
126+ if (optCon == NULL)
127+ goto exit;
128+
129+ av = poptGetArgs(optCon);
130+ ac = argvCount(av);
131+
132+ if (ac == 0) {
133+ av = NULL;
134+ xx = argvFgets(&av, NULL);
135+ ac = argvCount(av);
136+ }
137+
138+ /* Make sure file names are sorted. */
139+ xx = argvSort(av, NULL);
140+
141+ /* Build file class dictionary. */
142+ fc = rpmfcNew();
143+ xx = rpmfcClassify(fc, av, NULL);
144+
145+ /* Build file/package dependency dictionary. */
146+ xx = rpmfcApply(fc);
147+
148+ /* Generate per-file indices into package dependencies. */
149+ nddict = argvCount(fc->ddict);
150+
151+ for (i = 0; i < nddict; i++) {
152+ s = fc->ddict[i];
153+
154+ /* Parse out (file#,deptype,N,EVR,Flags) */
155+ ix = strtol(s, &se, 10);
156+ assert(se != NULL);
157+ deptype = *se++;
158+ se++;
159+ N = se;
160+ while (*se && *se != ' ')
161+ se++;
162+ *se++ = '\0';
163+ EVR = se;
164+ while (*se && *se != ' ')
165+ se++;
166+ *se++ = '\0';
167+ Flags = strtol(se, NULL, 16);
168+
169+ switch (deptype) {
170+ default:
171+ /*@switchbreak@*/ break;
172+ case 'P':
173+ ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags);
174+ rpmdepPrint((char *)fc->fn[ix], ds, stdout);
175+ (void)rpmdsFree(ds);
176+ ds = NULL;
177+ /*@switchbreak@*/ break;
178+ case 'R':
179+ ds = rpmdsSingle(RPMTAG_REQUIRENAME, N, EVR, Flags);
180+ rpmdepPrint((char *)fc->fn[ix], ds, stdout);
181+ (void)rpmdsFree(ds);
182+ ds = NULL;
183+ /*@switchbreak@*/ break;
184+ }
185+ }
186+
187+ fc = rpmfcFree(fc);
188+
189+ ec = 0;
190+
191+exit:
192+ optCon = rpmcliFini(optCon);
193+ return ec;
194+}
diff --git a/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch b/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch
new file mode 100644
index 0000000000..f08bd688f1
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch
@@ -0,0 +1,32 @@
1rpm: compile rpmqv.c instead of rpmqv.cc
2
3Some versions of gcc, 4.4.5 for example, will put a reference to __gxx_personality_v0
4into rpm.o and rpmbuild.o. This means we must link with g++, and the Makefile we
5generate does not.
6
7So, go back to using rpmqv.c (which is currently identical to rpmqv.cc).
8
9Upstream-Status: Inappropriate [other]
10
11 When linking with g++ is really necessary, the upstream package will do that.
12
13Signed-off-by: Joe Slater <joe.slater@windriver.com>
14
15--- a/Makefile.am
16+++ b/Makefile.am
17@@ -127,13 +127,13 @@ rpm_SOURCES = build.c
18 rpm_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
19 rpm_LDADD = rpm.o $(myLDADD)
20 rpm.o: $(top_srcdir)/rpmqv.c
21- $(COMPILE) -DIAM_RPMBT -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c $(top_srcdir)/rpmqv.cc
22+ $(COMPILE) -DIAM_RPMBT -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c $(top_srcdir)/rpmqv.c
23
24 rpmbuild_SOURCES = build.c
25 rpmbuild_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
26 rpmbuild_LDADD = rpmbuild.o $(myLDADD)
27 rpmbuild.o: $(top_srcdir)/rpmqv.c
28- $(COMPILE) -DIAM_RPMBT -o $@ -c $(top_srcdir)/rpmqv.cc
29+ $(COMPILE) -DIAM_RPMBT -o $@ -c $(top_srcdir)/rpmqv.c
30
31 .PHONY: splint
32 splint:
diff --git a/meta/recipes-devtools/rpm/rpm/uclibc-support.patch b/meta/recipes-devtools/rpm/rpm/uclibc-support.patch
new file mode 100644
index 0000000000..8870adb9e7
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/uclibc-support.patch
@@ -0,0 +1,63 @@
1Define the x* wrappers for uclibc as well
2
3Upstream-Status: Pending
4
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6
7Index: rpm-5.4.14/rpmio/rpmio.h
8===================================================================
9--- rpm-5.4.14.orig/rpmio/rpmio.h
10+++ rpm-5.4.14/rpmio/rpmio.h
11@@ -23,7 +23,8 @@
12 */
13 /*@{*/
14 #if !defined(__LCLINT__) && !defined(__UCLIBC__) && defined(__GLIBC__) && \
15- (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))
16+ (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && \
17+ !defined(__UCLIBC__)
18 #define USE_COOKIE_SEEK_POINTER 1
19 typedef _IO_off64_t _libio_off_t;
20 typedef _libio_off_t * _libio_pos_t;
21Index: rpm-5.4.14/system.h
22===================================================================
23--- rpm-5.4.14.orig/system.h
24+++ rpm-5.4.14/system.h
25@@ -481,7 +481,7 @@ extern void muntrace (void)
26 #endif /* defined(__LCLINT__) */
27
28 /* Memory allocation via macro defs to get meaningful locations from mtrace() */
29-#if defined(__GNUC__)
30+#if defined(__GNUC__) || defined(__UCLIBC__)
31 #define xmalloc(_size) (malloc(_size) ? : vmefail(_size))
32 #define xcalloc(_nmemb, _size) (calloc((_nmemb), (_size)) ? : vmefail(_size))
33 #define xrealloc(_ptr, _size) (realloc((_ptr), (_size)) ? : vmefail(_size))
34Index: rpm-5.4.14/lib/librpm.vers
35===================================================================
36--- rpm-5.4.14.orig/lib/librpm.vers
37+++ rpm-5.4.14/lib/librpm.vers
38@@ -405,6 +405,10 @@ LIBRPM_0
39 specedit;
40 strict_erasures;
41 XrpmtsiInit;
42+ xmalloc;
43+ xrealloc;
44+ xcalloc;
45+ xstrdup;
46 local:
47 *;
48 };
49Index: rpm-5.4.14/rpmio/librpmio.vers
50===================================================================
51--- rpm-5.4.14.orig/rpmio/librpmio.vers
52+++ rpm-5.4.14/rpmio/librpmio.vers
53@@ -1056,6 +1056,10 @@ LIBRPMIO_0
54 mongo_write_concern_set_mode;
55 mongo_write_concern_set_w;
56 mongo_write_concern_set_wtimeout;
57+ xmalloc;
58+ xrealloc;
59+ xcalloc;
60+ xstrdup;
61 local:
62 *;
63 };
diff --git a/meta/recipes-devtools/rpm/rpm/verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch b/meta/recipes-devtools/rpm/rpm/verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch
new file mode 100644
index 0000000000..5a70f14f29
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch
@@ -0,0 +1,38 @@
1From 9e7b72ee0c994609975981e135fc18d0387aefb6 Mon Sep 17 00:00:00 2001
2From: jbj <jbj>
3Date: Wed, 14 May 2014 21:19:41 +0000
4Subject: [PATCH] - verify: fix: broken logic for %ghost avoidance (Mark
5 Hatle).
6
7Upstream-status: backport
8
9Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
10---
11 CHANGES | 1 +
12 lib/verify.c | 3 +--
13 2 files changed, 2 insertions(+), 2 deletions(-)
14
15Index: rpm-5.4.14/CHANGES
16===================================================================
17--- rpm-5.4.14.orig/CHANGES
18+++ rpm-5.4.14/CHANGES
19@@ -1,3 +1,5 @@
20+ - jbj: verify: fix: broken logic for %ghost avoidance (Mark Hatle).
21+
22 5.4.13 -> 5.4.14:
23 - mooney: use __sun instead of __sun__ in #define (lp#1243472).
24 - mooney: rpmconstant: ensure linkage w Oracle Studio 12.3 (lp#1243469).
25Index: rpm-5.4.14/lib/verify.c
26===================================================================
27--- rpm-5.4.14.orig/lib/verify.c
28+++ rpm-5.4.14/lib/verify.c
29@@ -588,8 +588,7 @@ uint32_t fc = rpmfiFC(fi);
30 continue;
31
32 /* If not verifying %ghost, skip ghost files. */
33- /* XXX the broken!!! logic disables %ghost queries always. */
34- if (!(FF_ISSET(qva->qva_fflags, GHOST) && FF_ISSET(fflags, GHOST)))
35+ if (!FF_ISSET(qva->qva_fflags, GHOST) && FF_ISSET(fflags, GHOST))
36 continue;
37
38 /* Gather per-file data into a carrier. */