diff options
Diffstat (limited to 'meta/recipes-devtools/rpm/files')
23 files changed, 323 insertions, 1230 deletions
diff --git a/meta/recipes-devtools/rpm/files/0001-Add-PYTHON_ABI-when-searching-for-python-libraries.patch b/meta/recipes-devtools/rpm/files/0001-Add-PYTHON_ABI-when-searching-for-python-libraries.patch deleted file mode 100644 index b809332f21..0000000000 --- a/meta/recipes-devtools/rpm/files/0001-Add-PYTHON_ABI-when-searching-for-python-libraries.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 36cf0ff26ece53e529e8b4f2d2f09acd8794b055 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Fri, 24 Mar 2017 15:35:47 +0200 -Subject: [PATCH] Add PYTHON_ABI when searching for python libraries. - -It has a value of 'm' when using Python3, and so without it -configure will not find the libraries. - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 9c58467c1..a506ec819 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -642,7 +642,7 @@ AS_IF([test "$enable_python" = yes],[ - ]) - CPPFLAGS="$save_CPPFLAGS" - save_LIBS="$LIBS" -- AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION} python],[ -+ AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION}${PYTHON_ABI} python],[ - WITH_PYTHON_LIB="$ac_res" - ],[AC_MSG_ERROR([missing python library]) - ]) --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch b/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch index ac6dcaf101..25aa69d7da 100644 --- a/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch +++ b/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch @@ -1,4 +1,4 @@ -From e3eff024826550aec4a6a5baef7210a29faf299d Mon Sep 17 00:00:00 2001 +From f4cf90b5a298d6a3199e8b4c07f520aaf593ce2b Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Thu, 9 Mar 2017 18:54:02 +0200 Subject: [PATCH] Add a color setting for mips64_n32 binaries @@ -6,15 +6,15 @@ Subject: [PATCH] Add a color setting for mips64_n32 binaries Upstream-Status: Inappropriate [oe-core specific] Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> --- - build/rpmfc.c | 1 + + build/rpmfc.c | 4 ++++ rpmrc.in | 2 ++ - 2 files changed, 3 insertions(+) + 2 files changed, 6 insertions(+) diff --git a/build/rpmfc.c b/build/rpmfc.c -index d38a10916..c8e2f876a 100644 +index 4b67a9bae..ed7e4e623 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c -@@ -622,6 +622,7 @@ exit: +@@ -660,6 +660,7 @@ exit: static const struct rpmfcTokens_s rpmfcTokens[] = { { "directory", RPMFC_INCLUDE }, @@ -22,11 +22,21 @@ index d38a10916..c8e2f876a 100644 { "ELF 32-bit", RPMFC_ELF32|RPMFC_INCLUDE }, { "ELF 64-bit", RPMFC_ELF64|RPMFC_INCLUDE }, +@@ -1158,6 +1159,9 @@ static uint32_t getElfColor(const char *fn) + color = RPMFC_ELF32; + break; + } ++ if (ehdr.e_machine == EM_MIPS || ehdr.e_machine == EM_MIPS_RS3_LE) ++ if (ehdr.e_flags & EF_MIPS_ABI2) ++ color = RPMFC_ELFMIPSN32; + } + if (elf) + elf_end(elf); diff --git a/rpmrc.in b/rpmrc.in -index abc08fc31..f5bc820d8 100644 +index 8646a966b..7349fdfd3 100644 --- a/rpmrc.in +++ b/rpmrc.in -@@ -133,6 +133,8 @@ archcolor: mipsr6el 1 +@@ -142,6 +142,8 @@ archcolor: mipsr6el 1 archcolor: mips64r6 2 archcolor: mips64r6el 2 @@ -35,6 +45,3 @@ index abc08fc31..f5bc820d8 100644 archcolor: m68k 1 archcolor: m68kmint 1 --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0001-CMakeLists.txt-look-for-lua-with-pkg-config-rather-t.patch b/meta/recipes-devtools/rpm/files/0001-CMakeLists.txt-look-for-lua-with-pkg-config-rather-t.patch new file mode 100644 index 0000000000..e4edc884b1 --- /dev/null +++ b/meta/recipes-devtools/rpm/files/0001-CMakeLists.txt-look-for-lua-with-pkg-config-rather-t.patch @@ -0,0 +1,27 @@ +From c39a074ff3c4d21c100d387661c7d725b5eae7b0 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex@linutronix.de> +Date: Wed, 29 Nov 2023 14:06:15 +0100 +Subject: [PATCH] CMakeLists.txt: look for lua with pkg-config rather than + cmake modules + +Otherwise cmake will try to find libm, badly, and fail. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex@linutronix.de> +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4a383ceba..ed847c09a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -190,7 +190,7 @@ set(REQFUNCS + ) + + find_package(PkgConfig REQUIRED) +-find_package(Lua 5.2 REQUIRED) ++pkg_check_modules(LUA REQUIRED IMPORTED_TARGET lua>=5.2) + find_package(ZLIB REQUIRED) + find_package(BZip2) + find_package(Iconv) diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch index 80e2f0fad7..d0ed711086 100644 --- a/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch +++ b/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch @@ -1,4 +1,4 @@ -From 87cfc0db1ed6fe381a5ed5f0016d8c3344a31a11 Mon Sep 17 00:00:00 2001 +From 86e585cc0dd06dfa20f584af8b59d52a59accb45 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Mon, 9 Jan 2017 18:52:11 +0200 Subject: [PATCH] Do not add an unsatisfiable dependency when building rpms in @@ -14,20 +14,17 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 1 file changed, 4 deletions(-) diff --git a/build/pack.c b/build/pack.c -index 1261cdbba..bb2d6f4f6 100644 +index f7dac6d9a..f382c7da0 100644 --- a/build/pack.c +++ b/build/pack.c -@@ -595,10 +595,6 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) - headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16); - } +@@ -711,10 +711,6 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch + headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16); + } + +- if (cheating) { +- (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1"); +- } +- + if ((rc = getPkgFilename(pkg->header, filename))) + return rc; -- if (cheating) { -- (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1"); -- } -- - { char *binFormat = rpmGetPath("%{_rpmfilename}", NULL); - char *binRpm, *binDir; - binRpm = headerFormat(pkg->header, binFormat, &errorString); --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch index 1f61acaf43..b571a0ae8c 100644 --- a/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch +++ b/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch @@ -1,36 +1,34 @@ -From d82691b8d58201dd03e30585daacd8ffd1556ae2 Mon Sep 17 00:00:00 2001 +From 73d6841d9ef2a8ac7bd63f9645a3efe8038dfdd4 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Mon, 27 Feb 2017 09:43:30 +0200 Subject: [PATCH] Do not hardcode "lib/rpm" as the installation path for default configuration and macros. -Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/263] +Upstream-Status: Denied [https://github.com/rpm-software-management/rpm/pull/263] Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - --- - configure.ac | 2 +- - macros.in | 2 +- - rpm.am | 4 ++-- - 3 files changed, 4 insertions(+), 4 deletions(-) + CMakeLists.txt | 2 +- + macros.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) -diff --git a/configure.ac b/configure.ac -index 4f3be8770..92ffd3d68 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -875,7 +875,7 @@ else - usrprefix=$prefix - fi +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7808115c1..4a383ceba 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -33,7 +33,7 @@ option(WITH_IMAEVM "Build with IMA support" OFF) + option(WITH_FAPOLICYD "Build with fapolicyd support" ON) + option(WITH_READLINE "Build with readline support" ON) --RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`" -+RPMCONFIGDIR="`echo ${libdir}/rpm`" - AC_SUBST(RPMCONFIGDIR) +-set(RPM_CONFIGDIR "${CMAKE_INSTALL_PREFIX}/lib/rpm" CACHE PATH "rpm home") ++set(RPM_CONFIGDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/rpm" CACHE PATH "rpm home") + set(RPM_VENDOR "vendor" CACHE STRING "rpm vendor string") - AC_SUBST(OBJDUMP) + # Emulate libtool versioning. Before a public release: diff --git a/macros.in b/macros.in -index c6d5a6b03..84ae25275 100644 +index b49ffaad4..3acbe78f6 100644 --- a/macros.in +++ b/macros.in -@@ -877,7 +877,7 @@ package or when debugging this package.\ +@@ -969,7 +969,7 @@ Supplements: (%{name} = %{version}-%{release} and langpacks-%{1})\ %_sharedstatedir %{_prefix}/com %_localstatedir %{_prefix}/var %_lib lib @@ -39,23 +37,3 @@ index c6d5a6b03..84ae25275 100644 %_includedir %{_prefix}/include %_infodir %{_datadir}/info %_mandir %{_datadir}/man -diff --git a/rpm.am b/rpm.am -index 1f43ad8a0..6854ff6ba 100644 ---- a/rpm.am -+++ b/rpm.am -@@ -1,10 +1,10 @@ - # Internal binaries - ## HACK: It probably should be $(libexecdir)/rpm or $(libdir)/rpm --rpmlibexecdir = $(prefix)/lib/rpm -+rpmlibexecdir = $(libdir)/rpm - - # Host independent config files - ## HACK: it probably should be $(datadir)/rpm --rpmconfigdir = $(prefix)/lib/rpm -+rpmconfigdir = $(libdir)/rpm - - # Libtool version (current-revision-age) for all our libraries - rpm_version_info = 7:0:0 --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch index 96eb418952..796088df53 100644 --- a/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch +++ b/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch @@ -1,4 +1,4 @@ -From 35381b6cd6c1b571bf7e6b0640de0f54dbf94386 Mon Sep 17 00:00:00 2001 +From e210458d125793915abce30420d866a30305c37a Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Tue, 10 Jan 2017 14:11:30 +0200 Subject: [PATCH] Do not read config files from $HOME @@ -10,29 +10,26 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/rpmrc.c b/lib/rpmrc.c -index 4ed991321..19fe80f98 100644 +index 9437a0ff1..483585ae4 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c -@@ -458,8 +458,7 @@ static void setDefaults(void) +@@ -459,8 +459,7 @@ static void setDefaults(void) if (!defrcfiles) { defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":", - confdir, "/" RPMCANONVENDOR "/rpmrc", ":", + confdir, "/" RPM_VENDOR "/rpmrc", ":", - SYSCONFDIR "/rpmrc", ":", - "~/.rpmrc", NULL); -+ SYSCONFDIR "/rpmrc", ":"); ++ SYSCONFDIR "/rpmrc", NULL); } #ifndef MACROFILES -@@ -471,8 +470,7 @@ static void setDefaults(void) - confdir, "/" RPMCANONVENDOR "/macros", ":", +@@ -472,8 +471,7 @@ static void setDefaults(void) + confdir, "/" RPM_VENDOR "/macros", ":", SYSCONFDIR "/rpm/macros.*", ":", SYSCONFDIR "/rpm/macros", ":", - SYSCONFDIR "/rpm/%{_target}/macros", ":", - "~/.rpmmacros", NULL); -+ SYSCONFDIR "/rpm/%{_target}/macros", ":"); ++ SYSCONFDIR "/rpm/%{_target}/macros", NULL); } #else macrofiles = MACROFILES; --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch index a38675f89c..328fbf86ac 100644 --- a/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch +++ b/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch @@ -1,7 +1,7 @@ -From ffb5301a8594140ad7a58bc0f2053be8ca2b2946 Mon Sep 17 00:00:00 2001 +From a8fe7a7a2e41c9f127ed26407d57076babcb89e8 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Fri, 20 Jan 2017 13:32:06 +0200 -Subject: [PATCH 1/2] Do not reset the PATH environment variable before running +Subject: [PATCH] Do not reset the PATH environment variable before running scriptlets. We add lots of native stuff into it and scriptlets rely on that. @@ -13,10 +13,10 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rpmscript.c b/lib/rpmscript.c -index 92f949fa2..7c1aa75a8 100644 +index 57689bb68..7b7e26606 100644 --- a/lib/rpmscript.c +++ b/lib/rpmscript.c -@@ -201,7 +201,7 @@ static void doScriptExec(ARGV_const_t argv, ARGV_const_t prefixes, +@@ -252,7 +252,7 @@ static void doScriptExec(ARGV_const_t argv, ARGV_const_t prefixes, if (ipath && ipath[5] != '%') path = ipath; @@ -25,6 +25,3 @@ index 92f949fa2..7c1aa75a8 100644 free(ipath); } --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch b/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch deleted file mode 100644 index edf9ec0894..0000000000 --- a/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 211c2d11200e6657132c52e7ac68f8c118231262 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Mon, 27 Feb 2017 14:43:21 +0200 -Subject: [PATCH] Fix build with musl C library. - -Upstream-Status: Inappropriate [problem already solved in master branch] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - - -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - configure.ac | 3 ++- - misc/Makefile.am | 3 +-- - misc/rpmxprogname.c | 3 +-- - 3 files changed, 4 insertions(+), 5 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 92ffd3d68..9c58467c1 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -229,6 +229,7 @@ AC_SEARCH_LIBS(dlopen, [dl]) - # Check for libelf library. Prefer external, otherwise none. - WITH_LIBELF_LIB= - AC_CHECK_HEADER([libelf.h]) -+AC_CHECK_HEADERS([error.h], [WITH_ERROR_H=yes]) - AC_CHECK_HEADERS([gelf.h], [ - AC_CHECK_LIB(elf, gelf_getvernaux, [ - AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).]) -@@ -237,7 +238,7 @@ AC_CHECK_HEADERS([gelf.h], [ - ]) - ]) - AC_SUBST(WITH_LIBELF_LIB) --AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes]) -+AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes && test "$WITH_ERROR_H" = yes]) - - AC_CHECK_HEADERS([dwarf.h], [ - WITH_LIBDWARF=yes -diff --git a/misc/Makefile.am b/misc/Makefile.am -index 8bf0093d9..b9db3d31a 100644 ---- a/misc/Makefile.am -+++ b/misc/Makefile.am -@@ -5,10 +5,9 @@ AM_CPPFLAGS += -I$(top_srcdir)/misc - - EXTRA_DIST = \ - fnmatch.c fnmatch.h \ -- rpmxprogname.c rpmxprogname.h \ - stpcpy.c stpncpy.c - - noinst_LTLIBRARIES = libmisc.la - --libmisc_la_SOURCES = fts.c fts.h -+libmisc_la_SOURCES = fts.c fts.h rpmxprogname.c rpmxprogname.h - libmisc_la_LIBADD = @LTLIBOBJS@ -diff --git a/misc/rpmxprogname.c b/misc/rpmxprogname.c -index f89600613..e94625ea8 100644 ---- a/misc/rpmxprogname.c -+++ b/misc/rpmxprogname.c -@@ -13,7 +13,7 @@ char *_rpmxgetprogname(void) - { - const char *empty = ""; - -- if (_rpmxprognam != NULL) /* never return NULL string */ -+ if (_rpmxprogname != NULL) /* never return NULL string */ - return _rpmxprogname; - else - return empty; -@@ -30,4 +30,3 @@ void _rpmxsetprogname(const char *pn) - } - } - --#endif /* _RPMXPROGNAME_H */ --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0001-Split-binary-package-building-into-a-separate-functi.patch b/meta/recipes-devtools/rpm/files/0001-Split-binary-package-building-into-a-separate-functi.patch deleted file mode 100644 index 6e44f0b7fc..0000000000 --- a/meta/recipes-devtools/rpm/files/0001-Split-binary-package-building-into-a-separate-functi.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 721a660a507d6d062e7aecafad886c643970a5d5 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Thu, 25 May 2017 18:15:27 +0300 -Subject: [PATCH 1/4] Split binary package building into a separate function - -So that it can be run as a thread pool task. - -Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - build/pack.c | 33 +++++++++++++++++++++------------ - 1 file changed, 21 insertions(+), 12 deletions(-) - -diff --git a/build/pack.c b/build/pack.c -index 518f4e92a..ccfd614cc 100644 ---- a/build/pack.c -+++ b/build/pack.c -@@ -546,18 +546,13 @@ static rpmRC checkPackages(char *pkgcheck) - return RPMRC_OK; - } - --rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) -+static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int cheating, char** filename) - { -- rpmRC rc; -- const char *errorString; -- Package pkg; -- char *pkglist = NULL; -- -- for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { -- char *fn; -+ const char *errorString; -+ rpmRC rc = RPMRC_OK; - - if (pkg->fileList == NULL) -- continue; -+ return rc; - - if ((rc = processScriptFiles(spec, pkg))) - return rc; -@@ -587,7 +582,7 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) - headerGetString(pkg->header, RPMTAG_NAME), errorString); - return RPMRC_FAIL; - } -- fn = rpmGetPath("%{_rpmdir}/", binRpm, NULL); -+ *filename = rpmGetPath("%{_rpmdir}/", binRpm, NULL); - if ((binDir = strchr(binRpm, '/')) != NULL) { - struct stat st; - char *dn; -@@ -609,14 +604,28 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) - free(binRpm); - } - -- rc = writeRPM(pkg, NULL, fn, NULL); -+ rc = writeRPM(pkg, NULL, *filename, NULL); - if (rc == RPMRC_OK) { - /* Do check each written package if enabled */ -- char *pkgcheck = rpmExpand("%{?_build_pkgcheck} ", fn, NULL); -+ char *pkgcheck = rpmExpand("%{?_build_pkgcheck} ", *filename, NULL); - if (pkgcheck[0] != ' ') { - rc = checkPackages(pkgcheck); - } - free(pkgcheck); -+ } -+ return rc; -+} -+ -+rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) -+{ -+ rpmRC rc; -+ Package pkg; -+ char *pkglist = NULL; -+ -+ for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { -+ char *fn = NULL; -+ rc = packageBinary(spec, pkg, cookie, cheating, &fn); -+ if (rc == RPMRC_OK) { - rstrcat(&pkglist, fn); - rstrcat(&pkglist, " "); - } --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch b/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch index 2be3cb5af3..e4251a1a73 100644 --- a/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch +++ b/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch @@ -1,4 +1,4 @@ -From a6f269f879221f2777169c5f7291322afe6b661b Mon Sep 17 00:00:00 2001 +From 34c0d3263f3e0b366a2320e0823f46673f7ba928 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Tue, 17 Jan 2017 14:07:17 +0200 Subject: [PATCH] When cross-installing, execute package scriptlets without @@ -7,31 +7,53 @@ Subject: [PATCH] When cross-installing, execute package scriptlets without This is triggered only when RPM_NO_CHROOT_FOR_SCRIPTS environment variable is defined. Otherwise they will trigger an explosion of failures, obviously. +Amended 2018-07-03 by Olof Johansson <olofjn@axis.com>: + + Remove leaking temporary scriptlet files + + Since we tell dnf to run rpm with debug output, this will result in rpm not + cleaning up written temporary scriptlet files (same flag controls both + behaviors). This wouldn't have been a problem since we normally would use the + target sysroot also for temporary files, but we need to chroot out to be able + to actually run the rpm scriptlets (purpose of this patch), so the temporary + files are written to the host's /var/tmp/ directory, causing a gradual + resource leakage on the host system for every RPM based do_rootfs task + executed. + + Signed-off-by: Olof Johansson <olofjn@axis.com> + Upstream-Status: Inappropriate [oe-core specific] Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> --- - lib/rpmscript.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) + lib/rpmscript.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/rpmscript.c b/lib/rpmscript.c -index 98d3f420d..b95b5d606 100644 +index 3f6313278..57689bb68 100644 --- a/lib/rpmscript.c +++ b/lib/rpmscript.c -@@ -467,7 +467,13 @@ rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd, +@@ -448,8 +448,7 @@ exit: + Fclose(out); /* XXX dup'd STDOUT_FILENO */ + + if (fn) { +- if (!rpmIsDebug()) +- unlink(fn); ++ unlink(fn); + free(fn); + } + free(mline); +@@ -483,7 +482,13 @@ rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd, if (rc != RPMRC_FAIL) { if (script_type & RPMSCRIPTLET_EXEC) { -- rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc); +- rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, script->nextFileFunc); + if (getenv("RPM_NO_CHROOT_FOR_SCRIPTS") != NULL) { + rpmChrootOut(); -+ rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc); ++ rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, script->nextFileFunc); + rpmChrootIn(); + } else { -+ rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc); ++ rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, script->nextFileFunc); + } } else { - rc = runLuaScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc); + rc = runLuaScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, script->nextFileFunc); } --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0001-When-nice-value-cannot-be-reset-issue-a-notice-inste.patch b/meta/recipes-devtools/rpm/files/0001-When-nice-value-cannot-be-reset-issue-a-notice-inste.patch deleted file mode 100644 index 9648cac7c9..0000000000 --- a/meta/recipes-devtools/rpm/files/0001-When-nice-value-cannot-be-reset-issue-a-notice-inste.patch +++ /dev/null @@ -1,31 +0,0 @@ -From d42ece6fa15b98d7f9221b90b85b78631df2c0a0 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Tue, 14 Feb 2017 13:51:19 +0200 -Subject: [PATCH] When nice value cannot be reset, issue a notice instead of a - warning - -Otherwise build logs on the autobuilder get very clutter, as it -doesn't allow the nice value to be reset for some reason. - -Upstream-Status: Inappropriate [oe specific] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - lib/rpmscript.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/rpmscript.c b/lib/rpmscript.c -index 5e1e99906..3975aead8 100644 ---- a/lib/rpmscript.c -+++ b/lib/rpmscript.c -@@ -347,7 +347,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes, - int ret; - ret = setpriority(PRIO_PROCESS, 0, 0); - if (ret == -1) { -- rpmlog(RPMLOG_WARNING, _("Unable to reset nice value: %s"), -+ rpmlog(RPMLOG_NOTICE, _("Unable to reset nice value: %s\n"), - strerror(errno)); - } - --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0001-build-pack.c-do-not-insert-payloadflags-into-.rpm-me.patch b/meta/recipes-devtools/rpm/files/0001-build-pack.c-do-not-insert-payloadflags-into-.rpm-me.patch new file mode 100644 index 0000000000..2f6397aa8a --- /dev/null +++ b/meta/recipes-devtools/rpm/files/0001-build-pack.c-do-not-insert-payloadflags-into-.rpm-me.patch @@ -0,0 +1,28 @@ +From ae4fdd8e8d052835973e6ff4b7550f93bde30a98 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex@linutronix.de> +Date: Tue, 31 Aug 2021 10:37:05 +0200 +Subject: [PATCH] build/pack.c: do not insert payloadflags into .rpm metadata + +The flags look like '19T56' where 19 is the compression level +(deterministic), and 56 is the amount of threads (varies from one +host to the next and breaks reproducibility for .rpm). + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex@linutronix.de> +--- + build/pack.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/build/pack.c b/build/pack.c +index f382c7da0..0889dd993 100644 +--- a/build/pack.c ++++ b/build/pack.c +@@ -330,7 +330,7 @@ static char *getIOFlags(Package pkg) + headerPutString(pkg->header, RPMTAG_PAYLOADCOMPRESSOR, compr); + buf = xstrdup(rpmio_flags); + buf[s - rpmio_flags] = '\0'; +- headerPutString(pkg->header, RPMTAG_PAYLOADFLAGS, buf+1); ++ headerPutString(pkg->header, RPMTAG_PAYLOADFLAGS, ""); + free(buf); + } + exit: diff --git a/meta/recipes-devtools/rpm/files/0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch b/meta/recipes-devtools/rpm/files/0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch new file mode 100644 index 0000000000..98e52da3a8 --- /dev/null +++ b/meta/recipes-devtools/rpm/files/0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch @@ -0,0 +1,57 @@ +From b04ecb793a3c859985eead5e261785b27a4c4a20 Mon Sep 17 00:00:00 2001 +From: Changqing Li <changqing.li@windriver.com> +Date: Thu, 7 May 2020 17:40:58 +0800 +Subject: [PATCH] lib/transaction.c: fix file conflicts for MIPS64 N32 + +This patch is from: +https://github.com/rpm-software-management/rpm/issues/193 + +Error: Transaction check error: + file /sbin/ldconfig conflicts between attempted installs of +ldconfig-2.31+git0+71f2b249a2-r0.mips64_n32 and +lib32-ldconfig-2.31+git0+71f2b249a2-r0.mips32r2 +... + +This was because: +transactions_color = 001 (ELF32) & 010 (ELF64) & 100 (ELF32 N32 MIPS64) +FColor = Current file color (001) & transaction_color (111) +oFcolor = Previous file color (100) & transaction_color (111) + +In handleColorConflict, it only deal with conditons "new preferred" or +"old preferred". But not deal with the situation where neither is the +preferred type. so for tri-lib system, like mips64/mips64 n32/mips(32), +"Transaction check error" occurred. + +Fixed by performing a 'last-in-wins' resolution when "neither is preferred". + +Upstream-Status: Submitted <https://github.com/rpm-software-management/rpm/issues/193> + +Signed-off-by: Changqing Li <changqing.li@windriver.com> +--- + lib/transaction.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/lib/transaction.c b/lib/transaction.c +index 70d2587ac..b89b30060 100644 +--- a/lib/transaction.c ++++ b/lib/transaction.c +@@ -400,7 +400,18 @@ static int handleColorConflict(rpmts ts, + rpmfsSetAction(ofs, ofx, FA_CREATE); + rpmfsSetAction(fs, fx, FA_SKIPCOLOR); + rConflicts = 0; +- } ++ }else { ++ /* ++ * If neither is already skipped, we skip the old one, and ++ * install the new one (last in wins). ++ */ ++ if (ofs && !XFA_SKIPPING(rpmfsGetAction(ofs, ofx)) && ++ fs && !XFA_SKIPPING(rpmfsGetAction(fs, fx))) { ++ rpmfsSetAction(ofs, ofx, FA_SKIPCOLOR); ++ rpmfsSetAction(fs, fx, FA_CREATE); ++ } ++ rConflicts = 0; ++ } + } + } + diff --git a/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch b/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch index a6c58699d3..55108e7f1c 100644 --- a/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch +++ b/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch @@ -1,4 +1,7 @@ -perl: disable auto requires +From 58bf006646a063837c46b695f7e7ebb69bee7238 Mon Sep 17 00:00:00 2001 +From: Mark Hatle <mark.hatle@windriver.com> +Date: Tue, 15 Aug 2017 16:41:57 -0500 +Subject: [PATCH] perl: disable auto requires When generating automatic requirements, it's possible for perl scripts to declare 'optional' dependencies. These seem to often be incorrect and will @@ -9,20 +12,24 @@ generation. This matches the behavior from the previous RPM5 implementation. Upstream-Status: Inappropriate [OE specific configuration] Signed-off-by: Mark Hatle <mark.hatle@windriver.com> +--- + fileattrs/perl.attr | 2 +- + fileattrs/perllib.attr | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) -Index: git/fileattrs/perl.attr -=================================================================== ---- git.orig/fileattrs/perl.attr -+++ git/fileattrs/perl.attr +diff --git a/fileattrs/perl.attr b/fileattrs/perl.attr +index 0daef58d5..81ddf5305 100644 +--- a/fileattrs/perl.attr ++++ b/fileattrs/perl.attr @@ -1,3 +1,3 @@ -%__perl_requires %{_rpmconfigdir}/perl.req +#__perl_requires %{_rpmconfigdir}/perl.req %__perl_magic ^.*[Pp]erl .*$ %__perl_flags exeonly -Index: git/fileattrs/perllib.attr -=================================================================== ---- git.orig/fileattrs/perllib.attr -+++ git/fileattrs/perllib.attr +diff --git a/fileattrs/perllib.attr b/fileattrs/perllib.attr +index fcad48099..495a28927 100644 +--- a/fileattrs/perllib.attr ++++ b/fileattrs/perllib.attr @@ -1,5 +1,5 @@ %__perllib_provides %{_rpmconfigdir}/perl.prov -%__perllib_requires %{_rpmconfigdir}/perl.req diff --git a/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch b/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch index b3dbc319b6..c5caa7dc5e 100644 --- a/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch +++ b/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch @@ -1,7 +1,7 @@ -From 383c0b097b7eba16801a9e3c4b8e36a4b6de74ab Mon Sep 17 00:00:00 2001 +From d7143dc4e75c8bcc5cc4c852a4b972942b7e4d07 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Fri, 20 Jan 2017 13:33:05 +0200 -Subject: [PATCH 2/2] Add support for prefixing /etc from RPM_ETCCONFIGDIR +Subject: [PATCH] Add support for prefixing /etc from RPM_ETCCONFIGDIR environment variable This is needed so that rpm can pick up target-specific configuration @@ -14,10 +14,10 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/rpmrc.c b/lib/rpmrc.c -index 19fe80f98..6b27b3941 100644 +index 483585ae4..ea858c290 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c -@@ -455,10 +455,14 @@ const char * lookupInDefaultTable(const char * name, +@@ -456,10 +456,14 @@ const char * lookupInDefaultTable(const char * name, static void setDefaults(void) { const char *confdir = rpmConfigDir(); @@ -27,26 +27,26 @@ index 19fe80f98..6b27b3941 100644 + if (!defrcfiles) { defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":", - confdir, "/" RPMCANONVENDOR "/rpmrc", ":", -- SYSCONFDIR "/rpmrc", ":"); -+ etcconfdir, SYSCONFDIR "/rpmrc", ":", NULL); + confdir, "/" RPM_VENDOR "/rpmrc", ":", +- SYSCONFDIR "/rpmrc", NULL); ++ etcconfdir, SYSCONFDIR "/rpmrc", NULL); } #ifndef MACROFILES -@@ -468,9 +472,9 @@ static void setDefaults(void) +@@ -469,9 +473,9 @@ static void setDefaults(void) confdir, "/platform/%{_target}/macros", ":", confdir, "/fileattrs/*.attr", ":", - confdir, "/" RPMCANONVENDOR "/macros", ":", + confdir, "/" RPM_VENDOR "/macros", ":", - SYSCONFDIR "/rpm/macros.*", ":", - SYSCONFDIR "/rpm/macros", ":", -- SYSCONFDIR "/rpm/%{_target}/macros", ":"); +- SYSCONFDIR "/rpm/%{_target}/macros", NULL); + etcconfdir, SYSCONFDIR "/rpm/macros.*", ":", + etcconfdir, SYSCONFDIR "/rpm/macros", ":", -+ etcconfdir, SYSCONFDIR "/rpm/%{_target}/macros", ":", NULL); ++ etcconfdir, SYSCONFDIR "/rpm/%{_target}/macros", NULL); } #else macrofiles = MACROFILES; -@@ -989,7 +993,11 @@ static void read_auxv(void) +@@ -1115,7 +1119,11 @@ static void read_auxv(void) */ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os) { @@ -59,7 +59,7 @@ index 19fe80f98..6b27b3941 100644 static struct utsname un; char * chptr; canonEntry canon; -@@ -1286,6 +1294,7 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os) +@@ -1435,6 +1443,7 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os) if (arch) *arch = un.machine; if (os) *os = un.sysname; @@ -67,6 +67,3 @@ index 19fe80f98..6b27b3941 100644 } static --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0002-Run-binary-package-creation-via-thread-pools.patch b/meta/recipes-devtools/rpm/files/0002-Run-binary-package-creation-via-thread-pools.patch deleted file mode 100644 index d10041c2e1..0000000000 --- a/meta/recipes-devtools/rpm/files/0002-Run-binary-package-creation-via-thread-pools.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 513200cf76758de4668312c628d6362bdabfaf4b Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Thu, 25 May 2017 19:30:20 +0300 -Subject: [PATCH 1/3] Run binary package creation via thread pools. - -Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - build/pack.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++----------- - configure.ac | 3 +++ - 2 files changed, 70 insertions(+), 14 deletions(-) - -diff --git a/build/pack.c b/build/pack.c -index ccfd614cc..ed5b9ab4e 100644 ---- a/build/pack.c -+++ b/build/pack.c -@@ -616,25 +616,78 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch - return rc; - } - --rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) -+struct binaryPackageTaskData - { -- rpmRC rc; - Package pkg; -+ char *filename; -+ rpmRC result; -+ struct binaryPackageTaskData *next; -+}; -+ -+static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const char *cookie, int cheating) -+{ -+ struct binaryPackageTaskData *tasks = NULL; -+ struct binaryPackageTaskData *task = NULL; -+ struct binaryPackageTaskData *prev = NULL; -+ -+ for (Package pkg = spec->packages; pkg != NULL; pkg = pkg->next) { -+ task = rcalloc(1, sizeof(*task)); -+ task->pkg = pkg; -+ if (pkg == spec->packages) { -+ // the first package needs to be processed ahead of others, as they copy -+ // changelog data from it, and so otherwise data races would happen -+ task->result = packageBinary(spec, pkg, cookie, cheating, &(task->filename)); -+ rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename); -+ tasks = task; -+ } -+ if (prev != NULL) { -+ prev->next = task; -+ } -+ prev = task; -+ } -+ -+ #pragma omp parallel -+ #pragma omp single -+ // re-declaring task variable is necessary, or older gcc versions will produce code that segfaults -+ for (struct binaryPackageTaskData *task = tasks; task != NULL; task = task->next) { -+ if (task != tasks) -+ #pragma omp task -+ { -+ task->result = packageBinary(spec, task->pkg, cookie, cheating, &(task->filename)); -+ rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename); -+ } -+ } -+ -+ return tasks; -+} -+ -+static void freeBinaryPackageTasks(struct binaryPackageTaskData* tasks) -+{ -+ while (tasks != NULL) { -+ struct binaryPackageTaskData* next = tasks->next; -+ rfree(tasks->filename); -+ rfree(tasks); -+ tasks = next; -+ } -+} -+ -+rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) -+{ - char *pkglist = NULL; - -- for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { -- char *fn = NULL; -- rc = packageBinary(spec, pkg, cookie, cheating, &fn); -- if (rc == RPMRC_OK) { -- rstrcat(&pkglist, fn); -- rstrcat(&pkglist, " "); -- } -- free(fn); -- if (rc != RPMRC_OK) { -- pkglist = _free(pkglist); -- return rc; -- } -+ struct binaryPackageTaskData *tasks = runBinaryPackageTasks(spec, cookie, cheating); -+ -+ for (struct binaryPackageTaskData *task = tasks; task != NULL; task = task->next) { -+ if (task->result == RPMRC_OK) { -+ rstrcat(&pkglist, task->filename); -+ rstrcat(&pkglist, " "); -+ } else { -+ _free(pkglist); -+ freeBinaryPackageTasks(tasks); -+ return RPMRC_FAIL; -+ } - } -+ freeBinaryPackageTasks(tasks); - - /* Now check the package set if enabled */ - if (pkglist != NULL) { -diff --git a/configure.ac b/configure.ac -index a506ec819..59fa0acaf 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -17,6 +17,9 @@ AC_DISABLE_STATIC - - PKG_PROG_PKG_CONFIG - -+AC_OPENMP -+RPMCFLAGS="$OPENMP_CFLAGS $RPMCFLAGS" -+ - dnl Checks for programs. - AC_PROG_CXX - AC_PROG_AWK --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch b/meta/recipes-devtools/rpm/files/0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch new file mode 100644 index 0000000000..23dce30086 --- /dev/null +++ b/meta/recipes-devtools/rpm/files/0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch @@ -0,0 +1,34 @@ +From 29c2a0c18b0c773128bf62c611b4c53fe4471105 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex@linutronix.de> +Date: Tue, 16 Jan 2024 09:59:26 +0100 +Subject: [PATCH] rpmio/rpmglob.c: avoid using GLOB_BRACE if undefined by C + library + +This addresses musl failures; if there is code out there relying on +those braces, it needs to be fixed when used on musl. + +This is unlikely to be trivially fixable upstream. + +Upstream-Status: Inappropriate [reported at https://github.com/rpm-software-management/rpm/issues/2844] +Signed-off-by: Alexander Kanavin <alex@linutronix.de> +--- + rpmio/rpmglob.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/rpmio/rpmglob.c b/rpmio/rpmglob.c +index 243568766..43c27074a 100644 +--- a/rpmio/rpmglob.c ++++ b/rpmio/rpmglob.c +@@ -33,6 +33,12 @@ + + #include "debug.h" + ++/* Don't fail if the standard C library +++ * doesn't provide brace expansion */ ++#ifndef GLOB_BRACE ++#define GLOB_BRACE 0 ++#endif ++ + /* Return 1 if pattern contains a magic char, see glob(7) for a list */ + static int ismagic(const char *pattern) + { diff --git a/meta/recipes-devtools/rpm/files/0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch b/meta/recipes-devtools/rpm/files/0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch deleted file mode 100644 index c348ae5330..0000000000 --- a/meta/recipes-devtools/rpm/files/0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch +++ /dev/null @@ -1,207 +0,0 @@ -From c80892f17e44331206c8318d53b63bb6a99554d0 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Tue, 30 May 2017 13:58:30 +0300 -Subject: [PATCH 3/4] rpmstrpool.c: make operations over string pools - thread-safe - -Otherwise multithreaded rpm building explodes in various ways due -to data races. - -Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - rpmio/rpmstrpool.c | 56 +++++++++++++++++++++++++++++++++++++++++++++--------- - 1 file changed, 47 insertions(+), 9 deletions(-) - -diff --git a/rpmio/rpmstrpool.c b/rpmio/rpmstrpool.c -index 30a57eb10..58ba95a02 100644 ---- a/rpmio/rpmstrpool.c -+++ b/rpmio/rpmstrpool.c -@@ -113,6 +113,8 @@ static poolHash poolHashCreate(int numBuckets) - return ht; - } - -+static const char * rpmstrPoolStrNoLock(rpmstrPool pool, rpmsid sid); -+ - static void poolHashResize(rpmstrPool pool, int numBuckets) - { - poolHash ht = pool->hash; -@@ -120,7 +122,7 @@ static void poolHashResize(rpmstrPool pool, int numBuckets) - - for (int i=0; i<ht->numBuckets; i++) { - if (!ht->buckets[i].keyid) continue; -- unsigned int keyHash = rstrhash(rpmstrPoolStr(pool, ht->buckets[i].keyid)); -+ unsigned int keyHash = rstrhash(rpmstrPoolStrNoLock(pool, ht->buckets[i].keyid)); - for (unsigned int j=0;;j++) { - unsigned int hash = hashbucket(keyHash, j) % numBuckets; - if (!buckets[hash].keyid) { -@@ -149,7 +151,7 @@ static void poolHashAddHEntry(rpmstrPool pool, const char * key, unsigned int ke - ht->buckets[hash].keyid = keyid; - ht->keyCount++; - break; -- } else if (!strcmp(rpmstrPoolStr(pool, ht->buckets[hash].keyid), key)) { -+ } else if (!strcmp(rpmstrPoolStrNoLock(pool, ht->buckets[hash].keyid), key)) { - return; - } - } -@@ -191,7 +193,7 @@ static void poolHashPrintStats(rpmstrPool pool) - int maxcollisions = 0; - - for (i=0; i<ht->numBuckets; i++) { -- unsigned int keyHash = rstrhash(rpmstrPoolStr(pool, ht->buckets[i].keyid)); -+ unsigned int keyHash = rstrhash(rpmstrPoolStrNoLock(pool, ht->buckets[i].keyid)); - for (unsigned int j=0;;j++) { - unsigned int hash = hashbucket(keyHash, i) % ht->numBuckets; - if (hash==i) { -@@ -221,7 +223,7 @@ static void rpmstrPoolRehash(rpmstrPool pool) - - pool->hash = poolHashCreate(sizehint); - for (int i = 1; i <= pool->offs_size; i++) -- poolHashAddEntry(pool, rpmstrPoolStr(pool, i), i); -+ poolHashAddEntry(pool, rpmstrPoolStrNoLock(pool, i), i); - } - - rpmstrPool rpmstrPoolCreate(void) -@@ -245,6 +247,8 @@ rpmstrPool rpmstrPoolCreate(void) - - rpmstrPool rpmstrPoolFree(rpmstrPool pool) - { -+ #pragma omp critical(rpmstrpool) -+ { - if (pool) { - if (pool->nrefs > 1) { - pool->nrefs--; -@@ -260,18 +264,24 @@ rpmstrPool rpmstrPoolFree(rpmstrPool pool) - free(pool); - } - } -+ } - return NULL; - } - - rpmstrPool rpmstrPoolLink(rpmstrPool pool) - { -+ #pragma omp critical(rpmstrpool) -+ { - if (pool) - pool->nrefs++; -+ } - return pool; - } - - void rpmstrPoolFreeze(rpmstrPool pool, int keephash) - { -+ #pragma omp critical(rpmstrpool) -+ { - if (pool && !pool->frozen) { - if (!keephash) { - pool->hash = poolHashFree(pool->hash); -@@ -281,16 +291,20 @@ void rpmstrPoolFreeze(rpmstrPool pool, int keephash) - pool->offs_alloced * sizeof(*pool->offs)); - pool->frozen = 1; - } -+ } - } - - void rpmstrPoolUnfreeze(rpmstrPool pool) - { -+ #pragma omp critical(rpmstrpool) -+ { - if (pool) { - if (pool->hash == NULL) { - rpmstrPoolRehash(pool); - } - pool->frozen = 0; - } -+ } - } - - static rpmsid rpmstrPoolPut(rpmstrPool pool, const char *s, size_t slen, unsigned int hash) -@@ -350,7 +364,7 @@ static rpmsid rpmstrPoolGet(rpmstrPool pool, const char * key, size_t keylen, - return 0; - } - -- s = rpmstrPoolStr(pool, ht->buckets[hash].keyid); -+ s = rpmstrPoolStrNoLock(pool, ht->buckets[hash].keyid); - /* pool string could be longer than keylen, require exact matche */ - if (strncmp(s, key, keylen) == 0 && s[keylen] == '\0') - return ht->buckets[hash].keyid; -@@ -373,27 +387,31 @@ static inline rpmsid strn2id(rpmstrPool pool, const char *s, size_t slen, - rpmsid rpmstrPoolIdn(rpmstrPool pool, const char *s, size_t slen, int create) - { - rpmsid sid = 0; -- -+ #pragma omp critical(rpmstrpool) -+ { - if (s != NULL) { - unsigned int hash = rstrnhash(s, slen); - sid = strn2id(pool, s, slen, hash, create); - } -+ } - return sid; - } - - rpmsid rpmstrPoolId(rpmstrPool pool, const char *s, int create) - { - rpmsid sid = 0; -- -+ #pragma omp critical(rpmstrpool) -+ { - if (s != NULL) { - size_t slen; - unsigned int hash = rstrlenhash(s, &slen); - sid = strn2id(pool, s, slen, hash, create); - } -+ } - return sid; - } - --const char * rpmstrPoolStr(rpmstrPool pool, rpmsid sid) -+static const char * rpmstrPoolStrNoLock(rpmstrPool pool, rpmsid sid) - { - const char *s = NULL; - if (pool && sid > 0 && sid <= pool->offs_size) -@@ -401,12 +419,25 @@ const char * rpmstrPoolStr(rpmstrPool pool, rpmsid sid) - return s; - } - -+const char * rpmstrPoolStr(rpmstrPool pool, rpmsid sid) -+{ -+ const char *s = NULL; -+ #pragma omp critical(rpmstrpool) -+ { -+ s = rpmstrPoolStrNoLock(pool, sid); -+ } -+ return s; -+} -+ - size_t rpmstrPoolStrlen(rpmstrPool pool, rpmsid sid) - { - size_t slen = 0; -+ #pragma omp critical(rpmstrpool) -+ { - if (pool && sid > 0 && sid <= pool->offs_size) { - slen = strlen(pool->offs[sid]); - } -+ } - return slen; - } - -@@ -421,5 +452,12 @@ int rpmstrPoolStreq(rpmstrPool poolA, rpmsid sidA, - - rpmsid rpmstrPoolNumStr(rpmstrPool pool) - { -- return (pool != NULL) ? pool->offs_size : 0; -+ rpmsid id = 0; -+ #pragma omp critical(rpmstrpool) -+ { -+ if (pool) { -+ id = pool->offs_size; -+ } -+ } -+ return id; - } --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch b/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch deleted file mode 100644 index 64a5651f7e..0000000000 --- a/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch +++ /dev/null @@ -1,337 +0,0 @@ -From ec305795a302d226343e69031ff2024dfcde69c0 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Thu, 8 Jun 2017 17:08:09 +0300 -Subject: [PATCH 3/3] build/pack.c: remove static local variables from - buildHost() and getBuildTime() - -Their use is causing difficult to diagnoze data races when building multiple -packages in parallel, and is a bad idea in general, as it also makes it more -difficult to reason about code. - -Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - - -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - build/build.c | 54 ++++++++++++++++++++++++++++-- - build/pack.c | 84 +++++++++-------------------------------------- - build/rpmbuild_internal.h | 8 +++-- - 3 files changed, 74 insertions(+), 72 deletions(-) - -diff --git a/build/build.c b/build/build.c -index 5f99c8db7..09a1311c5 100644 ---- a/build/build.c -+++ b/build/build.c -@@ -6,6 +6,8 @@ - #include "system.h" - - #include <errno.h> -+#include <netdb.h> -+#include <time.h> - #include <sys/wait.h> - - #include <rpm/rpmlog.h> -@@ -16,6 +18,50 @@ - - #include "debug.h" - -+static rpm_time_t getBuildTime(void) -+{ -+ rpm_time_t buildTime = 0; -+ char *srcdate; -+ time_t epoch; -+ char *endptr; -+ -+ srcdate = getenv("SOURCE_DATE_EPOCH"); -+ if (srcdate) { -+ errno = 0; -+ epoch = strtol(srcdate, &endptr, 10); -+ if (srcdate == endptr || *endptr || errno != 0) -+ rpmlog(RPMLOG_ERR, _("unable to parse SOURCE_DATE_EPOCH\n")); -+ else -+ buildTime = (int32_t) epoch; -+ } else -+ buildTime = (int32_t) time(NULL); -+ -+ return buildTime; -+} -+ -+static char * buildHost(void) -+{ -+ char* hostname; -+ struct hostent *hbn; -+ char *bhMacro; -+ -+ bhMacro = rpmExpand("%{?_buildhost}", NULL); -+ if (strcmp(bhMacro, "") != 0) { -+ rasprintf(&hostname, "%s", bhMacro); -+ } else { -+ hostname = rcalloc(1024, sizeof(*hostname)); -+ (void) gethostname(hostname, 1024); -+ hbn = gethostbyname(hostname); -+ if (hbn) -+ strcpy(hostname, hbn->h_name); -+ else -+ rpmlog(RPMLOG_WARNING, -+ _("Could not canonicalize hostname: %s\n"), hostname); -+ } -+ free(bhMacro); -+ return(hostname); -+} -+ - /** - */ - static rpmRC doRmSource(rpmSpec spec) -@@ -203,6 +249,9 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what) - rpmRC rc = RPMRC_OK; - int test = (what & RPMBUILD_NOBUILD); - char *cookie = buildArgs->cookie ? xstrdup(buildArgs->cookie) : NULL; -+ const char* host = buildHost(); -+ rpm_time_t buildTime = getBuildTime(); -+ - - if (rpmExpandNumeric("%{?source_date_epoch_from_changelog}") && - getenv("SOURCE_DATE_EPOCH") == NULL) { -@@ -271,11 +320,11 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what) - goto exit; - - if (((what & RPMBUILD_PACKAGESOURCE) && !test) && -- (rc = packageSources(spec, &cookie))) -+ (rc = packageSources(spec, &cookie, buildTime, host))) - return rc; - - if (((what & RPMBUILD_PACKAGEBINARY) && !test) && -- (rc = packageBinaries(spec, cookie, (didBuild == 0)))) -+ (rc = packageBinaries(spec, cookie, (didBuild == 0), buildTime, host))) - goto exit; - - if ((what & RPMBUILD_CLEAN) && -@@ -295,6 +344,7 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what) - (void) unlink(spec->specFile); - - exit: -+ free(host); - free(cookie); - spec->rootDir = NULL; - if (rc != RPMRC_OK && rpmlogGetNrecs() > 0) { -diff --git a/build/pack.c b/build/pack.c -index ed5b9ab4e..62427065a 100644 ---- a/build/pack.c -+++ b/build/pack.c -@@ -6,8 +6,6 @@ - #include "system.h" - - #include <errno.h> --#include <netdb.h> --#include <time.h> - #include <sys/wait.h> - - #include <rpm/rpmlib.h> /* RPMSIGTAG*, rpmReadPackageFile */ -@@ -151,57 +149,6 @@ exit: - return rc; - } - --static rpm_time_t * getBuildTime(void) --{ -- static rpm_time_t buildTime[1]; -- char *srcdate; -- time_t epoch; -- char *endptr; -- -- if (buildTime[0] == 0) { -- srcdate = getenv("SOURCE_DATE_EPOCH"); -- if (srcdate) { -- errno = 0; -- epoch = strtol(srcdate, &endptr, 10); -- if (srcdate == endptr || *endptr || errno != 0) -- rpmlog(RPMLOG_ERR, _("unable to parse SOURCE_DATE_EPOCH\n")); -- else -- buildTime[0] = (int32_t) epoch; -- } else -- buildTime[0] = (int32_t) time(NULL); -- } -- -- return buildTime; --} -- --static const char * buildHost(void) --{ -- static char hostname[1024]; -- static int oneshot = 0; -- struct hostent *hbn; -- char *bhMacro; -- -- if (! oneshot) { -- bhMacro = rpmExpand("%{?_buildhost}", NULL); -- if (strcmp(bhMacro, "") != 0 && strlen(bhMacro) < 1024) { -- strcpy(hostname, bhMacro); -- } else { -- if (strcmp(bhMacro, "") != 0) -- rpmlog(RPMLOG_WARNING, _("The _buildhost macro is too long\n")); -- (void) gethostname(hostname, sizeof(hostname)); -- hbn = gethostbyname(hostname); -- if (hbn) -- strcpy(hostname, hbn->h_name); -- else -- rpmlog(RPMLOG_WARNING, -- _("Could not canonicalize hostname: %s\n"), hostname); -- } -- free(bhMacro); -- oneshot = 1; -- } -- return(hostname); --} -- - static rpmRC processScriptFiles(rpmSpec spec, Package pkg) - { - struct TriggerFileEntry *p; -@@ -308,7 +255,8 @@ static int haveRichDep(Package pkg) - } - - static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp, -- const char *fileName, char **cookie) -+ const char *fileName, char **cookie, -+ rpm_time_t buildTime, const char* buildHost) - { - FD_t fd = NULL; - char * rpmio_flags = NULL; -@@ -397,7 +345,7 @@ static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp, - - /* Create and add the cookie */ - if (cookie) { -- rasprintf(cookie, "%s %d", buildHost(), (int) (*getBuildTime())); -+ rasprintf(cookie, "%s %d", buildHost, buildTime); - headerPutString(pkg->header, RPMTAG_COOKIE, *cookie); - } - -@@ -546,7 +494,7 @@ static rpmRC checkPackages(char *pkgcheck) - return RPMRC_OK; - } - --static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int cheating, char** filename) -+static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int cheating, char** filename, rpm_time_t buildTime, const char* buildHost) - { - const char *errorString; - rpmRC rc = RPMRC_OK; -@@ -565,8 +513,8 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch - headerCopyTags(spec->packages->header, pkg->header, copyTags); - - headerPutString(pkg->header, RPMTAG_RPMVERSION, VERSION); -- headerPutString(pkg->header, RPMTAG_BUILDHOST, buildHost()); -- headerPutUint32(pkg->header, RPMTAG_BUILDTIME, getBuildTime(), 1); -+ headerPutString(pkg->header, RPMTAG_BUILDHOST, buildHost); -+ headerPutUint32(pkg->header, RPMTAG_BUILDTIME, &buildTime, 1); - - if (spec->sourcePkgId != NULL) { - headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16); -@@ -604,7 +552,7 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch - free(binRpm); - } - -- rc = writeRPM(pkg, NULL, *filename, NULL); -+ rc = writeRPM(pkg, NULL, *filename, NULL, buildTime, buildHost); - if (rc == RPMRC_OK) { - /* Do check each written package if enabled */ - char *pkgcheck = rpmExpand("%{?_build_pkgcheck} ", *filename, NULL); -@@ -624,7 +572,7 @@ struct binaryPackageTaskData - struct binaryPackageTaskData *next; - }; - --static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const char *cookie, int cheating) -+static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const char *cookie, int cheating, rpm_time_t buildTime, char* buildHost) - { - struct binaryPackageTaskData *tasks = NULL; - struct binaryPackageTaskData *task = NULL; -@@ -636,7 +584,7 @@ static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const c - if (pkg == spec->packages) { - // the first package needs to be processed ahead of others, as they copy - // changelog data from it, and so otherwise data races would happen -- task->result = packageBinary(spec, pkg, cookie, cheating, &(task->filename)); -+ task->result = packageBinary(spec, pkg, cookie, cheating, &(task->filename), buildTime, buildHost); - rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename); - tasks = task; - } -@@ -653,7 +601,7 @@ static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const c - if (task != tasks) - #pragma omp task - { -- task->result = packageBinary(spec, task->pkg, cookie, cheating, &(task->filename)); -+ task->result = packageBinary(spec, task->pkg, cookie, cheating, &(task->filename), buildTime, buildHost); - rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename); - } - } -@@ -671,11 +619,11 @@ static void freeBinaryPackageTasks(struct binaryPackageTaskData* tasks) - } - } - --rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) -+rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating, rpm_time_t buildTime, char* buildHost) - { - char *pkglist = NULL; - -- struct binaryPackageTaskData *tasks = runBinaryPackageTasks(spec, cookie, cheating); -+ struct binaryPackageTaskData *tasks = runBinaryPackageTasks(spec, cookie, cheating, buildTime, buildHost); - - for (struct binaryPackageTaskData *task = tasks; task != NULL; task = task->next) { - if (task->result == RPMRC_OK) { -@@ -702,22 +650,22 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) - return RPMRC_OK; - } - --rpmRC packageSources(rpmSpec spec, char **cookie) -+rpmRC packageSources(rpmSpec spec, char **cookie, rpm_time_t buildTime, char* buildHost) - { - Package sourcePkg = spec->sourcePackage; - rpmRC rc; - - /* Add some cruft */ - headerPutString(sourcePkg->header, RPMTAG_RPMVERSION, VERSION); -- headerPutString(sourcePkg->header, RPMTAG_BUILDHOST, buildHost()); -- headerPutUint32(sourcePkg->header, RPMTAG_BUILDTIME, getBuildTime(), 1); -+ headerPutString(sourcePkg->header, RPMTAG_BUILDHOST, buildHost); -+ headerPutUint32(sourcePkg->header, RPMTAG_BUILDTIME, &buildTime, 1); - - /* XXX this should be %_srpmdir */ - { char *fn = rpmGetPath("%{_srcrpmdir}/", spec->sourceRpmName,NULL); - char *pkgcheck = rpmExpand("%{?_build_pkgcheck_srpm} ", fn, NULL); - - spec->sourcePkgId = NULL; -- rc = writeRPM(sourcePkg, &spec->sourcePkgId, fn, cookie); -+ rc = writeRPM(sourcePkg, &spec->sourcePkgId, fn, cookie, buildTime, buildHost); - - /* Do check SRPM package if enabled */ - if (rc == RPMRC_OK && pkgcheck[0] != ' ') { -diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h -index 8351a6a34..797337ca7 100644 ---- a/build/rpmbuild_internal.h -+++ b/build/rpmbuild_internal.h -@@ -408,19 +408,23 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags); - * @param spec spec file control structure - * @param cookie build identifier "cookie" or NULL - * @param cheating was build shortcircuited? -+ * @param buildTime the build timestamp that goes into packages -+ * @param buildHost the hostname where the build is happening - * @return RPMRC_OK on success - */ - RPM_GNUC_INTERNAL --rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating); -+rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating, rpm_time_t buildTime, char* buildHost); - - /** \ingroup rpmbuild - * Generate source package. - * @param spec spec file control structure - * @retval cookie build identifier "cookie" or NULL -+ * @param buildTime the build timestamp that goes into packages -+ * @param buildHost the hostname where the build is happening - * @return RPMRC_OK on success - */ - RPM_GNUC_INTERNAL --rpmRC packageSources(rpmSpec spec, char **cookie); -+rpmRC packageSources(rpmSpec spec, char **cookie, rpm_time_t buildTime, char* buildHost); - - RPM_GNUC_INTERNAL - int addLangTag(rpmSpec spec, Header h, rpmTagVal tag, --- -2.11.0 - diff --git a/meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch b/meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch deleted file mode 100644 index c910a478ee..0000000000 --- a/meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch +++ /dev/null @@ -1,32 +0,0 @@ -From d65d6e8760afbd7f70b22a1f3297a037bc475fea Mon Sep 17 00:00:00 2001 -From: Peter Kjellerstedt <pkj@axis.com> -Date: Mon, 15 May 2017 10:21:08 +0200 -Subject: [PATCH 11/13] Do not require that ELF binaries are executable to be - identifiable - -There is nothing that requires, e.g., a DSO to be executable, but it -is still an ELF binary and should be identified as such. - -Upstream probably expects all ELF binaries to be marked as executable, -but rather than imposing such a limitation for OE, allow any file to -be identified as an ELF binary regardless of whether it is executable -or not. - -Upstream-Status: Inappropriate -Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> ---- - fileattrs/elf.attr | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/fileattrs/elf.attr b/fileattrs/elf.attr -index 595b33e09..bac52649d 100644 ---- a/fileattrs/elf.attr -+++ b/fileattrs/elf.attr -@@ -1,4 +1,3 @@ - %__elf_provides %{_rpmconfigdir}/elfdeps --provides %{?__filter_GLIBC_PRIVATE:--filter-private} - %__elf_requires %{_rpmconfigdir}/elfdeps --requires %{?__filter_GLIBC_PRIVATE:--filter-private} - %__elf_magic ^(setuid )?(setgid )?(sticky )?ELF (32|64)-bit.*$ --%__elf_flags exeonly --- -2.12.0 - diff --git a/meta/recipes-devtools/rpm/files/0012-Use-conditional-to-access-_docdir-in-macros.in.patch b/meta/recipes-devtools/rpm/files/0012-Use-conditional-to-access-_docdir-in-macros.in.patch deleted file mode 100644 index 996da90d43..0000000000 --- a/meta/recipes-devtools/rpm/files/0012-Use-conditional-to-access-_docdir-in-macros.in.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 77808db4036dc4a012c47aca36255549ed764a6a Mon Sep 17 00:00:00 2001 -From: Peter Kjellerstedt <pkj@axis.com> -Date: Tue, 16 May 2017 10:58:18 +0200 -Subject: [PATCH 12/13] Use conditional to access %{_docdir} in macros.in - -This avoids the following warning: - -warning: Ignoring invalid regex %{_docdir} - -when runing `rpmdeps -R <file>`, since %{_docdir} is only defined when -parsing a spec file (in parseSpec()). - -Upstream-Status: Accepted [https://github.com/rpm-software-management/rpm/pull/216] -Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> ---- - macros.in | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/macros.in b/macros.in -index 84ae25275..cca67a500 100644 ---- a/macros.in -+++ b/macros.in -@@ -200,8 +200,8 @@ package or when debugging this package.\ - # Their purpouse is to set up global filtering for all packages. If you need - # to set up specific filtering for your package use %__requires_exclude_from - # and %__provides_exclude_from instead. --%__global_requires_exclude_from %{_docdir} --%__global_provides_exclude_from %{_docdir} -+%__global_requires_exclude_from %{?_docdir:%{_docdir}} -+%__global_provides_exclude_from %{?_docdir:%{_docdir}} - - # The path to the gzip executable (legacy, use %{__gzip} instead). - %_gzipbin %{__gzip} --- -2.12.0 - diff --git a/meta/recipes-devtools/rpm/files/0013-Add-a-new-option-alldeps-to-rpmdeps.patch b/meta/recipes-devtools/rpm/files/0013-Add-a-new-option-alldeps-to-rpmdeps.patch deleted file mode 100644 index faaf62960c..0000000000 --- a/meta/recipes-devtools/rpm/files/0013-Add-a-new-option-alldeps-to-rpmdeps.patch +++ /dev/null @@ -1,152 +0,0 @@ -From 3bf20a6116ae3e1a5a3a6907bee7e881b17efb2f Mon Sep 17 00:00:00 2001 -From: Peter Kjellerstedt <pkj@axis.com> -Date: Mon, 15 May 2017 11:23:26 +0200 -Subject: [PATCH 13/13] Add a new option --alldeps to rpmdeps - -This will send the output from rpmfcPrint() to stdout. This is an -alternative to using the --rpmfcdebug option, which will send the same -output to stderr. The two options have totally different use cases -though. While --alldeps is used when the output from rpmfcPrint() is -what is wanted, --rpmfcdebug can be used together with the other -output options, e.g., --requires, without affecting their output. - -Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/220] -Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> ---- - build/rpmfc.c | 27 ++++++++++++++------------- - build/rpmfc.h | 1 - - tools/rpmdeps.c | 44 +++++++++++++++++++++++++------------------- - 3 files changed, 39 insertions(+), 33 deletions(-) - -diff --git a/build/rpmfc.c b/build/rpmfc.c -index c8e2f876a..44f1cdc9a 100644 ---- a/build/rpmfc.c -+++ b/build/rpmfc.c -@@ -732,7 +732,6 @@ static rpm_color_t rpmfcColor(const char * fmstr) - - void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp) - { -- rpm_color_t fcolor; - int ndx; - int dx; - int fx; -@@ -744,21 +743,23 @@ void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp) - - if (fc) - for (fx = 0; fx < fc->nfiles; fx++) { -- rpmsid cx = fc->fcdictx[fx] + 1; /* id's are one off */ -- fcolor = fc->fcolor[fx]; -- ARGV_t fattrs = fc->fattrs[fx]; -- - fprintf(fp, "%3d %s", fx, fc->fn[fx]); -- if (fcolor != RPMFC_BLACK) -+ if (_rpmfc_debug) { -+ rpmsid cx = fc->fcdictx[fx] + 1; /* id's are one off */ -+ rpm_color_t fcolor = fc->fcolor[fx]; -+ ARGV_t fattrs = fc->fattrs[fx]; -+ -+ if (fcolor != RPMFC_BLACK) - fprintf(fp, "\t0x%x", fc->fcolor[fx]); -- else -+ else - fprintf(fp, "\t%s", rpmstrPoolStr(fc->cdict, cx)); -- if (fattrs) { -- char *attrs = argvJoin(fattrs, ","); -- fprintf(fp, " [%s]", attrs); -- free(attrs); -- } else { -- fprintf(fp, " [none]"); -+ if (fattrs) { -+ char *attrs = argvJoin(fattrs, ","); -+ fprintf(fp, " [%s]", attrs); -+ free(attrs); -+ } else { -+ fprintf(fp, " [none]"); -+ } - } - fprintf(fp, "\n"); - -diff --git a/build/rpmfc.h b/build/rpmfc.h -index dae8ea5b1..3d87b31cf 100644 ---- a/build/rpmfc.h -+++ b/build/rpmfc.h -@@ -45,7 +45,6 @@ typedef const struct rpmfcTokens_s * rpmfcToken; - - /** \ingroup rpmfc - * Print results of file classification. -- * @todo Remove debugging routine. - * @param msg message prefix (NULL for none) - * @param fc file classifier - * @param fp output file handle (NULL for stderr) -diff --git a/tools/rpmdeps.c b/tools/rpmdeps.c -index a414b6343..f260a38c4 100644 ---- a/tools/rpmdeps.c -+++ b/tools/rpmdeps.c -@@ -23,6 +23,8 @@ static int print_conflicts; - - static int print_obsoletes; - -+static int print_alldeps; -+ - static void rpmdsPrint(const char * msg, rpmds ds, FILE * fp) - { - if (fp == NULL) fp = stderr; -@@ -57,6 +59,8 @@ static struct poptOption optionsTable[] = { - NULL, NULL }, - { "obsoletes", '\0', POPT_ARG_VAL, &print_obsoletes, -1, - NULL, NULL }, -+ { "alldeps", '\0', POPT_ARG_VAL, &print_alldeps, -1, -+ NULL, NULL }, - - POPT_AUTOALIAS - POPT_AUTOHELP -@@ -100,25 +104,27 @@ main(int argc, char *argv[]) - if (rpmfcClassify(fc, av, NULL) || rpmfcApply(fc)) - goto exit; - -- if (_rpmfc_debug) -- rpmfcPrint(buf, fc, NULL); -- -- if (print_provides) -- rpmdsPrint(NULL, rpmfcProvides(fc), stdout); -- if (print_requires) -- rpmdsPrint(NULL, rpmfcRequires(fc), stdout); -- if (print_recommends) -- rpmdsPrint(NULL, rpmfcRecommends(fc), stdout); -- if (print_suggests) -- rpmdsPrint(NULL, rpmfcSuggests(fc), stdout); -- if (print_supplements) -- rpmdsPrint(NULL, rpmfcSupplements(fc), stdout); -- if (print_enhances) -- rpmdsPrint(NULL, rpmfcEnhances(fc), stdout); -- if (print_conflicts) -- rpmdsPrint(NULL, rpmfcConflicts(fc), stdout); -- if (print_obsoletes) -- rpmdsPrint(NULL, rpmfcObsoletes(fc), stdout); -+ if (print_alldeps || _rpmfc_debug) -+ rpmfcPrint(NULL, fc, print_alldeps ? stdout : NULL); -+ -+ if (!print_alldeps) { -+ if (print_provides) -+ rpmdsPrint(NULL, rpmfcProvides(fc), stdout); -+ if (print_requires) -+ rpmdsPrint(NULL, rpmfcRequires(fc), stdout); -+ if (print_recommends) -+ rpmdsPrint(NULL, rpmfcRecommends(fc), stdout); -+ if (print_suggests) -+ rpmdsPrint(NULL, rpmfcSuggests(fc), stdout); -+ if (print_supplements) -+ rpmdsPrint(NULL, rpmfcSupplements(fc), stdout); -+ if (print_enhances) -+ rpmdsPrint(NULL, rpmfcEnhances(fc), stdout); -+ if (print_conflicts) -+ rpmdsPrint(NULL, rpmfcConflicts(fc), stdout); -+ if (print_obsoletes) -+ rpmdsPrint(NULL, rpmfcObsoletes(fc), stdout); -+ } - - ec = 0; - --- -2.12.0 - diff --git a/meta/recipes-devtools/rpm/files/0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch b/meta/recipes-devtools/rpm/files/0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch new file mode 100644 index 0000000000..732202c46f --- /dev/null +++ b/meta/recipes-devtools/rpm/files/0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch @@ -0,0 +1,55 @@ +From f01d9c24bb86bc47ad2453483518dbb25953cac7 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Thu, 10 Jan 2019 18:14:18 +0100 +Subject: [PATCH] rpmscript.c: change logging level around scriptlets to INFO + from DEBUG + +That way we can debug scriptlet failures without writing lots of +irrelevant noise to rootfs logs. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + lib/rpmscript.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/lib/rpmscript.c b/lib/rpmscript.c +index 7b7e26606..1dcd23be5 100644 +--- a/lib/rpmscript.c ++++ b/lib/rpmscript.c +@@ -291,7 +291,7 @@ static char * writeScript(const char *cmd, const char *script) + if (Ferror(fd)) + goto exit; + +- if (rpmIsDebug() && (rstreq(cmd, "/bin/sh") || rstreq(cmd, "/bin/bash"))) { ++ if (rpmIsVerbose() && (rstreq(cmd, "/bin/sh") || rstreq(cmd, "/bin/bash"))) { + static const char set_x[] = "set -x\n"; + /* Assume failures will be caught by the write below */ + Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd); +@@ -323,7 +323,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes, + char *mline = NULL; + rpmRC rc = RPMRC_FAIL; + +- rpmlog(RPMLOG_DEBUG, "%s: scriptlet start\n", sname); ++ rpmlog(RPMLOG_INFO, "%s: scriptlet start\n", sname); + + if (script) { + fn = writeScript(*argvp[0], script); +@@ -375,7 +375,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes, + sname, strerror(errno)); + goto exit; + } else if (pid == 0) {/* Child */ +- rpmlog(RPMLOG_DEBUG, "%s: execv(%s) pid %d\n", ++ rpmlog(RPMLOG_INFO, "%s: execv(%s) pid %d\n", + sname, *argvp[0], (unsigned)getpid()); + + fclose(in); +@@ -418,7 +418,7 @@ static rpmRC runExtScript(rpmPlugins plugins, ARGV_const_t prefixes, + reaped = waitpid(pid, &status, 0); + } while (reaped == -1 && errno == EINTR); + +- rpmlog(RPMLOG_DEBUG, "%s: waitpid(%d) rc %d status %x\n", ++ rpmlog(RPMLOG_INFO, "%s: waitpid(%d) rc %d status %x\n", + sname, (unsigned)pid, (unsigned)reaped, status); + + if (reaped < 0) { |