From 972dcfcdbfe75dcfeb777150c136576cf1a71e99 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 9 Oct 2015 22:59:03 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- .../add_RPMSENSE_MISSINGOK_to_rpmmodule.patch | 20 + .../rpm/rpm-4.11.2/disable_shortcircuited.patch | 23 + .../rpm/rpm-4.11.2/fix_libdir.patch | 19 + meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh | 16 + .../rpm/rpm-4.11.2/remove-db3-from-configure.patch | 26 + .../rpm/rpm-4.11.2/remove-dir-check.patch | 23 + .../rpm/rpm-4.11.2/rpm-scriptetexechelp.patch | 194 ++++++++ .../rpm/rpm-4.11.2/support-suggests-tag.patch | 384 +++++++++++++++ .../rpm/rpm-4.11.2/use-pkgconfig-for-python.patch | 38 ++ ...arseArgvString-to-parse-the-_gpg_check_pa.patch | 48 ++ meta/recipes-devtools/rpm/rpm/dbconvert.patch | 27 ++ meta/recipes-devtools/rpm/rpm/debugedit-segv.patch | 98 ++++ ...debugedit-valid-file-to-fix-segment-fault.patch | 65 +++ .../rpm/rpm/fstack-protector-configure-check.patch | 21 + .../rpm/rpm/header-include-fix.patch | 26 + .../rpm/rpm/makefile-am-exec-hook.patch | 33 ++ meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh | 50 ++ .../rpm/rpm/python-rpm-rpmsense.patch | 33 ++ meta/recipes-devtools/rpm/rpm/pythondeps.sh | 16 + .../rpm/rpm/rpm-CVE-2013-6435.patch | 109 +++++ .../rpm/rpm/rpm-CVE-2014-8118.patch | 43 ++ meta/recipes-devtools/rpm/rpm/rpm-autogen.patch | 25 + meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch | 136 ++++++ meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch | 19 + meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch | 162 +++++++ .../rpm/rpm/rpm-db_buffer_small.patch | 77 +++ .../rpm/rpm/rpm-debug-platform.patch | 65 +++ .../rpm/rpm/rpm-disable-Wno-override-init.patch | 32 ++ meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch | 36 ++ .../rpm/rpm/rpm-fix-logio-cp.patch | 30 ++ .../rpm/rpm/rpm-hardlink-segfault-fix.patch | 43 ++ meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch | 22 + .../recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch | 15 + .../rpm/rpm/rpm-lsb-compatibility.patch | 24 + meta/recipes-devtools/rpm/rpm/rpm-lua.patch | 33 ++ meta/recipes-devtools/rpm/rpm/rpm-macros.patch | 64 +++ meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch | 19 + .../rpm/rpm/rpm-no-perl-urpm.patch | 47 ++ meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch | 23 + .../rpm/rpm/rpm-packageorigin.patch | 25 + .../rpm/rpm/rpm-payload-use-hashed-inode.patch | 146 ++++++ .../rpm/rpm/rpm-pkgconfigdeps.patch | 37 ++ .../rpm/rpm/rpm-platform-file-fix.patch | 28 ++ meta/recipes-devtools/rpm/rpm/rpm-platform.patch | 137 ++++++ meta/recipes-devtools/rpm/rpm/rpm-platform2.patch | 105 ++++ meta/recipes-devtools/rpm/rpm/rpm-py-init.patch | 27 ++ meta/recipes-devtools/rpm/rpm/rpm-realpath.patch | 24 + .../rpm/rpm/rpm-reloc-macros.patch | 31 ++ .../rpm/rpm/rpm-remove-sykcparse-decl.patch | 14 + meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch | 40 ++ meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-fix.patch | 67 +++ .../rpm/rpm/rpm-scriptletexechelper.patch | 160 +++++++ meta/recipes-devtools/rpm/rpm/rpm-showrc.patch | 26 + .../rpm-tag-generate-endian-conversion-fix.patch | 50 ++ .../rpm/rpm/rpm-tools-mtree-LDFLAGS.patch | 24 + .../rpm/rpm/rpm-uuid-include.patch | 40 ++ meta/recipes-devtools/rpm/rpm/rpm2cpio | 39 ++ meta/recipes-devtools/rpm/rpm/rpmatch.patch | 42 ++ meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch | 194 ++++++++ .../recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch | 32 ++ meta/recipes-devtools/rpm/rpm/uclibc-support.patch | 63 +++ ...broken-logic-for-ghost-avoidance-Mark-Hat.patch | 38 ++ meta/recipes-devtools/rpm/rpm_4.11.2.bb | 135 ++++++ meta/recipes-devtools/rpm/rpm_5.4+cvs.bb | 529 +++++++++++++++++++++ meta/recipes-devtools/rpm/rpm_5.4.14.bb | 518 ++++++++++++++++++++ meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c | 424 +++++++++++++++++ meta/recipes-devtools/rpm/rpmresolve_1.0.bb | 29 ++ 67 files changed, 5208 insertions(+) create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/add_RPMSENSE_MISSINGOK_to_rpmmodule.patch create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/disable_shortcircuited.patch create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/fix_libdir.patch create mode 100755 meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/remove-db3-from-configure.patch create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/remove-dir-check.patch create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/rpm-scriptetexechelp.patch create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/support-suggests-tag.patch create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/use-pkgconfig-for-python.patch create mode 100644 meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch create mode 100644 meta/recipes-devtools/rpm/rpm/dbconvert.patch create mode 100644 meta/recipes-devtools/rpm/rpm/debugedit-segv.patch create mode 100644 meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch create mode 100644 meta/recipes-devtools/rpm/rpm/fstack-protector-configure-check.patch create mode 100644 meta/recipes-devtools/rpm/rpm/header-include-fix.patch create mode 100644 meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch create mode 100755 meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh create mode 100644 meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch create mode 100755 meta/recipes-devtools/rpm/rpm/pythondeps.sh create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-CVE-2013-6435.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-CVE-2014-8118.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-autogen.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-disable-Wno-override-init.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-lua.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-macros.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-platform.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-platform2.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-py-init.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-realpath.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-remove-sykcparse-decl.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-fix.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-showrc.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch create mode 100755 meta/recipes-devtools/rpm/rpm/rpm2cpio create mode 100644 meta/recipes-devtools/rpm/rpm/rpmatch.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch create mode 100644 meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch create mode 100644 meta/recipes-devtools/rpm/rpm/uclibc-support.patch create mode 100644 meta/recipes-devtools/rpm/rpm/verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch create mode 100644 meta/recipes-devtools/rpm/rpm_4.11.2.bb create mode 100644 meta/recipes-devtools/rpm/rpm_5.4+cvs.bb create mode 100644 meta/recipes-devtools/rpm/rpm_5.4.14.bb create mode 100644 meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c create mode 100644 meta/recipes-devtools/rpm/rpmresolve_1.0.bb (limited to 'meta/recipes-devtools/rpm') diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/add_RPMSENSE_MISSINGOK_to_rpmmodule.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/add_RPMSENSE_MISSINGOK_to_rpmmodule.patch new file mode 100644 index 0000000000..b877870411 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/add_RPMSENSE_MISSINGOK_to_rpmmodule.patch @@ -0,0 +1,20 @@ +Upstream-Status: Inappropriate [OE-Specific] + +Signed-off-by: Saul Wold +Signed-off-by: Ronan Le Martret + +diff --git a/python/rpmmodule.c b/python/rpmmodule.c +index a4fe217..728c66c 100644 +--- a/python/rpmmodule.c ++++ b/python/rpmmodule.c +@@ -396,6 +396,10 @@ static int initModule(PyObject *m) + REGISTER_ENUM(RPMSENSE_STRONG); + REGISTER_ENUM(RPMSENSE_CONFIG); + ++#if defined(RPM_VENDOR_OE) ++ REGISTER_ENUM(RPMSENSE_MISSINGOK); ++#endif ++ + REGISTER_ENUM(RPMTRANS_FLAG_TEST); + REGISTER_ENUM(RPMTRANS_FLAG_BUILD_PROBS); + REGISTER_ENUM(RPMTRANS_FLAG_NOSCRIPTS); diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/disable_shortcircuited.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/disable_shortcircuited.patch new file mode 100644 index 0000000000..7a646de373 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/disable_shortcircuited.patch @@ -0,0 +1,23 @@ +Upstream-Status: Pending + +Signed-off-by: Saul Wold +Signed-off-by: Ronan Le Martret + + +Index: rpm-4.11.2/build/pack.c +=================================================================== +--- rpm-4.11.2.orig/build/pack.c ++++ rpm-4.11.2/build/pack.c +@@ -571,9 +571,9 @@ rpmRC packageBinaries(rpmSpec spec, cons + headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16); + } + +- if (cheating) { +- (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1"); +- } ++// if (cheating) { ++// (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1"); ++// } + + { char *binFormat = rpmGetPath("%{_rpmfilename}", NULL); + char *binRpm, *binDir; diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/fix_libdir.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/fix_libdir.patch new file mode 100644 index 0000000000..be0626c8b3 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/fix_libdir.patch @@ -0,0 +1,19 @@ +Upstream-Status: Inappropriate [OE-Core specific] + +Signed-off-by: Saul Wold +Signed-off-by: Ronan Le Martret + + +diff --git a/installplatform b/installplatform +index 8c3eba0..fa15e91 100755 +--- a/installplatform ++++ b/installplatform +@@ -112,7 +112,7 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do + [ -z "$CANONARCH" ] && continue + + if [ "$OS" = "linux" ] && [ "$CANONCOLOR" = 3 ]; then +- LIB=${LIB}64 ++ LIB=${LIB} + fi + + PPD="${DESTDIR}/${platformdir}/${ARCH}-${OS}" diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh b/meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh new file mode 100755 index 0000000000..083b174f17 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +[ $# -ge 1 ] || { + cat > /dev/null + exit 0 +} + +case $1 in +-R|--requires) + shift + grep "/usr/\(lib[^/]*\|share\)/python[^/]*/" >/dev/null && echo "python" + exit 0 + ;; +esac + +exit 0 diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/remove-db3-from-configure.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/remove-db3-from-configure.patch new file mode 100644 index 0000000000..2640e54b5b --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/remove-db3-from-configure.patch @@ -0,0 +1,26 @@ + +Disable configuring the db3 directory since we will be using the +external DB provided as part of OE-Core already, no need to have +duplicate database code. + +Upstream-Status: Inappropriate [OE-Core Specific] + +Signed-off-by: Saul Wold + +Index: rpm-4.11.2/configure.ac +=================================================================== +--- rpm-4.11.2.orig/configure.ac ++++ rpm-4.11.2/configure.ac +@@ -825,9 +825,9 @@ AC_SUBST(RPMCONFIGDIR) + + AC_SUBST(OBJDUMP) + +-if test "$with_external_db" = no; then +- AC_CONFIG_SUBDIRS(db3) +-fi ++#if test "$with_external_db" = no; then ++# AC_CONFIG_SUBDIRS(db3) ++#fi + + AM_CONDITIONAL([WITH_INTERNAL_DB],[test "$with_external_db" = no]) + AM_CONDITIONAL([DOXYGEN],[test "$DOXYGEN" != no]) diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/remove-dir-check.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/remove-dir-check.patch new file mode 100644 index 0000000000..f1ecab7b0e --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/remove-dir-check.patch @@ -0,0 +1,23 @@ +Upstream-Status: Pending + +Signed-off-by: Saul Wold +Signed-off-by: Ronan Le Martret + + +Index: rpm-4.11.2/build/files.c +=================================================================== +--- rpm-4.11.2.orig/build/files.c ++++ rpm-4.11.2/build/files.c +@@ -1321,12 +1321,6 @@ static rpmRC addFile(FileList fl, const + } + } + +- /* Error out when a non-directory is specified as one in spec */ +- if (fl->cur.isDir && (statp == &statbuf) && !S_ISDIR(statp->st_mode)) { +- rpmlog(RPMLOG_ERR, _("Not a directory: %s\n"), diskPath); +- goto exit; +- } +- + /* Don't recurse into explicit %dir, don't double-recurse from fts */ + if ((fl->cur.isDir != 1) && (statp == &statbuf) && S_ISDIR(statp->st_mode)) { + return recurseDir(fl, diskPath); diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/rpm-scriptetexechelp.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/rpm-scriptetexechelp.patch new file mode 100644 index 0000000000..9333dea441 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/rpm-scriptetexechelp.patch @@ -0,0 +1,194 @@ +Upstream-Status: Inappropriate [OE-Core] + +Signed-off-by: Saul Wold +Signed-off-by: Ronan Le Martret + + +Index: rpm-4.11.2/lib/psm.c +=================================================================== +--- rpm-4.11.2.orig/lib/psm.c ++++ rpm-4.11.2/lib/psm.c +@@ -421,7 +421,8 @@ static rpmRC runScript(rpmpsm psm, ARGV_ + + rpmswEnter(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0); + rc = rpmScriptRun(script, arg1, arg2, sfd, +- prefixes, warn_only, selinux); ++ prefixes, warn_only, selinux, rpmtsRootDir(psm->ts) ); ++ + rpmswExit(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0); + + /* Map warn-only errors to "notfound" for script stop callback */ +@@ -958,15 +959,49 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg + case PSM_DESTROY: + break; + case PSM_SCRIPT: /* Run current package scriptlets. */ ++#ifdef RPM_VENDOR_OE ++ { ++ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); ++ if (scriptletWrapper && *scriptletWrapper) ++ (void) rpmChrootOut(); ++#endif ++ + rc = runInstScript(psm); ++#ifdef RPM_VENDOR_OE ++ if (scriptletWrapper && *scriptletWrapper) ++ (void) rpmChrootIn(); ++ } ++#endif + break; + case PSM_TRIGGERS: + /* Run triggers in other package(s) this package sets off. */ ++#ifdef RPM_VENDOR_OE ++ { ++ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); ++ if (scriptletWrapper && *scriptletWrapper) ++ (void) rpmChrootOut(); ++#endif + rc = runTriggers(psm); ++#ifdef RPM_VENDOR_OE ++ if (scriptletWrapper && *scriptletWrapper) ++ (void) rpmChrootIn(); ++ } ++#endif + break; + case PSM_IMMED_TRIGGERS: + /* Run triggers in this package other package(s) set off. */ ++#ifdef RPM_VENDOR_OE ++ { ++ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); ++ if (scriptletWrapper && *scriptletWrapper) ++ (void) rpmChrootOut(); ++#endif + rc = runImmedTriggers(psm); ++#ifdef RPM_VENDOR_OE ++ if (scriptletWrapper && *scriptletWrapper) ++ (void) rpmChrootIn(); ++ } ++#endif + break; + + case PSM_RPMDB_ADD: { +Index: rpm-4.11.2/lib/rpmscript.c +=================================================================== +--- rpm-4.11.2.orig/lib/rpmscript.c ++++ rpm-4.11.2/lib/rpmscript.c +@@ -92,7 +92,7 @@ static rpmRC runLuaScript(int selinux, A + static const char * const SCRIPT_PATH = "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin"; + + static void doScriptExec(int selinux, ARGV_const_t argv, ARGV_const_t prefixes, +- FD_t scriptFd, FD_t out) ++ FD_t scriptFd, FD_t out, char * rootDir ) + { + int pipes[2]; + int flag; +@@ -158,13 +158,12 @@ static void doScriptExec(int selinux, AR + setenv("RPM_INSTALL_PREFIX", *pf, 1); + } + } +- +- if (chdir("/") == 0) { ++ if (chdir(rootDir) == 0) { + /* XXX Don't mtrace into children. */ + unsetenv("MALLOC_CHECK_"); + + /* Permit libselinux to do the scriptlet exec. */ +- if (selinux == 1) { ++ if (selinux == 1) { + xx = rpm_execcon(0, argv[0], argv, environ); + } + +@@ -175,12 +174,12 @@ static void doScriptExec(int selinux, AR + _exit(127); /* exit 127 for compatibility with bash(1) */ + } + +-static char * writeScript(const char *cmd, const char *script) ++static char * writeScript(const char *cmd, const char *script, char * rootDir) + { + char *fn = NULL; + size_t slen = strlen(script); + int ok = 0; +- FD_t fd = rpmMkTempFile("/", &fn); ++ FD_t fd = rpmMkTempFile(rootDir, &fn); + + if (Ferror(fd)) + goto exit; +@@ -204,7 +203,7 @@ exit: + */ + static rpmRC runExtScript(int selinux, ARGV_const_t prefixes, + const char *sname, rpmlogLvl lvl, FD_t scriptFd, +- ARGV_t * argvp, const char *script, int arg1, int arg2) ++ ARGV_t * argvp, const char *script, int arg1, int arg2,char * rootDir) + { + FD_t out = NULL; + char * fn = NULL; +@@ -215,7 +214,7 @@ static rpmRC runExtScript(int selinux, A + rpmlog(RPMLOG_DEBUG, "%s: scriptlet start\n", sname); + + if (script) { +- fn = writeScript(*argvp[0], script); ++ fn = writeScript(*argvp[0], script, rootDir); + if (fn == NULL) { + rpmlog(RPMLOG_ERR, + _("Couldn't create temporary file for %s: %s\n"), +@@ -258,7 +257,7 @@ static rpmRC runExtScript(int selinux, A + } else if (pid == 0) {/* Child */ + rpmlog(RPMLOG_DEBUG, "%s: execv(%s) pid %d\n", + sname, *argvp[0], (unsigned)getpid()); +- doScriptExec(selinux, *argvp, prefixes, scriptFd, out); ++ doScriptExec(selinux, *argvp, prefixes, scriptFd, out, rootDir); + } + + do { +@@ -297,13 +296,27 @@ exit: + } + + rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd, +- ARGV_const_t prefixes, int warn_only, int selinux) ++ ARGV_const_t prefixes, int warn_only, int selinux, char * rootDir) + { + ARGV_t args = NULL; + rpmlogLvl lvl = warn_only ? RPMLOG_WARNING : RPMLOG_ERR; + rpmRC rc; +- +- if (script == NULL) return RPMRC_OK; ++#ifdef RPM_VENDOR_OE ++ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); ++#endif ++ ++ if (script == NULL) return RPMRC_OK; ++#ifdef RPM_VENDOR_OE ++ if (scriptletWrapper && *scriptletWrapper) { ++ argvAdd(&args, scriptletWrapper); ++ ++ if ( rootDir ) { ++ argvAdd(&args, rootDir); ++ } else { ++ argvAdd(&args, "/"); ++ } ++ } ++#endif + + /* construct a new argv as we can't modify the one from header */ + if (script->args) { +@@ -315,7 +328,7 @@ rpmRC rpmScriptRun(rpmScript script, int + if (rstreq(args[0], "")) { + rc = runLuaScript(selinux, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2); + } else { +- rc = runExtScript(selinux, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2); ++ rc = runExtScript(selinux, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, rootDir); + } + argvFree(args); + +Index: rpm-4.11.2/lib/rpmscript.h +=================================================================== +--- rpm-4.11.2.orig/lib/rpmscript.h ++++ rpm-4.11.2/lib/rpmscript.h +@@ -29,7 +29,7 @@ rpmScript rpmScriptFree(rpmScript script + + RPM_GNUC_INTERNAL + rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd, +- ARGV_const_t prefixes, int warn_only, int selinux); ++ ARGV_const_t prefixes, int warn_only, int selinux, char * rootDir); + + RPM_GNUC_INTERNAL + rpmTagVal rpmScriptTag(rpmScript script); diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/support-suggests-tag.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/support-suggests-tag.patch new file mode 100644 index 0000000000..3da608573a --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/support-suggests-tag.patch @@ -0,0 +1,384 @@ + +Upstream-Status: Pending + +Signed-off-by: Saul Wold +Signed-off-by: Ronan Le Martret + +diff --git a/build/pack.c b/build/pack.c +index b6b2bea..5c3d8df 100644 +--- a/build/pack.c ++++ b/build/pack.c +@@ -273,8 +273,10 @@ static rpmTagVal depevrtags[] = { + RPMTAG_CONFLICTVERSION, + RPMTAG_ORDERVERSION, + RPMTAG_TRIGGERVERSION, +- RPMTAG_SUGGESTSVERSION, +- RPMTAG_ENHANCESVERSION, ++ RPMTAG_SUGGESTVERSION, ++ RPMTAG_ENHANCEVERSION, ++ RPMTAG_RECOMMENDVERSION, ++ RPMTAG_SUPPLEMENTVERSION, + 0 + }; + +diff --git a/build/parsePreamble.c b/build/parsePreamble.c +index 5772bef..cbbbee3 100644 +--- a/build/parsePreamble.c ++++ b/build/parsePreamble.c +@@ -821,6 +821,10 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, + } + /* fallthrough */ + case RPMTAG_PREREQ: ++ case RPMTAG_RECOMMENDFLAGS: ++ case RPMTAG_SUGGESTFLAGS: ++ case RPMTAG_SUPPLEMENTFLAGS: ++ case RPMTAG_ENHANCEFLAGS: + case RPMTAG_CONFLICTFLAGS: + case RPMTAG_OBSOLETEFLAGS: + case RPMTAG_PROVIDEFLAGS: +@@ -922,6 +926,10 @@ static struct PreambleRec_s const preambleList[] = { + {RPMTAG_ICON, 0, 0, LEN_AND_STR("icon")}, + {RPMTAG_PROVIDEFLAGS, 0, 0, LEN_AND_STR("provides")}, + {RPMTAG_REQUIREFLAGS, 2, 0, LEN_AND_STR("requires")}, ++ {RPMTAG_RECOMMENDFLAGS, 0, 0, LEN_AND_STR("recommends")}, ++ {RPMTAG_SUGGESTFLAGS, 0, 0, LEN_AND_STR("suggests")}, ++ {RPMTAG_SUPPLEMENTFLAGS, 0, 0, LEN_AND_STR("supplements")}, ++ {RPMTAG_ENHANCEFLAGS, 0, 0, LEN_AND_STR("enhances")}, + {RPMTAG_PREREQ, 2, 1, LEN_AND_STR("prereq")}, + {RPMTAG_CONFLICTFLAGS, 0, 0, LEN_AND_STR("conflicts")}, + {RPMTAG_OBSOLETEFLAGS, 0, 0, LEN_AND_STR("obsoletes")}, +diff --git a/build/parseReqs.c b/build/parseReqs.c +index ba080a1..1427111 100644 +--- a/build/parseReqs.c ++++ b/build/parseReqs.c +@@ -61,6 +61,18 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTagVal tagN, + nametag = RPMTAG_REQUIRENAME; + tagflags |= RPMSENSE_ANY; + break; ++ case RPMTAG_RECOMMENDFLAGS: ++ nametag = RPMTAG_RECOMMENDNAME; ++ break; ++ case RPMTAG_SUGGESTFLAGS: ++ nametag = RPMTAG_SUGGESTNAME; ++ break; ++ case RPMTAG_SUPPLEMENTFLAGS: ++ nametag = RPMTAG_SUPPLEMENTNAME; ++ break; ++ case RPMTAG_ENHANCEFLAGS: ++ nametag = RPMTAG_ENHANCENAME; ++ break; + case RPMTAG_PROVIDEFLAGS: + nametag = RPMTAG_PROVIDENAME; + break; +diff --git a/build/reqprov.c b/build/reqprov.c +index a368f42..c270af6 100644 +--- a/build/reqprov.c ++++ b/build/reqprov.c +@@ -81,6 +81,30 @@ int addReqProv(Package pkg, rpmTagVal tagN, + extra = Flags & RPMSENSE_TRIGGER; + dsp = &pkg->triggers; + break; ++ case RPMTAG_RECOMMENDNAME: ++ versiontag = RPMTAG_RECOMMENDVERSION; ++ flagtag = RPMTAG_RECOMMENDFLAGS; ++ extra = Flags & _ALL_REQUIRES_MASK; ++ dsp = &pkg->recommends; ++ break; ++ case RPMTAG_SUGGESTNAME: ++ versiontag = RPMTAG_SUGGESTVERSION; ++ flagtag = RPMTAG_SUGGESTFLAGS; ++ extra = Flags & _ALL_REQUIRES_MASK; ++ dsp = &pkg->suggests; ++ break; ++ case RPMTAG_SUPPLEMENTNAME: ++ versiontag = RPMTAG_SUPPLEMENTVERSION; ++ flagtag = RPMTAG_SUPPLEMENTFLAGS; ++ extra = Flags & _ALL_REQUIRES_MASK; ++ dsp = &pkg->supplements; ++ break; ++ case RPMTAG_ENHANCENAME: ++ versiontag = RPMTAG_ENHANCEVERSION; ++ flagtag = RPMTAG_ENHANCEFLAGS; ++ extra = Flags & _ALL_REQUIRES_MASK; ++ dsp = &pkg->enhances; ++ break; + case RPMTAG_REQUIRENAME: + default: + tagN = RPMTAG_REQUIRENAME; +diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h +index a9e4c7c..0a1977f 100644 +--- a/build/rpmbuild_internal.h ++++ b/build/rpmbuild_internal.h +@@ -93,6 +93,10 @@ struct Package_s { + rpmds ds; /*!< Requires: N = EVR */ + rpmds requires; + rpmds provides; ++ rpmds recommends; ++ rpmds suggests; ++ rpmds supplements; ++ rpmds enhances; + rpmds conflicts; + rpmds obsoletes; + rpmds triggers; +diff --git a/build/spec.c b/build/spec.c +index 703ec78..7ae2120 100644 +--- a/build/spec.c ++++ b/build/spec.c +@@ -139,6 +139,11 @@ static Package freePackage(Package pkg) + pkg->ds = rpmdsFree(pkg->ds); + pkg->requires = rpmdsFree(pkg->requires); + pkg->provides = rpmdsFree(pkg->provides); ++ pkg->recommends = rpmdsFree(pkg->recommends); ++ pkg->suggests = rpmdsFree(pkg->suggests); ++ pkg->supplements = rpmdsFree(pkg->supplements); ++ pkg->enhances = rpmdsFree(pkg->enhances); ++ + pkg->conflicts = rpmdsFree(pkg->conflicts); + pkg->obsoletes = rpmdsFree(pkg->obsoletes); + pkg->triggers = rpmdsFree(pkg->triggers); +diff --git a/lib/rpmds.c b/lib/rpmds.c +index 7a51167..1e5dda0 100644 +--- a/lib/rpmds.c ++++ b/lib/rpmds.c +@@ -52,6 +52,22 @@ static int dsType(rpmTagVal tag, + t = "Requires"; + evr = RPMTAG_REQUIREVERSION; + f = RPMTAG_REQUIREFLAGS; ++ } else if (tag == RPMTAG_SUPPLEMENTNAME) { ++ t = "Supplements"; ++ evr = RPMTAG_SUPPLEMENTVERSION; ++ f = RPMTAG_SUPPLEMENTFLAGS; ++ } else if (tag == RPMTAG_ENHANCENAME) { ++ t = "Enhances"; ++ evr = RPMTAG_ENHANCEVERSION; ++ f = RPMTAG_ENHANCEFLAGS; ++ } else if (tag == RPMTAG_RECOMMENDNAME) { ++ t = "Recommends"; ++ evr = RPMTAG_RECOMMENDVERSION; ++ f = RPMTAG_RECOMMENDFLAGS; ++ } else if (tag == RPMTAG_SUGGESTNAME) { ++ t = "Suggests"; ++ evr = RPMTAG_SUGGESTVERSION; ++ f = RPMTAG_SUGGESTFLAGS; + } else if (tag == RPMTAG_CONFLICTNAME) { + t = "Conflicts"; + evr = RPMTAG_CONFLICTVERSION; +diff --git a/lib/rpmtag.h b/lib/rpmtag.h +index 64b03f1..b943229 100644 +--- a/lib/rpmtag.h ++++ b/lib/rpmtag.h +@@ -217,14 +217,14 @@ typedef enum rpmTag_e { + RPMTAG_PRETRANSPROG = 1153, /* s[] */ + RPMTAG_POSTTRANSPROG = 1154, /* s[] */ + RPMTAG_DISTTAG = 1155, /* s */ +- RPMTAG_SUGGESTSNAME = 1156, /* s[] extension (unimplemented) */ +-#define RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME /* s[] (unimplemented) */ +- RPMTAG_SUGGESTSVERSION = 1157, /* s[] extension (unimplemented) */ +- RPMTAG_SUGGESTSFLAGS = 1158, /* i[] extension (unimplemented) */ +- RPMTAG_ENHANCESNAME = 1159, /* s[] extension placeholder (unimplemented) */ +-#define RPMTAG_ENHANCES RPMTAG_ENHANCESNAME /* s[] (unimplemented) */ +- RPMTAG_ENHANCESVERSION = 1160, /* s[] extension placeholder (unimplemented) */ +- RPMTAG_ENHANCESFLAGS = 1161, /* i[] extension placeholder (unimplemented) */ ++ RPMTAG_OLDSUGGESTSNAME = 1156, /* s[] (unimplemented) */ ++#define RPMTAG_OLDSUGGESTS RPMTAG_OLDSUGGESTSNAME /* s[] (unimplemented) */ ++ RPMTAG_OLDSUGGESTSVERSION = 1157, /* s[] (unimplemented) */ ++ RPMTAG_OLDSUGGESTSFLAGS = 1158, /* i[] (unimplemented) */ ++ RPMTAG_OLDENHANCESNAME = 1159, /* s[] (unimplemented) */ ++#define RPMTAG_OLDENHANCES RPMTAG_OLDENHANCESNAME /* s[] (unimplemented) */ ++ RPMTAG_OLDENHANCESVERSION = 1160, /* s[] (unimplemented) */ ++ RPMTAG_OLDENHANCESFLAGS = 1161, /* i[] (unimplemented) */ + RPMTAG_PRIORITY = 1162, /* i[] extension placeholder (unimplemented) */ + RPMTAG_CVSID = 1163, /* s (unimplemented) */ + #define RPMTAG_SVNID RPMTAG_CVSID /* s (unimplemented) */ +@@ -261,6 +261,7 @@ typedef enum rpmTag_e { + RPMTAG_BUILDOBSOLETES = 1194, /* internal (unimplemented) */ + RPMTAG_DBINSTANCE = 1195, /* i extension */ + RPMTAG_NVRA = 1196, /* s extension */ ++ + /* tags 1997-4999 reserved */ + RPMTAG_FILENAMES = 5000, /* s[] extension */ + RPMTAG_FILEPROVIDE = 5001, /* s[] extension */ +@@ -307,6 +308,26 @@ typedef enum rpmTag_e { + RPMTAG_OBSOLETENEVRS = 5043, /* s[] extension */ + RPMTAG_CONFLICTNEVRS = 5044, /* s[] extension */ + RPMTAG_FILENLINKS = 5045, /* i[] extension */ ++ RPMTAG_RECOMMENDNAME = 5046, /* s[] */ ++#define RPMTAG_RECOMMENDS RPMTAG_RECOMMENDNAME /* s[] */ ++ RPMTAG_RECOMMENDVERSION = 5047, /* s[] */ ++ RPMTAG_RECOMMENDFLAGS = 5048, /* i[] */ ++ RPMTAG_SUGGESTNAME = 5049, /* s[] */ ++#define RPMTAG_SUGGESTS RPMTAG_SUGGESTNAME /* s[] */ ++ RPMTAG_SUGGESTVERSION = 5050, /* s[] extension */ ++ RPMTAG_SUGGESTFLAGS = 5051, /* i[] extension */ ++ RPMTAG_SUPPLEMENTNAME = 5052, /* s[] */ ++#define RPMTAG_SUPPLEMENTS RPMTAG_SUPPLEMENTNAME /* s[] */ ++ RPMTAG_SUPPLEMENTVERSION = 5053, /* s[] */ ++ RPMTAG_SUPPLEMENTFLAGS = 5054, /* i[] */ ++ RPMTAG_ENHANCENAME = 5055, /* s[] */ ++#define RPMTAG_ENHANCES RPMTAG_ENHANCENAME /* s[] */ ++ RPMTAG_ENHANCEVERSION = 5056, /* s[] */ ++ RPMTAG_ENHANCEFLAGS = 5057, /* i[] */ ++ RPMTAG_RECOMMENDNEVRS = 5058, /* s[] extension */ ++ RPMTAG_SUGGESTNEVRS = 5059, /* s[] extension */ ++ RPMTAG_SUPPLEMENTNEVRS = 5060, /* s[] extension */ ++ RPMTAG_ENHANCENEVRS = 5061, /* s[] extension */ + + RPMTAG_FIRSTFREE_TAG /*!< internal */ + } rpmTag; +diff --git a/lib/tagexts.c b/lib/tagexts.c +index 29b2bae..e940310 100644 +--- a/lib/tagexts.c ++++ b/lib/tagexts.c +@@ -761,6 +761,26 @@ static int requirenevrsTag(Header h, rpmtd td, headerGetFlags hgflags) + return depnevrsTag(h, td, hgflags, RPMTAG_REQUIRENAME); + } + ++static int recommendnevrsTag(Header h, rpmtd td, headerGetFlags hgflags) ++{ ++ return depnevrsTag(h, td, hgflags, RPMTAG_RECOMMENDNAME); ++} ++ ++static int suggestnevrsTag(Header h, rpmtd td, headerGetFlags hgflags) ++{ ++ return depnevrsTag(h, td, hgflags, RPMTAG_SUGGESTNAME); ++} ++ ++static int supplementnevrsTag(Header h, rpmtd td, headerGetFlags hgflags) ++{ ++ return depnevrsTag(h, td, hgflags, RPMTAG_SUPPLEMENTNAME); ++} ++ ++static int enhancenevrsTag(Header h, rpmtd td, headerGetFlags hgflags) ++{ ++ return depnevrsTag(h, td, hgflags, RPMTAG_ENHANCENAME); ++} ++ + static int providenevrsTag(Header h, rpmtd td, headerGetFlags hgflags) + { + return depnevrsTag(h, td, hgflags, RPMTAG_PROVIDENAME); +@@ -823,6 +843,10 @@ static const struct headerTagFunc_s rpmHeaderTagExtensions[] = { + { RPMTAG_EPOCHNUM, epochnumTag }, + { RPMTAG_INSTFILENAMES, instfilenamesTag }, + { RPMTAG_REQUIRENEVRS, requirenevrsTag }, ++ { RPMTAG_RECOMMENDNEVRS, recommendnevrsTag}, ++ { RPMTAG_SUGGESTNEVRS, suggestnevrsTag}, ++ { RPMTAG_SUPPLEMENTNEVRS, supplementnevrsTag}, ++ { RPMTAG_ENHANCENEVRS, enhancenevrsTag}, + { RPMTAG_PROVIDENEVRS, providenevrsTag }, + { RPMTAG_OBSOLETENEVRS, obsoletenevrsTag }, + { RPMTAG_CONFLICTNEVRS, conflictnevrsTag }, +diff --git a/rpmpopt.in b/rpmpopt.in +index 805599e..036ab4e 100644 +--- a/rpmpopt.in ++++ b/rpmpopt.in +@@ -67,6 +67,19 @@ rpm alias --requires --qf \ + --POPTdesc=$"list capabilities required by package(s)" + rpm alias -R --requires + ++rpm alias --recommends --qf \ ++ "[%|VERBOSE?{%{RECOMMENDFLAGS:deptype}: }:{}|%{RECOMMENDNEVRS}\n]" \ ++ --POPTdesc=$"list capabilities recommended by package(s)" ++rpm alias --suggests --qf \ ++ "[%|VERBOSE?{%{SUGGESTFLAGS:deptype}: }:{}|%{SUGGESTNEVRS}\n]" \ ++ --POPTdesc=$"list capabilities suggested by package(s)" ++rpm alias --supplements --qf \ ++ "[%|VERBOSE?{%{SUPPLEMENTFLAGS:deptype}: }:{}|%{SUPPLEMENTNEVRS}\n]" \ ++ --POPTdesc=$"list capabilities supplemented by package(s)" ++rpm alias --enhances --qf \ ++ "[%|VERBOSE?{%{ENHANCEFLAGS:deptype}: }:{}|%{ENHANCENEVRS}\n]" \ ++ --POPTdesc=$"list capabilities enhanced by package(s)" ++ + rpm alias --info --qf '\ + Name : %{NAME}\n\ + %|EPOCH?{Epoch : %{EPOCH}\n}|\ +diff --git a/tests/data/SPECS/deptest.spec b/tests/data/SPECS/deptest.spec +index cb4cbbd..7c47f6d 100644 +--- a/tests/data/SPECS/deptest.spec ++++ b/tests/data/SPECS/deptest.spec +@@ -10,6 +10,10 @@ BuildArch: noarch + %{?provs:Provides: %{provs}} + %{?cfls:Conflicts: %{cfls}} + %{?obs:Obsoletes: %{obs}} ++%{?recs:Recommends: %{recs}} ++%{?sugs:Suggests: %{sugs}} ++%{?sups:Supplements: %{sups}} ++%{?ens:Enhances: %{ens}} + + %description + %{summary} +diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at +index 6230903..c4c954c 100644 +--- a/tests/rpmbuild.at ++++ b/tests/rpmbuild.at +@@ -185,3 +185,25 @@ lrwxrwxrwx /opt/globtest/linkgood + ], + []) + AT_CLEANUP ++ ++# ------------------------------ ++# Check if weak and reverse requires can be built ++AT_SETUP([Weak and reverse requires]) ++AT_KEYWORDS([build]) ++AT_CHECK([ ++ ++runroot rpmbuild -bb --quiet \ ++ --define "pkg weakdeps" \ ++ --define "recs foo > 1.2.3" \ ++ --define "sugs bar >= 0.1.2" \ ++ --define "sups baz" \ ++ --define "ens zap = 3" \ ++ /data/SPECS/deptest.spec ++ ++runroot rpm -qp --qf "[%{supplementname}\n]" /build/RPMS/noarch/deptest-weakdeps-1.0-1.noarch.rpm ++], ++[0], ++[baz ++], ++[ignore]) ++AT_CLEANUP +diff --git a/tests/rpmgeneral.at b/tests/rpmgeneral.at +index 13131e2..80cca63 100644 +--- a/tests/rpmgeneral.at ++++ b/tests/rpmgeneral.at +@@ -79,6 +79,11 @@ DISTTAG + DISTURL + DSAHEADER + E ++ENHANCEFLAGS ++ENHANCENAME ++ENHANCENEVRS ++ENHANCES ++ENHANCEVERSION + EPOCH + EPOCHNUM + EVR +@@ -199,6 +204,11 @@ PROVIDES + PROVIDEVERSION + PUBKEYS + R ++RECOMMENDFLAGS ++RECOMMENDNAME ++RECOMMENDNEVRS ++RECOMMENDS ++RECOMMENDVERSION + RECONTEXTS + RELEASE + REMOVETID +@@ -219,7 +229,17 @@ SOURCE + SOURCEPACKAGE + SOURCEPKGID + SOURCERPM ++SUGGESTFLAGS ++SUGGESTNAME ++SUGGESTNEVRS ++SUGGESTS ++SUGGESTVERSION + SUMMARY ++SUPPLEMENTFLAGS ++SUPPLEMENTNAME ++SUPPLEMENTNEVRS ++SUPPLEMENTS ++SUPPLEMENTVERSION + TRIGGERCONDS + TRIGGERFLAGS + TRIGGERINDEX diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/use-pkgconfig-for-python.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/use-pkgconfig-for-python.patch new file mode 100644 index 0000000000..8d84cf8a11 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm-4.11.2/use-pkgconfig-for-python.patch @@ -0,0 +1,38 @@ + +Use pkgconfig to get the correct include paths + +Upstream-Status: Pending + +Signed-off-by: Saul Wold +Signed-off-by: Ronan Le Martret + +diff --git a/configure.ac b/configure.ac +index e97f727..8179f44 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -540,10 +540,10 @@ esac], + + AS_IF([test "$enable_python" = yes],[ + AM_PATH_PYTHON([2.6],[ +- WITH_PYTHON_INCLUDE=`${PYTHON} -c 'from distutils.sysconfig import *; import sys; sys.stdout.write(get_python_inc())'` ++ WITH_PYTHON_INCLUDE=$(${PKG_CONFIG} --cflags-only-I python) + WITH_PYTHON_SUBPACKAGE=1 + save_CPPFLAGS="$CPPFLAGS" +- CPPFLAGS="$CPPFLAGS -I$WITH_PYTHON_INCLUDE" ++ CPPFLAGS="$CPPFLAGS $WITH_PYTHON_INCLUDE" + AC_CHECK_HEADER([Python.h],[], + [AC_MSG_ERROR([missing Python.h]) + ]) +diff --git a/python/Makefile.am b/python/Makefile.am +index fff51ae..f37cb9d 100644 +--- a/python/Makefile.am ++++ b/python/Makefile.am +@@ -4,7 +4,7 @@ EXTRA_DIST = rpm/__init__.py rpm/transaction.py + + AM_CPPFLAGS = -I$(top_builddir)/include/ + AM_CPPFLAGS += -I$(top_srcdir)/python +-AM_CPPFLAGS += -I@WITH_PYTHON_INCLUDE@ ++AM_CPPFLAGS += @WITH_PYTHON_INCLUDE@ + + pkgpyexec_LTLIBRARIES = _rpmmodule.la _rpmbmodule.la _rpmsmodule.la + pkgpyexec_DATA = rpm/__init__.py rpm/transaction.py 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 @@ +From 64851c6622aff64787a9fcea26cccde183b7c743 Mon Sep 17 00:00:00 2001 +From: "Roy.Li" +Date: Tue, 11 Nov 2014 16:28:22 +0800 +Subject: [PATCH] using poptParseArgvString to parse the + _gpg_check_password_cmd + +Upstream-Status: Pending + +Both __gpg_check_password_cmd and __gpg_sign_cmd include "%{_gpg_name}", but +strace shows that gpg_name has a quote when run _gpg_check_password, +but not when run __gpg_sign_cmd; for example, if gpg_name is "tester" + + execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose", + "--passphrase-fd", "3", "-u", "\"tester\"", "-so", "-"], [/* 20 vars */]) = 0 + + execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose", "--no-armor", + "--passphrase-fd", "3", "--no-secmem-warning", "-u", "tester", "-sbo"..,) = 0 + +it can be fixed by removing the quote around %{gpg_name} when define +__gpg_check_password_cmd in macros/macros, like below, but if gpg_name includes +space, it will not work. + + %__gpg_check_password_cmd %{__gpg} \ + gpg --batch --no-verbose --passphrase-fd 3 -u %{_gpg_name} -so - + +The poptParseArgvString function is used to parse _gpg_sign_cmd, so using +poptParseArgvString to parse __gpg_check_password_cmd to fix this issue. + +Signed-off-by: Roy.Li +--- + rpmdb/signature.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rpmdb/signature.c b/rpmdb/signature.c +index c35e0ab..016e8d1 100644 +--- a/rpmdb/signature.c ++++ b/rpmdb/signature.c +@@ -529,7 +529,7 @@ int rpmCheckPassPhrase(const char * passPhrase) + (void) setenv("GNUPGHOME", gpg_path, 1); + + cmd = rpmExpand("%{?__gpg_check_password_cmd}", NULL); +- rc = argvSplit(&av, cmd, NULL); ++ rc = poptParseArgvString(cmd, NULL, (const char ***)&av); + if (!rc) + rc = execve(av[0], (char *const *)av+1, environ); + +-- +1.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 @@ +Upstream-Status: Not applicable + +Hack to prevent unneeded demo app from building on older libc +where it will break the build + +Index: rpm-5.4.14/tools/Makefile.am +=================================================================== +--- rpm-5.4.14.orig/tools/Makefile.am ++++ rpm-5.4.14/tools/Makefile.am +@@ -29,7 +29,7 @@ EXTRA_PROGRAMS = nix-copy-closure nix-en + xiu-instantiate xiu-store + noinst_PROGRAMS = + +-EXTRA_PROGRAMS += augtool cudftool dbconvert debugedit \ ++EXTRA_PROGRAMS += augtool cudftool debugedit \ + nix-build nix-channel nix-collect-garbage \ + nix-log2xml nix-prefetch-url nix-pull nix-push \ + xiu-echo xiu-hash \ +@@ -64,7 +64,7 @@ pkgbin_PROGRAMS = \ + rpmcache rpmdigest rpmrepo rpmspecdump \ + rpmcmp rpmdeps rpmdeps-oecore sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@ + if WITH_DB +-pkgbin_PROGRAMS += dbconvert ++pkgbin_PROGRAMS += + endif + dist_man_MANS = rpmgrep.1 + 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 @@ +During the recalculation of the buildid, it's necessary to change the word +back to the original endian. However, if we do this in-place, we've also +affected the headers that we're also working on. The side effect of this is +we can no longer rely on 'sh_type' as it may have been changed. + +This patch ensures that any time we translate the loaded data to the machine +format, we only do it in a backup copy and never the original copy. + +Note: in all other places a backup copy was used, just not buildid processing. + +Also the process (...) function was modified to verify the data is not +NULL as well. This is an extra check and is not strictly necessary. + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/tools/debugedit.c +=================================================================== +--- rpm-5.4.14.orig/tools/debugedit.c ++++ rpm-5.4.14/tools/debugedit.c +@@ -1445,21 +1445,24 @@ handle_build_id (DSO *dso, Elf_Data *bui + auto inline void process (const void *data, size_t size) + { + memchunk chunk = { .data = (void *) data, .size = size }; +- hashFunctionContextUpdateMC (&ctx, &chunk); ++ if (data != NULL && size != 0) ++ hashFunctionContextUpdateMC (&ctx, &chunk); + } + union + { + GElf_Ehdr ehdr; + GElf_Phdr phdr; + GElf_Shdr shdr; +- } u; +- Elf_Data x = { .d_version = EV_CURRENT, .d_buf = &u }; ++ } u1, u2; ++ Elf_Data src = { .d_version = EV_CURRENT, .d_buf = &u1 }; ++ Elf_Data dest = { .d_version = EV_CURRENT, .d_buf = &u2 }; + +- x.d_type = ELF_T_EHDR; +- x.d_size = sizeof u.ehdr; +- u.ehdr = dso->ehdr; +- u.ehdr.e_phoff = u.ehdr.e_shoff = 0; +- if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL) ++ src.d_type = ELF_T_EHDR; ++ src.d_size = sizeof u1.ehdr; ++ dest.d_size = sizeof u2.ehdr; ++ u1.ehdr = dso->ehdr; ++ u1.ehdr.e_phoff = u1.ehdr.e_shoff = 0; ++ if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL) + { + bad: + fprintf (stderr, "Failed to compute header checksum: %s\n", +@@ -1467,29 +1470,31 @@ handle_build_id (DSO *dso, Elf_Data *bui + exit (1); + } + +- x.d_type = ELF_T_PHDR; +- x.d_size = sizeof u.phdr; ++ src.d_type = ELF_T_PHDR; ++ src.d_size = sizeof u1.phdr; ++ dest.d_size = sizeof u2.phdr; + for (i = 0; i < dso->ehdr.e_phnum; ++i) + { +- if (gelf_getphdr (dso->elf, i, &u.phdr) == NULL) ++ if (gelf_getphdr (dso->elf, i, &u1.phdr) == NULL) + goto bad; +- if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL) ++ if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL) + goto bad; +- process (x.d_buf, x.d_size); ++ process (dest.d_buf, dest.d_size); + } + +- x.d_type = ELF_T_SHDR; +- x.d_size = sizeof u.shdr; ++ src.d_type = ELF_T_SHDR; ++ src.d_size = sizeof u1.shdr; ++ dest.d_size = sizeof u2.shdr; + for (i = 0; i < dso->ehdr.e_shnum; ++i) + if (dso->scn[i] != NULL) + { +- u.shdr = dso->shdr[i]; +- u.shdr.sh_offset = 0; +- if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL) ++ u1.shdr = dso->shdr[i]; ++ u1.shdr.sh_offset = 0; ++ if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL) + goto bad; +- process (x.d_buf, x.d_size); ++ process (dest.d_buf, dest.d_size); + +- if (u.shdr.sh_type != SHT_NOBITS) ++ if (u1.shdr.sh_type != SHT_NOBITS) + { + Elf_Data *d = elf_rawdata (dso->scn[i], NULL); + 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 @@ +debugedit: fix segment fault while file's bss offset have a large number + +While ELF_C_RDWR_MMAP was used, elf_begin invoked mmap() to map file +into memory. While the file's bss Offset has a large number, elf_update +caculated file size by __elf64_updatenull_wrlock and the size was +enlarged. + +In this situation, elf_update invoked ftruncate to enlarge the file, +and memory size (elf->maximum_size) also was incorrectly updated. +There was segment fault in elf_end which invoked munmap with the +length is the enlarged file size, not the mmap's length. + +Before the above operations, invoke elf_begin/elf_update/elf_end +with ELF_C_RDWR and ELF_F_LAYOUT set to enlarge the above file, it +could make sure the file is safe for the following elf operations. + +Upstream-Status: Pending +Signed-off-by: Hongxu Jia +--- + tools/debugedit.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +Index: rpm-5.4.14/tools/debugedit.c +=================================================================== +--- rpm-5.4.14.orig/tools/debugedit.c ++++ rpm-5.4.14/tools/debugedit.c +@@ -1525,6 +1525,28 @@ handle_build_id (DSO *dso, Elf_Data *bui + } + } + ++/* It avoided the segment fault while file's bss offset have a large number. ++ See https://bugzilla.redhat.com/show_bug.cgi?id=1019707 ++ https://bugzilla.redhat.com/show_bug.cgi?id=1020842 for detail. */ ++void valid_file(int fd) ++{ ++ Elf *elf = elf_begin (fd, ELF_C_RDWR, NULL); ++ if (elf == NULL) ++ { ++ error (1, 0, "elf_begin: %s", elf_errmsg (-1)); ++ return; ++ } ++ ++ elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT); ++ ++ if (elf_update (elf, ELF_C_WRITE) < 0) ++ error (1, 0, "elf_update: %s", elf_errmsg (-1)); ++ ++ elf_end (elf); ++ ++ return; ++} ++ + int + main (int argc, char *argv[]) + { +@@ -1621,6 +1643,9 @@ main (int argc, char *argv[]) + exit (1); + } + ++ /* Make sure the file is valid. */ ++ valid_file(fd); ++ + dso = fdopen_dso (fd, file); + if (dso == NULL) + 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 @@ +Some options checked in this loop are needing linking to find out +if the option can be used or not e.g. -fstack-protector which needs +libssp to be staged and available for compiler to link against +Therefore we change the compile only check to compile and link check + +Signed-off-by: Khem Raj +Upstream-Status: Pending + +Index: rpm-5.4.14/configure.ac +=================================================================== +--- rpm-5.4.14.orig/configure.ac ++++ rpm-5.4.14/configure.ac +@@ -201,7 +201,7 @@ dnl # GNU GCC (usually "gcc") + my_save_cflags="$CFLAGS" + CFLAGS=$c + AC_MSG_CHECKING([whether GCC supports $c]) +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([])], + [AC_MSG_RESULT([yes])] + [my_cflags=$c], + [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 @@ +Upstream-Status: Pending + +Index: rpm-5.4.14/rpmdb/rpmdb.h +=================================================================== +--- rpm-5.4.14.orig/rpmdb/rpmdb.h ++++ rpm-5.4.14/rpmdb/rpmdb.h +@@ -9,6 +9,7 @@ + + #include + #include ++#include + + #include + #include /* XXX Header typedef */ +Index: rpm-5.4.14/rpmdb/rpmtag.h +=================================================================== +--- rpm-5.4.14.orig/rpmdb/rpmtag.h ++++ rpm-5.4.14/rpmdb/rpmtag.h +@@ -7,6 +7,7 @@ + + #include + #include ++#include + + #ifdef __cplusplus + 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 @@ +rpm: Resolve parallel install issue when installing lua + +When lua is being installed on some systems that are being run with high levels +of parallelization there are cases where install-data-am and install-exec-hook +are processed at the same or a very short time apart. This causes +install-pkgbinPROGRAMS, which is a dependency of both, to be run at around the +same time This sometimes causes file contention and will sometimes be in a state +where install-exec-hook is looking for a file that is being installed or both +install-pkgbinPROGRAMS being run are installing the same file and fail because +it cannon create a new file. + +This patch allows install-exec-hook to be called by install-data-am instead of +install-exec-am. It also removed the dependency in install-data-hook on +install-pkgbinPROGRAMS. This means install-pkgbinPROGRAMS will only be run once +so there whould be any file contention. + +Upstream-Status: Pending + +Signed-off-by: Morgan Little + +Index: rpm-5.4.14/lua/Makefile.am +=================================================================== +--- rpm-5.4.14.orig/lua/Makefile.am ++++ rpm-5.4.14/lua/Makefile.am +@@ -326,7 +326,7 @@ clean-local: + # XXX Build & install as rpmlua/rpmluac with hardlinks to lua/luac post install. + # XXX CVS has lua/luac sub-directories in the Attic that collide with the + # XXX lua/luac executable names when using cvs update. +-install-exec-hook: install-pkgbinPROGRAMS ++install-data-hook: + mkdir -p $(DESTDIR)$(pkgbindir) + $(__RM) -f $(DESTDIR)$(pkgbindir)/lua + $(__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 @@ +#!/bin/bash + +: ${RPMDEPS:=rpmdeps} + +process() { + while read file_name ; do + printf "%s\t" ${file_name} + if [ ! -d $file_name ]; then + printf "%s " $($RPMDEPS $1 $file_name | sed -e 's,rpmlib(.*,,' -e 's,\([<>\=]\+ \+[^ ]*\),(\1),g') + fi + printf "\n" + done +} + +usage() { + echo "$0 {-P|--provides} {-R|--requires} FILE ..." +} + +while [ $# -gt 0 ]; do + case "$1" in + --rpmdeps) + RPMDEPS=$2 + shift + shift + ;; + -R|--requires) + process_type=--requires + shift + ;; + -P|--provides) + process_type=--provides + shift + ;; + *) + break; + ;; + esac +done + +if [ -z "$process_type" ]; then + usage + exit 1 +fi + +if [ $# -gt 0 ]; then + find "$@" | process $process_type + exit $? +fi + +process $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 @@ +rpmmodule.c: Export a few additional RPMSENSE values + +We want to see the RPMSENSE_SCRIPT values for use with SMART. We also +want to see the MISSINGOK value so we can avoid recommended packages causing +failures. + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/python/rpmmodule.c +=================================================================== +--- rpm-5.4.14.orig/python/rpmmodule.c ++++ rpm-5.4.14/python/rpmmodule.c +@@ -494,12 +494,16 @@ void init_rpm(void) + REGISTER_ENUM(RPMSENSE_EQUAL); + REGISTER_ENUM(RPMSENSE_NOTEQUAL); + REGISTER_ENUM(RPMSENSE_FIND_REQUIRES); +-#if defined(RPM_VENDOR_MANDRIVA) ++#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE) + REGISTER_ENUM(RPMSENSE_PREREQ); + REGISTER_ENUM(RPMSENSE_SCRIPT_PRE); + REGISTER_ENUM(RPMSENSE_SCRIPT_POST); + REGISTER_ENUM(RPMSENSE_SCRIPT_PREUN); +- REGISTER_ENUM(RPMSENSE_SCRIPT_POSTUN) ++ REGISTER_ENUM(RPMSENSE_SCRIPT_POSTUN); ++#endif ++ ++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE) ++ REGISTER_ENUM(RPMSENSE_MISSINGOK); + #endif + + 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 @@ +#!/bin/sh + +[ $# -ge 1 ] || { + cat > /dev/null + exit 0 +} + +case $1 in +-R|--requires) + shift + grep "/usr/\(lib[^/]*\|share\)/python[^/]*/" >/dev/null && echo "python" + exit 0 + ;; +esac + +exit 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 @@ +From 08105acda1da63d32fbb18596a3d6c3e0aa106d1 Mon Sep 17 00:00:00 2001 +From: Leonardo Sandoval +Date: Wed, 10 Jun 2015 14:36:56 +0000 +Subject: [PATCH 2/2] rpm: CVE-2013-6435 + +Upstream-Status: Backport + +Reference: +https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2013-6435 + +Description: +It was found that RPM wrote file contents to the target installation +directory under a temporary name, and verified its cryptographic signature +only after the temporary file has been written completely. Under certain +conditions, the system interprets the unverified temporary file contents +and extracts commands from it. This could allow an attacker to modify +signed RPM files in such a way that they would execute code chosen +by the attacker during package installation. + +Original Patch: +https://bugzilla.redhat.com/attachment.cgi?id=956207 + +Signed-off-by: Leonardo Sandoval +--- + lib/fsm.c | 2 +- + rpmio/rpmio.c | 18 ++++++++++++++---- + 2 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/lib/fsm.c b/lib/fsm.c +index 1ee7e67..094eb1d 100644 +--- a/lib/fsm.c ++++ b/lib/fsm.c +@@ -726,7 +726,7 @@ static int expandRegular(FSM_t fsm, rpmpsm psm, rpmcpio_t archive, int nodigest) + { + FD_t wfd = NULL; + const struct stat * st = &fsm->sb; +- rpm_loff_t left = st->st_size; ++ rpm_loff_t left = rpmfiFSizeIndex(fsmGetFi(fsm), fsm->ix); + const unsigned char * fidigest = NULL; + pgpHashAlgo digestalgo = 0; + int rc = 0; +diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c +index cd223e8..0b12e31 100644 +--- a/rpmio/rpmio.c ++++ b/rpmio/rpmio.c +@@ -1309,15 +1309,19 @@ int Fclose(FD_t fd) + * - bzopen: [1-9] is block size (modulo 100K) + * - bzopen: 's' is smallmode + * - HACK: '.' terminates, rest is type of I/O ++ * - 'U' sets *mode to zero (no permissions) instead of 0666 + */ + static void cvtfmode (const char *m, + char *stdio, size_t nstdio, + char *other, size_t nother, +- const char **end, int * f) ++ const char **end, int *f, mode_t *mode) + { + int flags = 0; + char c; + ++ if (mode) ++ *mode = 0666; ++ + switch (*m) { + case 'a': + flags |= O_WRONLY | O_CREAT | O_APPEND; +@@ -1357,6 +1361,10 @@ static void cvtfmode (const char *m, + if (--nstdio > 0) *stdio++ = c; + continue; + break; ++ case 'U': ++ if (mode) ++ *mode = 0; ++ break; + default: + if (--nother > 0) *other++ = c; + continue; +@@ -1385,7 +1393,8 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n", fd, fmode, fdbg(fd)); + if (fd == NULL || fmode == NULL) + return NULL; + +- cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, NULL); ++ cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, NULL, ++ NULL); + if (stdio[0] == '\0') + return NULL; + zstdio[0] = '\0'; +@@ -1436,7 +1445,7 @@ FD_t Fopen(const char *path, const char *fmode) + { + char stdio[20], other[20]; + const char *end = NULL; +- mode_t perms = 0666; ++ mode_t perms; + int flags = 0; + FD_t fd; + +@@ -1444,7 +1453,8 @@ FD_t Fopen(const char *path, const char *fmode) + return NULL; + + stdio[0] = '\0'; +- cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, &flags); ++ cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, &flags, ++ &perms); + if (stdio[0] == '\0') + return NULL; + +-- +1.8.4.5 + 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 @@ +From 71c812edf1431a9967bd99ba6ffa6ab89eb7ec7c Mon Sep 17 00:00:00 2001 +From: Leonardo Sandoval +Date: Wed, 10 Jun 2015 12:56:55 +0000 +Subject: [PATCH 1/2] rpm: CVE-2014-8118 + +Upstream-Status: Backport + +Reference: +https://bugzilla.redhat.com/show_bug.cgi?id=1168715 + +Description: +It was found that RPM could encounter an integer overflow, +leading to a stack-based overflow, while parsing a crafted +CPIO header in the payload section of an RPM file. This could +allow an attacker to modify signed RPM files in such a way that +they would execute code chosen by the attacker during package +installation. + +Original Patch: +https://bugzilla.redhat.com/attachment.cgi?id=962159 + +Signed-off-by: Leonardo Sandoval +--- + lib/cpio.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/lib/cpio.c b/lib/cpio.c +index 382eeb6..74ddd9c 100644 +--- a/lib/cpio.c ++++ b/lib/cpio.c +@@ -296,6 +296,9 @@ int rpmcpioHeaderRead(rpmcpio_t cpio, char ** path, struct stat * st) + st->st_rdev = makedev(major, minor); + + GET_NUM_FIELD(hdr.namesize, nameSize); ++ if (nameSize <= 0 || nameSize > 4096) { ++ return CPIOERR_BAD_HEADER; ++ } + + *path = xmalloc(nameSize + 1); + read = Fread(*path, nameSize, 1, cpio->fd); +-- +1.8.4.5 + 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 @@ +Remove the sanity checking from the rpm autogen.sh. This is required because +we may have slightly different, but yet compatible versions. If we do end +up breaking things, we'll deal with it at that time. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/syck/autogen.sh +=================================================================== +--- rpm-5.4.14.orig/syck/autogen.sh ++++ rpm-5.4.14/syck/autogen.sh +@@ -34,12 +34,6 @@ libtoolize () { + eval $_libtoolize $_libtoolize_args + } + +-# requirements sanity check +-[ "`automake --version | head -1`" != "$AMV" ] && echo "$USAGE" # && exit 1 +-[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1 +-[ "`libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1 +-[ "`gettextize --version | head -1 | sed -e 's;^.*/\\(gettextize\\);\\1;'`" != "$GTT" ] && echo "$USAGE" # && exit 1 +- + echo "---> generate files via GNU libtool (libtoolize)" + libtoolize --quiet --copy --force --install + 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 @@ +lib/rpmrc.c: Update --target processing to support full GNU canonical arch + +Prior to this patch, when using --target, RPM supported the format: + + - + --gnu + -- + ---gnu + +This patch changes the list of supported items to: + + - + --gnu + -- + --- + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/lib/rpmrc.c +=================================================================== +--- rpm-5.4.14.orig/lib/rpmrc.c ++++ rpm-5.4.14/lib/rpmrc.c +@@ -925,8 +925,8 @@ static void getMachineInfo(int type, /*@ + + static void rpmRebuildTargetVars(const char ** target, const char ** canontarget) + { +- +- char *ca = NULL, *co = NULL, *ct = NULL; ++ /* ca = arch, cv = vendor, co = os, ce = extension, ct = canon target */ ++ char *ca = NULL, *cv = NULL, *co = NULL, *ce = NULL, *ct = NULL; + int x; + + /* Rebuild the compat table to recalculate the current target arch. */ +@@ -936,23 +936,60 @@ static void rpmRebuildTargetVars(const c + rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS); + + if (target && *target) { ++ /* GNU canonical format is: ++ * --[-extension] ++ * ++ * We support the both the GNU canonical format ++ * as well as the traditional RPM formats: ++ * ++ * -[-gnu] ++ */ + char *c; + /* Set arch and os from specified build target */ + ca = xstrdup(*target); +- if ((c = strchr(ca, '-')) != NULL) { ++ if ((c = strchr(ca, '-')) == NULL) { ++ /* Format is */ ++ ; ++ } else { + *c++ = '\0'; +- +- if ((co = strrchr(c, '-')) == NULL) { +- co = c; ++ cv = c; ++ ++ if ((c = strchr(c, '-')) == NULL) { ++ /* Format is - */ ++ co = cv; ++ cv = NULL; + } else { +- if (!xstrcasecmp(co, "-gnu")) +- *co = '\0'; +- if ((co = strrchr(c, '-')) == NULL) +- co = c; +- else +- co++; ++ *c++ = '\0'; ++ co = c; ++ ++ if ((c = strchr(c, '-')) == NULL) { ++ /* Might be: ++ * -- ++ * --gnu ++ */ ++ if (!xstrcasecmp(co, "gnu")) { ++ /* Format was --gnu */ ++ ce = co; ++ co = cv; ++ cv = NULL; ++ } ++ } else { ++ /* Format was --- */ ++ *c++ = '\0'; ++ ce = c; ++ } + } ++ if (cv != NULL) cv = xstrdup(cv); + if (co != NULL) co = xstrdup(co); ++ if (ce != NULL) { ++ /* We need to prefix it with a "-" */ ++ char * lce = NULL; ++ ++ lce = xmalloc(strlen(ce) + sizeof("-")); ++ sprintf(lce, "-%s", ce); ++ ++ ce = lce; ++ } + } + } else { + const char *a = NULL; +@@ -995,8 +1032,16 @@ static void rpmRebuildTargetVars(const c + addMacro(NULL, "_target", NULL, ct, RMIL_RPMRC); + delMacro(NULL, "_target_cpu"); + addMacro(NULL, "_target_cpu", NULL, ca, RMIL_RPMRC); ++ if (cv) { ++ delMacro(NULL, "_target_vendor"); ++ addMacro(NULL, "_target_vendor", NULL, cv, RMIL_RPMRC); ++ } + delMacro(NULL, "_target_os"); + addMacro(NULL, "_target_os", NULL, co, RMIL_RPMRC); ++ if (ce) { ++ delMacro(NULL, "_gnu"); ++ addMacro(NULL, "_gnu", NULL, ce, RMIL_RPMRC); ++ } + + if (canontarget) + *canontarget = ct; +@@ -1004,8 +1049,12 @@ static void rpmRebuildTargetVars(const c + ct = _free(ct); + ca = _free(ca); + /*@-usereleased@*/ ++ cv = _free(cv); ++ /*@-usereleased@*/ + co = _free(co); + /*@=usereleased@*/ ++ ce = _free(ce); ++ /*@-usereleased@*/ + } + + 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 @@ +Upstream-Status: Inappropriate [configuration] + +Change cache size to reduce the usage of disk space from 62MB to 26MB. + +Signed-off-by: Mei Lei + +Index: rpm-5.4.14/rpmdb/DB_CONFIG.in +=================================================================== +--- rpm-5.4.14.orig/rpmdb/DB_CONFIG.in ++++ rpm-5.4.14/rpmdb/DB_CONFIG.in +@@ -29,7 +29,7 @@ set_thread_count 64 + + # ================ Memory Pool + #XXX initializing dbenv with set_cachesize has unimplemented prerequsites +-#set_cachesize 0 1048576 0 ++set_cachesize 0 1048576 0 + set_mp_mmapsize 268435456 + + # ================ 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 @@ +Support both db5 and db6. + +Upstream-status: Inappropriate [configuration] + +Signed-off-by: Mark Hatle + +Index: rpm/configure.ac +=================================================================== +--- rpm.orig/configure.ac ++++ rpm/configure.ac +@@ -547,8 +547,6 @@ else + MYPATH=$PATH + fi + +-DBXY=db60 +- + AC_PATH_PROG(__BASH, bash, %{_bindir}/bash, $MYPATH) + AC_PATH_PROG(__BZIP2, bzip2, %{_bindir}/bzip2, $MYPATH) + AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH) +@@ -560,22 +558,6 @@ AC_PATH_PROG(__CMAKE, cmake, %{_bindir}/ + AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH) + AC_PATH_PROG(__CURL, curl, %{_bindir}/curl, $MYPATH) + AC_PATH_PROG(__CVS, cvs, %{_bindir}/cvs, $MYPATH) +-AC_PATH_PROG(__DB_ARCHIVE, ${DBXY}_archive, %{_bindir}/${DBXY}_archive, $MYPATH) +-AC_PATH_PROG(__DB_CHECKPOINT, ${DBXY}_checkpoint, %{_bindir}/${DBXY}_checkpoint, $MYPATH) +-AC_PATH_PROG(__DB_DEADLOCK, ${DBXY}_deadlock, %{_bindir}/${DBXY}_deadlock, $MYPATH) +-AC_PATH_PROG(__DB_DUMP, ${DBXY}_dump, %{_bindir}/${DBXY}_dump, $MYPATH) +-AC_PATH_PROG(__DB_HOTBACKUP, ${DBXY}_hotbackup, %{_bindir}/${DBXY}_hotbackup, $MYPATH) +-AC_PATH_PROG(__DB_LOAD, ${DBXY}_load, %{_bindir}/${DBXY}_load, $MYPATH) +-AC_PATH_PROG(__DB_LOG_VERIFY, ${DBXY}_log_verify, %{_bindir}/${DBXY}_log_verify, $MYPATH) +-AC_PATH_PROG(__DB_PRINTLOG, ${DBXY}_printlog, %{_bindir}/${DBXY}_printlog, $MYPATH) +-AC_PATH_PROG(__DB_RECOVER, ${DBXY}_recover, %{_bindir}/${DBXY}_recover, $MYPATH) +-AC_PATH_PROG(__DB_REPLICATE, ${DBXY}_replicate, %{_bindir}/${DBXY}_replicate, $MYPATH) +-AC_PATH_PROG(__DBSQL, ${DBXY}sql, %{_bindir}/${DBXY}sql, $MYPATH) +-AC_PATH_PROG(__DB_SQL_CODEGEN, ${DBXY}_sql_codegen, %{_bindir}/${DBXY}_sql_codegen, $MYPATH) +-AC_PATH_PROG(__DB_STAT, ${DBXY}_stat, %{_bindir}/${DBXY}_stat, $MYPATH) +-AC_PATH_PROG(__DB_TUNER, ${DBXY}_tuner, %{_bindir}/${DBXY}_tuner, $MYPATH) +-AC_PATH_PROG(__DB_UPGRADE, ${DBXY}_upgrade, %{_bindir}/${DBXY}_upgrade, $MYPATH) +-AC_PATH_PROG(__DB_VERIFY, ${DBXY}_verify, %{_bindir}/${DBXY}_verify, $MYPATH) + AC_PATH_PROG(__DIFF, diff, /bin/diff, $MYPATH) + AC_PATH_PROG(__DITTO, ditto, %{_bindir}/ditto, $MYPATH) + AC_PATH_PROG(__FILE, file, %{_bindir}/file, $MYPATH) +@@ -1604,13 +1586,18 @@ RPM_CHECK_LIB( + + dnl # Berkeley-DB & SQLite + DBLIBSRCS="" ++DBXY=db ++ + # XXX won't handle --includedir override +-CPPFLAGS="${CPPFLAGS} -I${prefix}/include/${DBXY}" ++CPPFLAGS_save="${CPPFLAGS}" ++CPPFLAGS="${CPPFLAGS_save} -I${prefix}/include/db-6.0" ++with_db_save="${with_db}" + RPM_CHECK_LIB( + [Berkeley-DB], [db], + [db-6.0], [db_create], [db.h], +- [yes,external], [db3], ++ [yes,external], [db6], + [ DBLIBSRCS="$DBLIBSRCS db3.c" ++ DBXY=db60 + AM_CONDITIONAL(WITH_DB, [ true ]) + AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ]) + if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then +@@ -1619,10 +1606,32 @@ RPM_CHECK_LIB( + WITH_DB_SUBDIR="" + fi + ], +- [ AM_CONDITIONAL(WITH_DB, [ false ]) +- AM_CONDITIONAL(WITH_DB_INTERNAL, [ false ]) ++ [ # Reset a few variables to fresh ++ with_db="${with_db_save}" ++ CPPFLAGS="${CPPFLAGS_save} -I${prefix}/include/db-5.3" ++ RPM_CHECK_LIB( ++ [Berkeley-DB], [db], ++ [db-5.3], [db_create], [db.h], ++ [yes,external], [db53], ++ [ DBLIBSRCS="$DBLIBSRCS db3.c" ++ DBXY=db53 ++ AM_CONDITIONAL(WITH_DB, [ true ]) ++ AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ]) ++ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then ++ AC_DEFINE(HAVE_DB_H, 1, [Have header]) ++ else ++ WITH_DB_SUBDIR="" ++ fi ++ ], ++ [ AM_CONDITIONAL(WITH_DB, [ false ]) ++ AM_CONDITIONAL(WITH_DB_INTERNAL, [ false ]) ++ ]) + ]) + ++if test ".$ac_cv_lib_db_6_0_db_create" != .yes -a ".$ac_cv_lib_db_5_3_db_create" != .yes; then ++ CPPFLAGS="${CPPFLAGS_save}" ++fi ++ + dnl # Sqlite external + RPM_CHECK_LIB( + [SQLite], [sqlite], +@@ -1633,10 +1642,11 @@ RPM_CHECK_LIB( + + dnl # Sqlite 3.7.0.1 from db-5.1.19 + dnl XXX error: `db3' is already registered with AC_CONFIG_SUBDIRS. ++if test ".$ac_cv_lib_db_6_0_db_create" = .yes; then + RPM_CHECK_LIB( + [Berkeley-DB (+SQLite3)], [dbsql], + [db_sql-6.0], [sqlite3_open], [dbsql.h], +- [yes,external], [db3/sql], ++ [yes,external], [db6/sql], + [ + AM_CONDITIONAL(WITH_DBSQL, [ true ]) + AC_DEFINE(WITH_SQLITE, 1, [Define as 1 if building with SQLite library]) +@@ -1650,12 +1660,50 @@ RPM_CHECK_LIB( + ], [ + AM_CONDITIONAL(WITH_DBSQL, [ false ]) + ]) ++elif test ".$ac_cv_lib_db_5_3_db_create" = .yes; then ++RPM_CHECK_LIB( ++ [Berkeley-DB (+SQLite3)], [dbsql], ++ [db_sql-5.3], [sqlite3_open], [dbsql.h], ++ [yes,external], [db53/sql], ++ [ ++ AM_CONDITIONAL(WITH_DBSQL, [ true ]) ++ AC_DEFINE(WITH_SQLITE, 1, [Define as 1 if building with SQLite library]) ++ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then ++ WITH_DB_CPPFLAGS="${WITH_DB_CPPFLAGS} -I\$(top_srcdir)/db/sql/generated" ++ WITH_DB_LIBS="${WITH_DBSQL_LIBS}" ++ DBLIBSRCS="$DBLIBSRCS sqlite.c" ++ else ++ WITH_DBSQL_SUBDIR="" ++ fi ++ ], [ ++ AM_CONDITIONAL(WITH_DBSQL, [ false ]) ++ ]) ++else ++AM_CONDITIONAL(WITH_DBSQL, [ false ]) ++fi + + DBLIBOBJS=`echo $DBLIBSRCS | sed -e "s/\.c/\.lo/g"` + + AC_SUBST(DBLIBSRCS) + AC_SUBST(DBLIBOBJS) + ++AC_PATH_PROG(__DB_ARCHIVE, ${DBXY}_archive, %{_bindir}/${DBXY}_archive, $MYPATH) ++AC_PATH_PROG(__DB_CHECKPOINT, ${DBXY}_checkpoint, %{_bindir}/${DBXY}_checkpoint, $MYPATH) ++AC_PATH_PROG(__DB_DEADLOCK, ${DBXY}_deadlock, %{_bindir}/${DBXY}_deadlock, $MYPATH) ++AC_PATH_PROG(__DB_DUMP, ${DBXY}_dump, %{_bindir}/${DBXY}_dump, $MYPATH) ++AC_PATH_PROG(__DB_HOTBACKUP, ${DBXY}_hotbackup, %{_bindir}/${DBXY}_hotbackup, $MYPATH) ++AC_PATH_PROG(__DB_LOAD, ${DBXY}_load, %{_bindir}/${DBXY}_load, $MYPATH) ++AC_PATH_PROG(__DB_LOG_VERIFY, ${DBXY}_log_verify, %{_bindir}/${DBXY}_log_verify, $MYPATH) ++AC_PATH_PROG(__DB_PRINTLOG, ${DBXY}_printlog, %{_bindir}/${DBXY}_printlog, $MYPATH) ++AC_PATH_PROG(__DB_RECOVER, ${DBXY}_recover, %{_bindir}/${DBXY}_recover, $MYPATH) ++AC_PATH_PROG(__DB_REPLICATE, ${DBXY}_replicate, %{_bindir}/${DBXY}_replicate, $MYPATH) ++AC_PATH_PROG(__DBSQL, ${DBXY}sql, %{_bindir}/${DBXY}sql, $MYPATH) ++AC_PATH_PROG(__DB_SQL_CODEGEN, ${DBXY}_sql_codegen, %{_bindir}/${DBXY}_sql_codegen, $MYPATH) ++AC_PATH_PROG(__DB_STAT, ${DBXY}_stat, %{_bindir}/${DBXY}_stat, $MYPATH) ++AC_PATH_PROG(__DB_TUNER, ${DBXY}_tuner, %{_bindir}/${DBXY}_tuner, $MYPATH) ++AC_PATH_PROG(__DB_UPGRADE, ${DBXY}_upgrade, %{_bindir}/${DBXY}_upgrade, $MYPATH) ++AC_PATH_PROG(__DB_VERIFY, ${DBXY}_verify, %{_bindir}/${DBXY}_verify, $MYPATH) ++ + AC_ARG_WITH(db-largefile, AS_HELP_STRING([--with-db-largefile], [build Berkeley-DB with LARGEFILE support])) + AC_ARG_WITH(db-mutex, AS_HELP_STRING([--with-db-mutex=ARG], [build Berkeley-DB with MUTEX type ARG])) + 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 @@ +In certain cases with BerkleyDB 5.3.x we are getting the error: + +db3.c:1443: dbcursor->pget(-30999): BDB0063 DB_BUFFER_SMALL: User memory too small for return value + +See https://bugs.launchpad.net/rpm/+bug/934420 for more information. + +It appears to be some type of a bug in the BerkleyDB 5.3.x. In an attempt +to workaround the problem, when we encounter this situation we attempt +to adjust the size of the mmap buffer until the call works, or we +end up trying 10 times. The new size is either the updated vp->size +from the failed pget call, or the previous size + 1024. + +If DBI debugging is enabled, additional diagnostics are printed, otherwise +a basic retry and success message is added to show that the failure was +resolved. + +Upstream-Status: Inappropriate (workaround) + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/rpmdb/rpmdb.c +=================================================================== +--- rpm-5.4.14.orig/rpmdb/rpmdb.c ++++ rpm-5.4.14/rpmdb/rpmdb.c +@@ -2212,8 +2212,12 @@ static int rpmmiGet(dbiIndex dbi, DBC * + vp->flags |= DB_DBT_USERMEM; + rc = dbiGet(dbi, dbcursor, kp, vp, flags); + if (rc == DB_BUFFER_SMALL) { ++ int retry = 0; ++ size_t origlen = vp->size; + size_t uhlen = vp->size; +- void * uh = mmap(NULL, uhlen, _prot, _flags, _fdno, _off); ++ void * uh; ++retry_get: ++ uh = mmap(NULL, uhlen, _prot, _flags, _fdno, _off); + if (uh == NULL || uh == (void *)-1) + fprintf(stderr, + "==> mmap(%p[%u], 0x%x, 0x%x, %d, 0x%x) error(%d): %s\n", +@@ -2235,6 +2239,25 @@ static int rpmmiGet(dbiIndex dbi, DBC * + if (munmap(uh, uhlen) != 0) + fprintf(stderr, "==> munmap(%p[%u]) error(%d): %s\n", + uh, (unsigned)uhlen, errno, strerror(errno)); ++ /* We want to be sure to limit the number of retry attempts to avoid a loop! */ ++ if (rc == DB_BUFFER_SMALL && retry < 10) { ++ /* If we got a largr vp-size back, use that, otherwise increment the size by 1k */ ++ uhlen = vp->size > uhlen ? vp->size : uhlen + 1024; ++ retry++; ++ if ((dbi)->dbi_debug) ++ fprintf(stderr, "==> DB_BUFFER_SMALL orig requested (%d), configured (%d), forcing larger buffer (%d), new size (%d)\n", ++ origlen, vp->ulen, uhlen, vp->size); ++ else ++ fprintf(stderr, "==> retry (%d) db3cpget (%d)\n", retry, uhlen); ++ goto retry_get; ++ } ++ } ++ if (retry) { ++ if ((dbi)->dbi_debug) ++ fprintf(stderr, "==> success orig requested (%d), configured buffer (%d), buffer (%d), size after dbiGet (%d)\n", ++ origlen, vp->ulen, uhlen, vp->size); ++ else ++ fprintf(stderr, "==> success\n"); + } + } + } else +Index: rpm-5.4.14/rpmdb/db3.c +=================================================================== +--- rpm-5.4.14.orig/rpmdb/db3.c ++++ rpm-5.4.14/rpmdb/db3.c +@@ -1509,7 +1509,7 @@ assert(db != NULL); + #endif + } + +-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))); ++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))); + return rc; + } + /*@=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 @@ +Debug the platform score generation... + +Index: rpm-5.4.14/lib/rpmrc.c +=================================================================== +--- rpm-5.4.14.orig/lib/rpmrc.c ++++ rpm-5.4.14/lib/rpmrc.c +@@ -465,6 +465,8 @@ static rpmRC rpmPlatform(const char * pl + + rc = (rpmRC) rpmiobSlurp(platform, &iob); + ++ fprintf(stderr, "D: rpmPlatform file %s\n", platform); ++ + if (rc || iob == NULL) { + rc = RPMRC_FAIL; + goto exit; +@@ -486,6 +488,7 @@ static rpmRC rpmPlatform(const char * pl + while (--t > p && xisspace(*t)) + *t = '\0'; + if (t > p) { ++ fprintf(stderr, "D: rpmPlatform mireAppend REGEX %s\n", p); + xx = mireAppend(RPMMIRE_REGEX, 0, p, NULL, &mi_re, &mi_nre); + } + continue; +@@ -503,6 +506,11 @@ static rpmRC rpmPlatform(const char * pl + _gnu = rpmExpand("-", cvog->gnu, NULL); + + addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1); ++ fprintf(stderr, "D: rpmPlatform addMacro %s-%s-%s(%s)\n", ++ rpmExpand("%{_platform_cpu}", NULL), ++ rpmExpand("%{_platform_vendor}", NULL), ++ rpmExpand("%{_platform_os}", NULL), ++ rpmExpand("%{_platform_gnu}", NULL)); + #else + addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1); + addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1); +@@ -510,6 +518,7 @@ static rpmRC rpmPlatform(const char * pl + #endif + } + ++ fprintf(stderr, "D: rpmPlatform mireAppend STRCMP %s -- ", p); + #if !defined(RPM_VENDOR_OE) /* Skip the explicit-platform */ + #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */ + /* do not use vendor and GNU attribution */ +@@ -519,6 +528,7 @@ static rpmRC rpmPlatform(const char * pl + (cvog && *cvog->gnu ? "-" : NULL), + (cvog ? cvog->gnu : NULL), NULL); + #endif ++ fprintf(stderr, "%s\n", p); + xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre); + p = _free(p); + #endif +@@ -688,9 +698,12 @@ int rpmPlatformScore(const char * platfo + + if ((mire = (miRE) mi_re) != NULL) + for (i = 0; i < mi_nre; i++) { +- if (mireRegexec(mire + i, platform, 0) >= 0) ++ if (mireRegexec(mire + i, platform, 0) >= 0) { ++ fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, i + 1); + return (i + 1); ++ } + } ++ fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, 0); + return 0; + } + /*@=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 @@ +From 70d881873b443c9bad502db9665595455d4f0ac9 Mon Sep 17 00:00:00 2001 +From: Robert Yang +Date: Tue, 8 Jul 2014 07:41:10 +0800 +Subject: [PATCH] configure.ac: disable -Wno-override-init + +Fixed rpm-native.do_configure error on CentOS 5.x: + +cc1: error: unrecognized command line option "-Wno-override-init" + +Upstream-Status: Pending + +Signed-off-by: Robert Yang +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index adeffe0..6746b4c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -163,7 +163,7 @@ AC_ARG_ENABLE(build-warnings, + # XXX gcc-4.2 on Mac OS X hasn't + # CFLAGS="$CFLAGS -Wno-unused-but-set-variable" + # XXX rpmio/set.c needs this +- CFLAGS="$CFLAGS -Wno-override-init" ++# CFLAGS="$CFLAGS -Wno-override-init" + elif test ".`$CC -V 2>&1 | grep 'Sun C'`" != .; then + dnl # Sun Studio (usually "cc") + CFLAGS="$CFLAGS -v" +-- +1.8.2.1 + 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 @@ +rpmfc.c: Always generate per-file information + +Even when the per-file dependency generate is disabled, we want to generate +per file classification and other associated data. + +Note: this is a temporary workaround. Eventually we will want to have a way +to seed per-file dependency and other information in order to generate a +package from previously determined information. + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/lib/rpmfc.c +=================================================================== +--- rpm-5.4.14.orig/lib/rpmfc.c ++++ rpm-5.4.14/lib/rpmfc.c +@@ -1734,7 +1734,6 @@ rpmRC rpmfcGenerateDepends(void * _spec, + /* ... then generate dependencies using %{__find_requires} et al. */ + rc = rpmfcGenerateDependsHelper(spec, pkg, fi); + printDeps(pkg->header); +- return rc; + } + + /* Generate scriptlet Dependencies. */ +@@ -1762,8 +1761,8 @@ rpmRC rpmfcGenerateDepends(void * _spec, + av[ac] = NULL; + + fc = rpmfcNew(); +- fc->skipProv = !pkg->autoProv; +- fc->skipReq = !pkg->autoReq; ++ fc->skipProv = !pkg->autoProv || !internaldeps; ++ fc->skipReq = !pkg->autoReq || !internaldeps; + fc->tracked = 0; + + { 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 @@ +Occasionally the cp -p fails with a non-zero return code. This will cause +the system abort the build. + +Upstream-status: Pending + +Signed-off-by: Mark Hatle + +Index: rpm/rpmdb/Makefile.am +=================================================================== +--- rpm.orig/rpmdb/Makefile.am ++++ rpm/rpmdb/Makefile.am +@@ -234,11 +234,14 @@ lcov-report: + #lcov-upload: lcov + # rsync -rvz -e ssh --delete lcov/* ??? + ++$(builddir)/logio_recover_template: $(srcdir)/logio_recover_template ++ @if test ".$(builddir)" != ".$(srcdir)"; then \ ++ cp -fp $(srcdir)/logio_recover_template \ ++ $(builddir)/logio_recover_template ; \ ++ fi ++ + logio_BUILT = logio_auto.c logio_autop.c logio_auto.h logio_template +-$(logio_BUILT): logio.awk logio.src logio_recover_template +- @test -e $(builddir)/logio_recover_template || \ +- cp -p $(srcdir)/logio_recover_template \ +- $(builddir)/logio_recover_template ++$(logio_BUILT): logio.awk logio.src $(builddir)/logio_recover_template + @rm -f $(logio_BUILT) + @$(AWK) -f $(srcdir)/logio.awk \ + -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 @@ +We need to sanity check that the nlink size and our linksLeft counter +do match. If an rpm is badly constructed with identical inode values +for multiple hardlinked files, such an rpm will otherwise access memory +out of array bounds and cause memory corruption and crashes. + +The fix is to add in the sanity check and exit if bad circumstances +are found. We need to fix the caller to check the return code too. + +RP 2014/6/10 + +Upstream-Status: Pending + +Index: rpm-5.4.14/lib/fsm.c +=================================================================== +--- rpm-5.4.14.orig/lib/fsm.c ++++ rpm-5.4.14/lib/fsm.c +@@ -495,6 +495,11 @@ static int saveHardLink(/*@special@*/ /* + } + + if (fsm->goal == IOSM_PKGBUILD) --fsm->li->linksLeft; ++ if (fsm->li->linksLeft > st->st_nlink) { ++ rpmlog(RPMLOG_ERR, _("Corrupted hardlinks found (count %d does not match %d), exiting.\n"), fsm->li->linksLeft, st->st_nlink); ++ return -1; ++ } ++ + fsm->li->filex[fsm->li->linksLeft] = fsm->ix; + /*@-observertrans -dependenttrans@*/ + fsm->li->nsuffix[fsm->li->linksLeft] = fsm->nsuffix; +@@ -1878,8 +1883,13 @@ if (!(fsmGetFi(fsm)->mapflags & IOSM_PAY + fsm->postpone = iosmFileActionSkipped(fsm->action); + if (fsm->goal == IOSM_PKGINSTALL || fsm->goal == IOSM_PKGBUILD) { + /*@-evalorder@*/ /* FIX: saveHardLink can modify fsm */ +- if (S_ISREG(st->st_mode) && st->st_nlink > 1) ++ if (S_ISREG(st->st_mode) && st->st_nlink > 1) { + fsm->postpone = saveHardLink(fsm); ++ if (fsm->postpone < 0) { ++ rc = RPMRC_FAIL; ++ break; ++ } ++ } + /*@=evalorder@*/ + } + 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 @@ +During installation, the libtool relink attempts to link to -lrpm... +The problem is that it hasn't been installed yet! So small change causes +the libtool to instead use the build version. + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/lib/Makefile.am +=================================================================== +--- rpm-5.4.14.orig/lib/Makefile.am ++++ rpm-5.4.14/lib/Makefile.am +@@ -120,6 +120,9 @@ librpm.la: $(librpm_la_OBJECTS) $(librpm + #libsql_la_SOURCES = libsql.c + #libsql_la_LIBADD = librpm.la $(RPMDB_LDADD_COMMON) + ++# pkglib libraries needs to have usrlib libraries already installed! ++install-pkglibLTLIBRARIES: install-usrlibLTLIBRARIES ++ + install-data-hook: + if !ENABLE_BUILD_LAFILES + -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 @@ + +Upstream-Status: Inappropriate [configuration] + +Index: rpm-5.4.14/rpmdb/DB_CONFIG.in +=================================================================== +--- rpm-5.4.14.orig/rpmdb/DB_CONFIG.in ++++ rpm-5.4.14/rpmdb/DB_CONFIG.in +@@ -4,6 +4,7 @@ set_data_dir . + set_create_dir . + set_lg_dir ./log + set_tmp_dir ./tmp ++set_flags db_log_autoremove on + + # -- thread_count must be >= 8 + 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 @@ +Enable platform tag matching workaround in OE. + +When installing some LSB packages the 'platform' field in the package +appears to be invalid. Instead of relying solely on the platform comparison +we also want to generate a perceived platform based on the valid rpm contents +of arch and os. + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/lib/depends.c +=================================================================== +--- rpm-5.4.14.orig/lib/depends.c ++++ rpm-5.4.14/lib/depends.c +@@ -595,7 +595,7 @@ int rpmtsAddInstallElement(rpmts ts, Hea + platform = rpmExpand(arch, "-unknown-", os, NULL); + + rc = rpmPlatformScore(platform, platpat, nplatpat); +-#if defined(RPM_VENDOR_MANDRIVA) ++#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE) + /* + * If no match on platform tag, we'll try again with arch tag + * 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 @@ +Add support for cross compiling lua + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/configure.ac +=================================================================== +--- rpm-5.4.14.orig/configure.ac ++++ rpm-5.4.14/configure.ac +@@ -121,6 +121,9 @@ AC_PROG_YACC + + AC_PATH_PROG(AS, as, as) + ++CC_FOR_BUILD=${CC_FOR_BUILD-\$(CC)} ++AC_SUBST(CC_FOR_BUILD) ++ + dnl # GCC specifics + AC_PROG_GCC_TRADITIONAL + AC_ARG_ENABLE(build-pic, +Index: rpm-5.4.14/lua/Makefile.am +=================================================================== +--- rpm-5.4.14.orig/lua/Makefile.am ++++ rpm-5.4.14/lua/Makefile.am +@@ -41,7 +41,7 @@ rpmluac_LDADD = liblua.la + + # --- bin2c doesn't need anything but a compiler + bin2c$(EXEEXT): bin2c.c +- $(CC) -o $@ $< ++ $(CC_FOR_BUILD) -o $@ $< + + liblua_la_SOURCES = + 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 @@ +macros/macros.in: Revert settings to the same as RPM 5.4.0 + +Enable a reasonable set of rpmdeps dependency helper macros. These sets +were used by RPM 5.4.0. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/macros/macros.in +=================================================================== +--- rpm-5.4.14.orig/macros/macros.in ++++ rpm-5.4.14/macros/macros.in +@@ -1022,7 +1022,7 @@ $_arbitrary_tags_tests Foo:Bar + + #============================================================================== + # ---- rpmbuild macros. +-#%%{load:%{_usrlibrpm}/macros.rpmbuild} ++%{load:%{_usrlibrpm}/macros.rpmbuild} + + #------------------------------------------------------------------------ + # cmake(...) configuration +@@ -1038,15 +1038,15 @@ $_arbitrary_tags_tests Foo:Bar + + #------------------------------------------------------------------------ + # perl(...) configuration +-#%%{load:%{_usrlibrpm}/macros.d/perl} ++%{load:%{_usrlibrpm}/macros.d/perl} + + #------------------------------------------------------------------------ + # python(...) configuration. +-#%%{load:%{_usrlibrpm}/macros.d/python} ++%{load:%{_usrlibrpm}/macros.d/python} + + #------------------------------------------------------------------------ + # php(...) configuration. +-#%%{load:%{_usrlibrpm}/macros.d/php} ++%{load:%{_usrlibrpm}/macros.d/php} + + #------------------------------------------------------------------------ + # java(...) configuration. +@@ -1054,11 +1054,11 @@ $_arbitrary_tags_tests Foo:Bar + + #------------------------------------------------------------------------ + # libtool(...) configuration. +-#%%{load:%{_usrlibrpm}/macros.d/libtool} ++%{load:%{_usrlibrpm}/macros.d/libtool} + + #------------------------------------------------------------------------ + # pkgconfig(...) configuration. +-#%%{load:%{_usrlibrpm}/macros.d/pkgconfig} ++%{load:%{_usrlibrpm}/macros.d/pkgconfig} + + #------------------------------------------------------------------------ + # mono(...) configuration. +@@ -1070,7 +1070,7 @@ $_arbitrary_tags_tests Foo:Bar + + #------------------------------------------------------------------------ + # tcl(...) configuration. +-#%%{load:%{_usrlibrpm}/macros.d/tcl} ++%{load:%{_usrlibrpm}/macros.d/tcl} + + #------------------------------------------------------------------------ + # 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 @@ +lib/order.c: Make the dependency loop messages into debug msgs + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/lib/order.c +=================================================================== +--- rpm-5.4.14.orig/lib/order.c ++++ rpm-5.4.14/lib/order.c +@@ -2175,7 +2175,7 @@ rescan: + const char * dp; + rpmlogLvl msglvl = (anaconda || (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS)) + ? RPMLOG_WARNING : RPMLOG_ERR; +-#if defined(RPM_VENDOR_MANDRIVA) /* loop-detection-optional-loglevel */ ++#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE) /* loop-detection-optional-loglevel */ + // Report loops as debug-level message by default (7 = RPMLOG_DEBUG), overridable + msglvl = rpmExpandNumeric("%{?_loop_detection_loglevel}%{?!_loop_detection_loglevel:7}"); + #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 @@ +Disable perl-URPM support + +This causes a configure failure when perl-URPM is not used. + +| configure.ac:1159: required file `perl-URPM/Makefile.PL.in' not found +| configure.ac:1159: required file `perl-URPM/Makefile.in' not found + +Upstream-Status: Inappropriate [disable feature] + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/configure.ac +=================================================================== +--- rpm-5.4.14.orig/configure.ac ++++ rpm-5.4.14/configure.ac +@@ -1186,30 +1186,10 @@ AC_SUBST(WITH_PERL_SUBDIR) + AC_SUBST(WITH_PERL_SUBPACKAGE) + AC_SUBST(WITH_PERL_LIBS) + +-dnl # optional Perl-URPM language bindings ++dnl # disable Perl-URPM language bindings + WITH_PERL_URPM_SUBDIR="" + WITH_PERL_URPM_SUBPACKAGE=0 + WITH_PERL_URPM_LIBS="" +-if test ".$WITH_PTHREADS" = .yes; then +- WITH_PERL_URPM_LIBS="$LIBS" +-fi +-AC_ARG_WITH(perl-urpm, AS_HELP_STRING([--with-perl-urpm], [build with Perl URPM language bindings]), [ +- if test ".$withval" != .no; then +- PERL_URPM_INSTALLDIRS="" +- if test "$withval" == "vendor"; then +- PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'vendor'," +- fi +- if test "$withval" == "site"; then +- PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'site'," +- fi +- AC_DEFINE_UNQUOTED([PERL_URPM_INSTALLDIRS], [$PERL_URPM_INSTALLDIRS], [Perl install directory (vendor/site)]) +- AC_SUBST(PERL_URPM_INSTALLDIRS) +- WITH_PERL_URPM_SUBDIR=perl-URPM +- WITH_PERL_URPM_SUBPACKAGE=1 +- AC_CONFIG_FILES([perl-URPM/Makefile.PL]) +- AC_CONFIG_FILES([perl-URPM/Makefile]) +- fi +-]) + AC_SUBST(WITH_PERL_URPM_SUBDIR) + AC_SUBST(WITH_PERL_URPM_SUBPACKAGE) + 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 @@ +Fix integration of ossp-uuid + +We need to avoid including the util-linux uuid library, instead +we need ossp-uuid. There is a related hack in do_configure to +make sure that we use the right .pc file as well. + +Upstream-Status: Inappropriate [disable feature] + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/configure.ac +=================================================================== +--- rpm-5.4.14.orig/configure.ac ++++ rpm-5.4.14/configure.ac +@@ -1951,7 +1951,7 @@ grep -v 'define HAVE_UNISTD_H' confdefs. + esac + RPM_CHECK_LIB( + [OSSP uuid], [uuid], +- [ossp-uuid uuid], [uuid_import], [uuid.h], ++ [ossp-uuid], [uuid_import], [uuid.h], + [no,external:none], [], + [ dnl # enable OSSP uuid native API support for embedded Lua + 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 @@ +Add the ability to query the packageorigin + +Written by jbj at rpm5.org + +Upstream-Status: Inappropriate [not author] + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/rpmdb/hdrfmt.c +=================================================================== +--- rpm-5.4.14.orig/rpmdb/hdrfmt.c ++++ rpm-5.4.14/rpmdb/hdrfmt.c +@@ -2409,8 +2409,10 @@ static int pkgoriginTag(Header h, HE_t h + int rc = 1; + + he->tag = RPMTAG_PACKAGEORIGIN; +- if (!headerGet(h, he, HEADERGET_NOEXTENSION) +- && (origin = headerGetOrigin(h)) != NULL) ++ /* XXX two sources for tag data: what search precedence? */ ++ if (headerGet(h, he, HEADERGET_NOEXTENSION)) ++ rc = 0; ++ else if ((origin = headerGetOrigin(h)) != NULL) + { + he->t = RPM_STRING_TYPE; + 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 @@ +If we run builds on a filesystem with 64 bit inodes like XFS, we need to +map the inode numbers to something 32 bit since the cpio header only allows +for 32 bit inode values. If we don't do this: + +#define SET_NUM_FIELD(phys, val, space) \ + sprintf(space, "%8.8lx", (unsigned long) (val)); \ + memcpy(phys, space, 8) + +from cpio.c will print larger that 8 character values and then truncate the +LSBs. This generates cpio files where hardlinked files may have the same +inode number. The resulting rpms are then corrupted. + +There is a separate patch for the crash the identical inode numbers causes +when extracting the rpm. + +Patch taken from http://git.pld-linux.org/?p=packages/rpm.git;a=commitdiff;h=10526c23aac60b7b636e4c93862887dbef8e8f15 + +RP 2014/6/10 + +Upstream-Status: Pending + +Index: rpm-5.4.14/build/files.c +=================================================================== +--- rpm-5.4.14.orig/build/files.c ++++ rpm-5.4.14/build/files.c +@@ -1328,6 +1328,26 @@ static rpmuint32_t getDigestAlgo(Header + return dalgo; + } + ++static int isHardLink(FileListRec flp, FileListRec tlp) ++{ ++ return ((S_ISREG(flp->fl_mode) && S_ISREG(tlp->fl_mode)) && ++ ((flp->fl_nlink > 1) && (flp->fl_nlink == tlp->fl_nlink)) && ++ (flp->fl_ino == tlp->fl_ino) && ++ (flp->fl_dev == tlp->fl_dev)); ++} ++ ++static int seenHardLink(FileList fl, FileListRec flp, ino_t *fileid) ++{ ++ FileListRec ilp; ++ for (ilp = fl->fileList; ilp < flp; ilp++) { ++ if (isHardLink(flp, ilp)) { ++ *fileid = ilp - fl->fileList; ++ return 1; ++ } ++ } ++ return 0; ++} ++ + /** + * Add file entries to header. + * @todo Should directories have %doc/%config attributes? (#14531) +@@ -1374,6 +1394,7 @@ memset(buf, 0, sizeof(buf)); /* XXX valg + + for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) { + const char *s; ++ ino_t fileid = flp - fl->fileList; + + /* Merge duplicate entries. */ + while (i < (fl->fileListRecsUsed - 1) && +@@ -1436,6 +1457,13 @@ memset(buf, 0, sizeof(buf)); /* XXX valg + /* Leave room for both dirname and basename NUL's */ + dpathlen += (strlen(flp->diskURL) + 2); + ++ /* Excludes and dupes have been filtered out by now. */ ++ if (S_ISREG(flp->fl_mode)) { ++ if (flp->fl_nlink == 1 || !seenHardLink(fl, flp, &fileid)) { ++ fl->totalFileSize += flp->fl_size; ++ } ++ } ++ + /* + * Make the header, the OLDFILENAMES will get converted to a + * compressed file list write before we write the actual package to +@@ -1518,7 +1546,11 @@ memset(buf, 0, sizeof(buf)); /* XXX valg + + /* XXX Hash instead of 64b->32b truncate to prevent aliasing. */ + { ino_t _ino = flp->fl_ino; ++ /* don't use hash here, as hash collisions which happen on large packages ++ cause bus errors in rpmbuild + ui32 = hashFunctionString(0, &_ino, sizeof(_ino)); ++ */ ++ ui32 = fileid + 1; + } + he->tag = RPMTAG_FILEINODES; + he->t = RPM_UINT32_TYPE; +@@ -1751,39 +1783,6 @@ if (_rpmbuildFlags & 4) { + IOSM_MAP_TYPE | IOSM_MAP_MODE | IOSM_MAP_UID | IOSM_MAP_GID; + if (isSrc) + fi->fmapflags[i] |= IOSM_FOLLOW_SYMLINKS; +- +- if (S_ISREG(flp->fl_mode)) { +- int bingo = 1; +- /* Hard links need be tallied only once. */ +- if (flp->fl_nlink > 1) { +- FileListRec jlp = flp + 1; +- int j = i + 1; +- for (; (unsigned)j < fi->fc; j++, jlp++) { +- /* follow outer loop logic */ +- while (((jlp - fl->fileList) < (fl->fileListRecsUsed - 1)) && +- !strcmp(jlp->fileURL, jlp[1].fileURL)) +- jlp++; +- if (jlp->flags & RPMFILE_EXCLUDE) { +- j--; +- /*@innercontinue@*/ continue; +- } +- if (jlp->flags & RPMFILE_GHOST) +- /*@innercontinue@*/ continue; +- if (!S_ISREG(jlp->fl_mode)) +- /*@innercontinue@*/ continue; +- if (flp->fl_nlink != jlp->fl_nlink) +- /*@innercontinue@*/ continue; +- if (flp->fl_ino != jlp->fl_ino) +- /*@innercontinue@*/ continue; +- if (flp->fl_dev != jlp->fl_dev) +- /*@innercontinue@*/ continue; +- bingo = 0; /* don't tally hardlink yet. */ +- /*@innerbreak@*/ break; +- } +- } +- if (bingo) +- fl->totalFileSize += flp->fl_size; +- } + } + + ui32 = fl->totalFileSize; +Index: rpm-5.4.14/lib/fsm.c +=================================================================== +--- rpm-5.4.14.orig/lib/fsm.c ++++ rpm-5.4.14/lib/fsm.c +@@ -904,6 +904,7 @@ int fsmMapAttrs(IOSM_t fsm) + + if (fi && i >= 0 && i < (int) fi->fc) { + mode_t perms = (S_ISDIR(st->st_mode) ? fi->dperms : fi->fperms); ++ ino_t finalInode = (fi->finodes ? (ino_t)fi->finodes[i] : 0); + mode_t finalMode = (fi->fmodes ? (mode_t)fi->fmodes[i] : perms); + dev_t finalRdev = (dev_t)(fi->frdevs ? fi->frdevs[i] : 0); + rpmuint32_t finalMtime = (fi->fmtimes ? fi->fmtimes[i] : 0); +@@ -943,6 +944,7 @@ int fsmMapAttrs(IOSM_t fsm) + if ((S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) + && st->st_nlink == 0) + st->st_nlink = 1; ++ st->st_ino = finalInode; + st->st_rdev = finalRdev; + st->st_mtime = finalMtime; + } 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 @@ +pkgconfigdeps.sh: Change to restricting pkgconfig to the local directory + +Using PKG_CONFIG_PATH will allow pkg-config to fall back to the system paths, +we don't want this as it may lead to inaccurate results in some corner cases. + +PKG_CONFIG_LIBDIR will ensure pkg-config stays within the install directory. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/scripts/pkgconfigdeps.sh +=================================================================== +--- rpm-5.4.14.orig/scripts/pkgconfigdeps.sh ++++ rpm-5.4.14/scripts/pkgconfigdeps.sh +@@ -18,8 +18,8 @@ case $1 in + *.pc) + # Query the dependencies of the package. + DIR=`dirname ${filename}` +- PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig" +- export PKG_CONFIG_PATH ++ PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig" ++ export PKG_CONFIG_LIBDIR + $pkgconfig --print-provides "$filename" 2> /dev/null | while read n r v ; do + [ -n "$n" ] || continue + # We have a dependency. Make a note that we need the pkgconfig +@@ -42,8 +42,8 @@ case $1 in + [ -n "$oneshot" ] && echo "$oneshot"; oneshot="" + # Query the dependencies of the package. + DIR=`dirname ${filename}` +- PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig" +- export PKG_CONFIG_PATH ++ PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig" ++ export PKG_CONFIG_LIBDIR + $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do + [ -n "$n" ] || continue + 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 @@ +Don't add the first line of /etc/rpm/platform to the list of patterns +to match when computing an arch score, use it just for getting +information about the platform (cpu/vendor/os). Fixes #3864. + +Upstream-Status: Inappropriate [embedded specific] + +Index: rpm-5.4.14/lib/rpmrc.c +=================================================================== +--- rpm-5.4.14.orig/lib/rpmrc.c ++++ rpm-5.4.14/lib/rpmrc.c +@@ -510,6 +510,7 @@ static rpmRC rpmPlatform(const char * pl + #endif + } + ++#if !defined(RPM_VENDOR_OE) /* Skip the explicit-platform */ + #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */ + /* do not use vendor and GNU attribution */ + p = rpmExpand("%{_host_cpu}-%{_host_os}", NULL); +@@ -520,7 +521,8 @@ static rpmRC rpmPlatform(const char * pl + #endif + xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre); + p = _free(p); +- ++#endif ++ + init_platform++; + } + 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 @@ +Fix up platform and related sysinfo file loading. + +Upstream-Status: Pending + +This ensures that RPM knows the compatible set of package types at all times. + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/lib/depends.c +=================================================================== +--- rpm-5.4.14.orig/lib/depends.c ++++ rpm-5.4.14/lib/depends.c +@@ -250,7 +250,7 @@ static int rpmtsAddUpgrades(rpmts ts, rp + he->p.ptr = _free(he->p.ptr); + } + +-#if defined(RPM_VENDOR_WINDRIVER) ++#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE) + /* + * If we're capable of installing multiple colors + * but at least one of the packages are white (0), we +@@ -507,7 +507,7 @@ assert(lastx >= 0 && lastx < ts->orderCo + return 0; + } + +-#if defined(RPM_VENDOR_WINDRIVER) ++#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE) + /* Is "compat" compatible w/ arch? */ + int _isCompatibleArch(const char * arch, const char * compat) + { +@@ -663,7 +663,7 @@ assert(he->p.str != NULL); + + if (arch == NULL || (parch = rpmteA(p)) == NULL) + continue; +-#if defined(RPM_VENDOR_WINDRIVER) ++#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE) + /* XXX hackery for alias matching. */ + if (!_isCompatibleArch(arch, parch)) + continue; +@@ -829,6 +829,12 @@ int rpmtsAddEraseElement(rpmts ts, Heade + return rc; + } + ++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE) ++#define _ETC_RPM_SYSINFO "%{_etcrpm}/sysinfo" ++#else ++#define _ETC_RPM_SYSINFO SYSCONFIGDIR "/sysinfo" ++#endif ++ + /*@only@*/ /*@null@*/ /*@unchecked@*/ + static char *sysinfo_path = NULL; + +@@ -1311,7 +1317,7 @@ retry: + sysinfo_path = rpmExpand("%{?_rpmds_sysinfo_path}", NULL); + if (!(sysinfo_path != NULL && *sysinfo_path == '/')) { + sysinfo_path = _free(sysinfo_path); +- sysinfo_path = xstrdup(SYSCONFIGDIR "/sysinfo"); ++ sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL); + } + } + +Index: rpm-5.4.14/lib/rpmds.c +=================================================================== +--- rpm-5.4.14.orig/lib/rpmds.c ++++ rpm-5.4.14/lib/rpmds.c +@@ -1759,7 +1759,7 @@ int rpmdsSysinfo(rpmPRCO PRCO, const cha + /*@-observertrans @*/ + _sysinfo_path = _free(_sysinfo_path); + /*@=observertrans @*/ +- _sysinfo_path = xstrdup(_ETC_RPM_SYSINFO); ++ _sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL); + } + } + /*@=modobserver@*/ +Index: rpm-5.4.14/lib/rpmrc.c +=================================================================== +--- rpm-5.4.14.orig/lib/rpmrc.c ++++ rpm-5.4.14/lib/rpmrc.c +@@ -38,7 +38,13 @@ + static const char * configTarget = NULL; + + /*@observer@*/ /*@unchecked@*/ +-static const char * platform = SYSCONFIGDIR "/platform"; ++#if defined(RPM_VENDOR_WINDRIVER) ++#define _ETC_RPM_PLATFORM "%{_etcrpm}/platform" ++#else ++#define _ETC_RPM_PLATFORM SYSCONFIGDIR "/platform" ++#endif ++ ++static const char * _platform = NULL; + + /*@only@*/ /*@relnull@*/ /*@unchecked@*/ + void * platpat = NULL; +@@ -694,16 +700,17 @@ static void defaultMachine(/*@out@*/ con + int rc; + + while (!gotDefaults) { +-#if defined(RPM_VENDOR_WINDRIVER) +- const char * _platform = rpmGetPath(__etcrpm, "/platform", NULL); +-#else +- const char * _platform = platform; +-#endif ++ if (_platform == NULL) { ++ _platform = rpmExpand("%{?_rpmrc_platform_path}", NULL); ++ /* XXX may need to validate path existence somewhen. */ ++ if (!(_platform != NULL && *_platform == '/')) { ++ _platform = _free(_platform); ++ _platform = rpmExpand(_ETC_RPM_PLATFORM, NULL); ++ } ++ } + CVOG_t cvog = NULL; + #if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */ + const char *cp; +-#endif +-#if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */ + /* utsname fields on some platforms (like HP-UX) are very small + (just about 8 characters). This is too small for OpenPKG, so cheat! */ + rc = uname(&un_real); +@@ -780,9 +787,7 @@ static void defaultMachine(/*@out@*/ con + if (cp != NULL && cp != _platform) + cp = _free(cp); + #endif +-#if defined(RPM_VENDOR_WINDRIVER) + _platform = _free(_platform); +-#endif + + if (configTarget && !parseCVOG(configTarget, &cvog) && cvog != NULL) { + gotDefaults = 1; +@@ -1101,6 +1106,8 @@ int rpmReadConfigFiles(/*@unused@*/ cons + + #ifdef PREMACROFILES + if (rpmReadRC(PREMACROFILES)) return -1; ++#else ++ if (rpmReadRC(NULL)) return -1; + #endif + + /* 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 @@ +Fix up platform and related sysinfo file loading (part 2). + +Upstream-Status: Pending + +We need to ensure that we set the _gnu flag somehow. We do this by reading +from the platform file, and setting a new _platform_gnu and related vars. + +The default values of _host_cpu, _host_vendor and _host_os are changed to +reference either the automatically determined _target_... or _platform_... +values. The macros file uses the configure time defaults in _platform_... +versions have not been defined. This preserves existing behavior, but +ensures reasonable defaults are always available. + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/lib/rpmrc.c +=================================================================== +--- rpm-5.4.14.orig/lib/rpmrc.c ++++ rpm-5.4.14/lib/rpmrc.c +@@ -328,10 +328,15 @@ static void setDefaults(void) + /*@modifies rpmGlobalMacroContext, internalState @*/ + { + +-#if defined(RPM_VENDOR_WINDRIVER) ++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE) + addMacro(NULL, "_usrlibrpm", NULL, __usrlibrpm, RMIL_DEFAULT); + addMacro(NULL, "_etcrpm", NULL, __etcrpm, RMIL_DEFAULT); + addMacro(NULL, "_vendor", NULL, "%{?_host_vendor}%{!?_host_vendor:wrs}", RMIL_DEFAULT); ++ ++ addMacro(NULL, "_host_cpu", NULL, "%{?_platform_cpu}%{!?_platform_cpu:%{?_target_cpu}}", RMIL_DEFAULT); ++ addMacro(NULL, "_host_vendor", NULL, "%{?_platform_vendor}%{!?_platform_cpu:%{?_target_vendor}}", RMIL_DEFAULT); ++ addMacro(NULL, "_host_os", NULL, "%{?_platform_os}%{!?_platform_os:%{?_target_os}}", RMIL_DEFAULT); ++ addMacro(NULL, "_host_gnu", NULL, "%{?_platform_gnu}%{!?_platform_gnu:%{?_gnu}}", RMIL_DEFAULT); + #endif + + addMacro(NULL, "_usr", NULL, USRPREFIX, RMIL_DEFAULT); +@@ -487,9 +492,22 @@ static rpmRC rpmPlatform(const char * pl + } + + if (!parseCVOG(p, &cvog) && cvog != NULL) { ++#if defined(RPM_VENDOR_OE) ++ char * _gnu = NULL; ++ ++ addMacro(NULL, "_platform_cpu", NULL, cvog->cpu, -1); ++ addMacro(NULL, "_platform_vendor", NULL, cvog->vendor, -1); ++ addMacro(NULL, "_platform_os", NULL, cvog->os, -1); ++ ++ if (cvog->gnu && cvog->gnu[0] != '\0') ++ _gnu = rpmExpand("-", cvog->gnu, NULL); ++ ++ addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1); ++#else + addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1); + addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1); + addMacro(NULL, "_host_os", NULL, cvog->os, -1); ++#endif + } + + #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */ +Index: rpm-5.4.14/macros/macros.in +=================================================================== +--- rpm-5.4.14.orig/macros/macros.in ++++ rpm-5.4.14/macros/macros.in +@@ -900,9 +900,9 @@ $_arbitrary_tags_tests Foo:Bar + %_os @RPMCANONOS@ + %_gnu @RPMCANONGNU@ + +-%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu} +-%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu} +-%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu} ++%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}} ++%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}} ++%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}} + + #============================================================================== + # ---- configure macros. +@@ -945,9 +945,10 @@ $_arbitrary_tags_tests Foo:Bar + %_build_os %{_host_os} + %_host @host@ + %_host_alias @host_alias@%{nil} +-%_host_cpu @host_cpu@ +-%_host_vendor @host_vendor@ +-%_host_os @host_os@ ++%_host_cpu %{?_platform_cpu}%{!?_platform_cpu:%{_arch}} ++%_host_vendor %{?_platform_vendor}%{!?_platform_vendor:%{_vendor}} ++%_host_os %{?_platform_os}%{!?_platform_os:%{_os}} ++%_host_gnu %{?_platform_gnu}%{!?_platform_gnu:%{_gnu}} + %_target %{_host} + %_target_alias %{_host_alias} + %_target_cpu %{_host_cpu} +Index: rpm-5.4.14/python/rpmmodule.c +=================================================================== +--- rpm-5.4.14.orig/python/rpmmodule.c ++++ rpm-5.4.14/python/rpmmodule.c +@@ -65,8 +65,8 @@ static PyObject * archScore(PyObject * s + if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &arch)) + return NULL; + +-#if defined(RPM_VENDOR_WINDRIVER) +- platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_gnu}", NULL); ++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE) ++ platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}", NULL); + #else + platform = rpmExpand(arch, "-", "%{_vendor}", "-", "%{_os}", NULL); + #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 @@ +python/rpmmodules.c: Change the way the python module loads the RPM config + +In order to support the RPM_VENDOR_WINDRIVER enhancement of dynamic +runtime relocation paths, we need to call rpmcliInit instead of +rpmReadConfigFiles. The rpmcliInit will end up calling rpmReadConfigFiles +after the necessary relocation processing (if enabled). + +Code derived from changes suggested by Paul Eggleton. + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/python/rpmmodule.c +=================================================================== +--- rpm-5.4.14.orig/python/rpmmodule.c ++++ rpm-5.4.14/python/rpmmodule.c +@@ -392,7 +392,8 @@ void init_rpm(void) + if (Py_AtExit(rpm_exithook) == -1) + return; + +- rpmReadConfigFiles(NULL, NULL); ++ const char *argv[1] = {"rpmmodule", 0}; ++ rpmcliInit(1, argv, NULL); + + d = PyModule_GetDict(m); + 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 @@ +chroot: realpath is required before expanding _dbpath + +_usr turned out to be a relative path to support dyanmic config, but it's +being used somewhere as a indicator to locate substrings, so we must get +the real path of it in advance. + +Upstream-Status: Inapproriate (OpenEmbedded specific) + +Signed-off-by: Ming Liu + +diff -urpN a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c +--- a/rpmio/rpmrpc.c ++++ b/rpmio/rpmrpc.c +@@ -257,7 +257,9 @@ int Open(const char * path, int flags, m + /* XXX if the open(2) fails, try to strip a possible chroot(2) prefix. */ + if (fdno < 0 && errno == ENOENT) { + const char *dbpath = rpmExpand("%{?_dbpath}/", NULL); +- const char * fn = strstr(path + 1, dbpath); ++ char resolved_dbpath[PATH_MAX]; ++ realpath(dbpath, resolved_dbpath); ++ const char * fn = strstr(path + 1, resolved_dbpath); + if (fn) + fdno = open(fn, flags, mode); + 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 @@ +macros: Use dyanmic config vs hard coded settings + +When the dynamic, runtime relocation is enables we need to make sure that the +RPM macro file does not override the dynamic settings. Fix this by forcing the +dynamic version to be used in all cases. + +Upstream-Status: Inapproriate (OpenEmbedded specific) + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/macros/macros.in +=================================================================== +--- rpm-5.4.14.orig/macros/macros.in ++++ rpm-5.4.14/macros/macros.in +@@ -27,11 +27,12 @@ + #============================================================================== + # ---- filesystem macros. + # +-%_usr @usrprefix@ ++%_usr %{_usrlibrpm}/../.. + %_usrsrc %{_usr}/src +-%_var @varprefix@ +-%_usrlibrpm @USRLIBRPM@ +-%_etcrpm @SYSCONFIGDIR@ ++%_var %{_usr}/../var ++# The dynamic relocation code sets the following two items ++#%_usrlibrpm @USRLIBRPM@ ++#%_etcrpm @SYSCONFIGDIR@ + + %__objext @objext@ + %__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 @@ +Index: rpm-5.4.14/syck/lib/syck.h +=================================================================== +--- rpm-5.4.14.orig/syck/lib/syck.h ++++ rpm-5.4.14/syck/lib/syck.h +@@ -621,9 +621,6 @@ long syck_seq_count( SyckNode *seq ) + */ + void syckerror( char *msg ) + /*@*/; +-int syckparse( void * ) +- /*@globals fileSystem @*/ +- /*@modifies fileSystem @*/; + /* XXX union YYSTYPE *sycklval has issues on Mac OS X. */ + int sycklex( void *_sycklval, SyckParser *parser ) + /*@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 @@ +lib/rpmts.c: Ensure that we check both providename and filepaths + +When looking up a missing dependencies, such as /bin/sh, we need to lookup +in both the providename and filepaths DB, not just the filepaths DB. + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/lib/rpmts.c +=================================================================== +--- rpm-5.4.14.orig/lib/rpmts.c ++++ rpm-5.4.14/lib/rpmts.c +@@ -410,8 +410,8 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __ + if (sdb == NULL) + continue; + +- /* Look for a matching Provides: in suggested universe. */ +- rpmtag = (*keyp == '/' ? RPMTAG_FILEPATHS : RPMTAG_PROVIDENAME); ++ rpmtag = RPMTAG_PROVIDENAME; ++ do { + mi = rpmmiInit(sdb, rpmtag, keyp, keylen); + while ((h = rpmmiNext(mi)) != NULL) { + size_t hnamelen; +@@ -446,6 +446,15 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __ + bhnamelen = hnamelen; + } + mi = rpmmiFree(mi); ++ ++ if (bh == NULL && *keyp == '/' && rpmtag == RPMTAG_PROVIDENAME) { ++ rpmtag = RPMTAG_FILEPATHS; ++ continue; ++ } ++ ++ break; ++ } while (1); ++ + } + + /* 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 @@ +rpmpgp.c: Add missing if defs around crypto implementations + +Without these, the system will error trying to find the correct crypto +library to use. + +Upstream-status: Pending + +Signed-off-by: Mark Hatle + +Index: rpm/rpmio/rpmpgp.c +=================================================================== +--- rpm.orig/rpmio/rpmpgp.c ++++ rpm/rpmio/rpmpgp.c +@@ -1339,16 +1339,26 @@ int pgpExportPubkey(pgpDig dig) + { + int rc = 0; /* assume failure */ + ++#if defined(WITH_BEECRYPT) + if (pgpImplVecs == &rpmbcImplVecs) + rc = rpmbcExportPubkey(dig); ++#endif ++#if defined(WITH_SSL) + if (pgpImplVecs == &rpmsslImplVecs) + rc = rpmsslExportPubkey(dig); ++#endif ++#if defined(WITH_NSS) + if (pgpImplVecs == &rpmnssImplVecs) + rc = rpmnssExportPubkey(dig); ++#endif ++#if defined(WITH_GCRYPT) + if (pgpImplVecs == &rpmgcImplVecs) + rc = rpmgcExportPubkey(dig); ++#endif ++#if defined(WITH_TOMCRYPT) + if (pgpImplVecs == &rpmltcImplVecs) + rc = rpmltcExportPubkey(dig); ++#endif + return rc; + } + +@@ -1356,16 +1366,26 @@ int pgpExportSignature(pgpDig dig, DIGES + { + int rc = 0; /* assume failure */ + ++#if defined(WITH_BEECRYPT) + if (pgpImplVecs == &rpmbcImplVecs) + rc = rpmbcExportSignature(dig, ctx); ++#endif ++#if defined(WITH_SSL) + if (pgpImplVecs == &rpmsslImplVecs) + rc = rpmsslExportSignature(dig, ctx); ++#endif ++#if defined(WITH_NSS) + if (pgpImplVecs == &rpmnssImplVecs) + rc = rpmnssExportSignature(dig, ctx); ++#endif ++#if defined(WITH_GCRYPT) + if (pgpImplVecs == &rpmgcImplVecs) + rc = rpmgcExportSignature(dig, ctx); ++#endif ++#if defined(WITH_TOMCRYPT) + if (pgpImplVecs == &rpmltcImplVecs) + rc = rpmltcExportSignature(dig, ctx); ++#endif + return rc; + } + 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 @@ +Enable a cross-install scriptlet helper. + +The helper is called from outside of the chroot with the arguments: + +