Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,48 @@
From 93f219df68f3741ff63a294a16bcbe8deba1112f 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
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
build/rpmfc.c | 4 ++++
rpmrc.in | 2 ++
2 files changed, 6 insertions(+)
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 26606378f..a16e3f4e9 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -646,6 +646,7 @@ exit:
static const struct rpmfcTokens_s rpmfcTokens[] = {
{ "directory", RPMFC_INCLUDE },
+ { "N32 MIPS64", RPMFC_ELFMIPSN32|RPMFC_INCLUDE },
{ "ELF 32-bit", RPMFC_ELF32|RPMFC_INCLUDE },
{ "ELF 64-bit", RPMFC_ELF64|RPMFC_INCLUDE },
@@ -1151,6 +1152,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 2975a3a0e..c7232b48b 100644
--- a/rpmrc.in
+++ b/rpmrc.in
@@ -139,6 +139,8 @@ archcolor: mipsr6el 1
archcolor: mips64r6 2
archcolor: mips64r6el 2
+archcolor: mips64_n32 4
+
archcolor: m68k 1
archcolor: m68kmint 1
@@ -0,0 +1,31 @@
From f39c28eb52f12ae6e82db360ffd5a903ac8faca5 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
a short-circuited way.
Upstream permits short-circuiting only for local testing; Yocto on the other
hand produces rpms that way by design.
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
build/pack.c | 4 ----
1 file changed, 4 deletions(-)
Index: git/build/pack.c
===================================================================
--- git.orig/build/pack.c
+++ git/build/pack.c
@@ -709,10 +709,6 @@ static rpmRC packageBinary(rpmSpec spec,
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;
@@ -0,0 +1,58 @@
From 5fc560aaf1184d35d161f7d50dbb6323c90cc02d 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: 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(-)
diff --git a/configure.ac b/configure.ac
index e6676c581..ec28db9b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -942,7 +942,7 @@ else
usrprefix=$prefix
fi
-RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`"
+RPMCONFIGDIR="`echo ${libdir}/rpm`"
AC_SUBST(RPMCONFIGDIR)
AC_SUBST(OBJDUMP)
diff --git a/macros.in b/macros.in
index a2411d784..735b74d99 100644
--- a/macros.in
+++ b/macros.in
@@ -930,7 +930,7 @@ package or when debugging this package.\
%_sharedstatedir %{_prefix}/com
%_localstatedir %{_prefix}/var
%_lib lib
-%_libdir %{_exec_prefix}/%{_lib}
+%_libdir @libdir@
%_includedir %{_prefix}/include
%_infodir %{_datadir}/info
%_mandir %{_datadir}/man
diff --git a/rpm.am b/rpm.am
index 55b5b3935..5a51f102b 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 = 13:0:4
@@ -0,0 +1,35 @@
From 35381b6cd6c1b571bf7e6b0640de0f54dbf94386 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
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
lib/rpmrc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Index: git/lib/rpmrc.c
===================================================================
--- git.orig/lib/rpmrc.c
+++ git/lib/rpmrc.c
@@ -458,8 +458,7 @@ static void setDefaults(void)
if (!defrcfiles) {
defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":",
confdir, "/" RPMCANONVENDOR "/rpmrc", ":",
- SYSCONFDIR "/rpmrc", ":",
- "~/.rpmrc", NULL);
+ SYSCONFDIR "/rpmrc", ":");
}
#ifndef MACROFILES
@@ -471,8 +470,7 @@ static void setDefaults(void)
confdir, "/" RPMCANONVENDOR "/macros", ":",
SYSCONFDIR "/rpm/macros.*", ":",
SYSCONFDIR "/rpm/macros", ":",
- SYSCONFDIR "/rpm/%{_target}/macros", ":",
- "~/.rpmmacros", NULL);
+ SYSCONFDIR "/rpm/%{_target}/macros", ":");
}
#else
macrofiles = MACROFILES;
@@ -0,0 +1,28 @@
From a674b9cc7af448d7c6748bc163bf37dc14a57f09 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] Do not reset the PATH environment variable before running
scriptlets.
We add lots of native stuff into it and scriptlets rely on that.
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
lib/rpmscript.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: git/lib/rpmscript.c
===================================================================
--- git.orig/lib/rpmscript.c
+++ git/lib/rpmscript.c
@@ -231,7 +231,7 @@ static void doScriptExec(ARGV_const_t ar
if (ipath && ipath[5] != '%')
path = ipath;
- xx = setenv("PATH", path, 1);
+ //xx = setenv("PATH", path, 1);
free(ipath);
}
@@ -0,0 +1,68 @@
From a89daa75ac970d8e247edc762d1181e9a5b0c5d0 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
chrooting into destination rootfs
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 | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
Index: git/lib/rpmscript.c
===================================================================
--- git.orig/lib/rpmscript.c
+++ git/lib/rpmscript.c
@@ -18,7 +18,7 @@
#include "rpmio/rpmio_internal.h"
#include "lib/rpmplugins.h" /* rpm plugins hooks */
-
+#include "lib/rpmchroot.h" /* rpmChrootOut */
#include "debug.h"
struct scriptNextFileFunc_s {
@@ -427,8 +427,7 @@ exit:
Fclose(out); /* XXX dup'd STDOUT_FILENO */
if (fn) {
- if (!rpmIsDebug())
- unlink(fn);
+ unlink(fn);
free(fn);
}
free(mline);
@@ -462,7 +461,13 @@ rpmRC rpmScriptRun(rpmScript script, int
if (rc != RPMRC_FAIL) {
if (script_type & RPMSCRIPTLET_EXEC) {
- 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);
+ rpmChrootIn();
+ } else {
+ 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);
}
@@ -0,0 +1,28 @@
From 2d351c666f09cc1b9e368422653fb42ac8b86249 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(-)
Index: git/build/pack.c
===================================================================
--- git.orig/build/pack.c
+++ git/build/pack.c
@@ -328,7 +328,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:
@@ -0,0 +1,28 @@
From 8f51462d41d8fe942d5d0a06f08d47f625141995 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Thu, 4 Aug 2022 12:15:08 +0200
Subject: [PATCH] configure.ac: add linux-gnux32 variant to triplet handling
x32 is a 64 bit x86 ABI with 32 bit pointers.
Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/2143]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
configure.ac | 4 ++++
1 file changed, 4 insertions(+)
Index: git/configure.ac
===================================================================
--- git.orig/configure.ac
+++ git/configure.ac
@@ -903,6 +903,10 @@ if echo "$host_os" | grep '.*-gnux32$' >
host_os=`echo "${host_os}" | sed 's/-gnux32$//'`
host_os_gnu=-gnux32
fi
+if echo "$host_os" | grep '.*-gnux32$' > /dev/null ; then
+ host_os=`echo "${host_os}" | sed 's/-gnux32$//'`
+ host_os_gnu=-gnux32
+fi
if echo "$host_os" | grep '.*-gnu$' > /dev/null ; then
host_os=`echo "${host_os}" | sed 's/-gnu$//'`
fi
@@ -0,0 +1,57 @@
From 1ed066fc6fa7d7afffe3545c4e3ea937529e6c49 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(-)
Index: git/lib/transaction.c
===================================================================
--- git.orig/lib/transaction.c
+++ git/lib/transaction.c
@@ -402,7 +402,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;
+ }
}
}
@@ -0,0 +1,32 @@
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
cause installation failures in OE. Instead of fixing the perl scripts, it
was decided it is better to simply disable the automatic dependency
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>
Index: git/fileattrs/perl.attr
===================================================================
--- git.orig/fileattrs/perl.attr
+++ git/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
@@ -1,5 +1,5 @@
%__perllib_provides %{_rpmconfigdir}/perl.prov
-%__perllib_requires %{_rpmconfigdir}/perl.req
+#__perllib_requires %{_rpmconfigdir}/perl.req
%__perllib_magic ^Perl[[:digit:]] module source.*
%__perllib_path \\.pm$
%__perllib_flags magic_and_path
@@ -0,0 +1,35 @@
From 6ef189c45b763aedac5ef57ed6a5fc125fa95b41 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 3 Mar 2023 09:54:48 -0800
Subject: [PATCH] python: Use Py_hash_t instead of long in hdr_hash
Fixes
python/header-py.c:744:2: error: incompatible function pointer types initializing 'hashfunc' (aka 'int (*)(struct _object *)') with an expression of type 'long (PyObject *)' (aka 'long (struct _object *)') [-Wincompatible-function-pointer-types]
| hdr_hash, /* tp_hash */
| ^~~~~~~~
Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/2409]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
python/header-py.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/python/header-py.c b/python/header-py.c
index 0aed0c9267..c15503f359 100644
--- a/python/header-py.c
+++ b/python/header-py.c
@@ -316,9 +316,9 @@ static PyObject * hdr_dsOfHeader(PyObject * s)
"(Oi)", s, RPMTAG_NEVR);
}
-static long hdr_hash(PyObject * h)
+static Py_hash_t hdr_hash(PyObject * h)
{
- return (long) h;
+ return (Py_hash_t) h;
}
static PyObject * hdr_reduce(hdrObject *s)
--
2.39.2
@@ -0,0 +1,69 @@
From 383c0b097b7eba16801a9e3c4b8e36a4b6de74ab 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
environment variable
This is needed so that rpm can pick up target-specific configuration
from target rootfs instead of its own native sysroot.
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
lib/rpmrc.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
Index: git/lib/rpmrc.c
===================================================================
--- git.orig/lib/rpmrc.c
+++ git/lib/rpmrc.c
@@ -455,10 +455,14 @@ const char * lookupInDefaultTable(const
static void setDefaults(void)
{
const char *confdir = rpmConfigDir();
+ const char *etcconfdir = getenv("RPM_ETCCONFIGDIR");
+ if (etcconfdir == NULL)
+ etcconfdir = "";
+
if (!defrcfiles) {
defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":",
confdir, "/" RPMCANONVENDOR "/rpmrc", ":",
- SYSCONFDIR "/rpmrc", ":");
+ etcconfdir, SYSCONFDIR "/rpmrc", ":", NULL);
}
#ifndef MACROFILES
@@ -468,9 +472,9 @@ static void setDefaults(void)
confdir, "/platform/%{_target}/macros", ":",
confdir, "/fileattrs/*.attr", ":",
confdir, "/" RPMCANONVENDOR "/macros", ":",
- SYSCONFDIR "/rpm/macros.*", ":",
- SYSCONFDIR "/rpm/macros", ":",
- SYSCONFDIR "/rpm/%{_target}/macros", ":");
+ etcconfdir, SYSCONFDIR "/rpm/macros.*", ":",
+ etcconfdir, SYSCONFDIR "/rpm/macros", ":",
+ etcconfdir, SYSCONFDIR "/rpm/%{_target}/macros", ":", NULL);
}
#else
macrofiles = MACROFILES;
@@ -997,7 +1001,11 @@ static void read_auxv(void)
*/
static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
{
- const char * const platform_path = SYSCONFDIR "/rpm/platform";
+ const char *etcconfdir = getenv("RPM_ETCCONFIGDIR");
+ if (etcconfdir == NULL)
+ etcconfdir = "";
+
+ const char * const platform_path = rstrscat(NULL, etcconfdir, SYSCONFDIR "/rpm/platform", NULL);
static struct utsname un;
char * chptr;
canonEntry canon;
@@ -1307,6 +1315,7 @@ static void defaultMachine(rpmrcCtx ctx,
if (arch) *arch = un.machine;
if (os) *os = un.sysname;
+ free(platform_path);
}
static
@@ -0,0 +1,55 @@
From 989e425d416474c191b020d0825895e3df4bd033 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(-)
Index: git/lib/rpmscript.c
===================================================================
--- git.orig/lib/rpmscript.c
+++ git/lib/rpmscript.c
@@ -270,7 +270,7 @@ static char * writeScript(const char *cm
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);
@@ -302,7 +302,7 @@ static rpmRC runExtScript(rpmPlugins plu
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);
@@ -354,7 +354,7 @@ static rpmRC runExtScript(rpmPlugins plu
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);
@@ -397,7 +397,7 @@ static rpmRC runExtScript(rpmPlugins plu
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) {
@@ -0,0 +1,51 @@
From ea3187cfcf9cac87e5bc5e7db79b0338da9e355e Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Mon, 26 Jun 2023 12:45:09 +0300
Subject: [PATCH] Don't muck with per-process global sqlite configuration from
the db backend
sqlite3_config() affects all in-process uses of sqlite. librpm being a
low-level library, it has no business whatsoever making such decisions
for the applications running on top of it. Besides that, the callback can
easily end up pointing to an already closed database, causing an
innocent API user to crash in librpm on an entirely unrelated error on
some other database. "Oops."
The sqlite API doesn't seem to provide any per-db or non-global context
for logging errors, thus we can only remove the call and let sqlite output
errors the way it pleases (print through stderr, presumably).
Thanks to Jan Palus for spotting and reporting!
Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/ea3187cfcf9cac87e5bc5e7db79b0338da9e355e]
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
lib/backend/sqlite.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/lib/backend/sqlite.c b/lib/backend/sqlite.c
index 5a029d575a..b612732267 100644
--- a/lib/backend/sqlite.c
+++ b/lib/backend/sqlite.c
@@ -44,13 +44,6 @@ static void rpm_match3(sqlite3_context *sctx, int argc, sqlite3_value **argv)
sqlite3_result_int(sctx, match);
}
-static void errCb(void *data, int err, const char *msg)
-{
- rpmdb rdb = data;
- rpmlog(RPMLOG_WARNING, "%s: %s: %s\n",
- rdb->db_descr, sqlite3_errstr(err), msg);
-}
-
static int dbiCursorReset(dbiCursor dbc)
{
if (dbc->stmt) {
@@ -170,7 +163,6 @@ static int sqlite_init(rpmdb rdb, const char * dbhome)
* the "database is locked" errors at every cost
*/
sqlite3_busy_timeout(sdb, 10000);
- sqlite3_config(SQLITE_CONFIG_LOG, errCb, rdb);
sqlexec(sdb, "PRAGMA secure_delete = OFF");
sqlexec(sdb, "PRAGMA case_sensitive_like = ON");
@@ -0,0 +1,39 @@
From b960c0b43a080287a7c13533eeb2d9f288db1414 Mon Sep 17 00:00:00 2001
From: Florian Festi <ffesti@redhat.com>
Date: Thu, 16 Mar 2023 19:05:04 +0100
Subject: [PATCH] Fix compiler error on clang
Turns out variable declarations are not allowed after a label, even in
C99. And while some compilers don't seem to care others do.
Moving the declaration of mayopen to the start of the function to avoid
this problem.
Resolves: #2435
Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/b960c0b43a080287a7c13533eeb2d9f288db1414]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
lib/fsm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/fsm.c b/lib/fsm.c
index 5671ac642d..183293edb0 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -879,6 +879,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
int nodigest = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOFILEDIGEST) ? 1 : 0;
int nofcaps = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCAPS) ? 1 : 0;
int firstlinkfile = -1;
+ int mayopen = 0;
char *tid = NULL;
struct filedata_s *fdata = xcalloc(fc, sizeof(*fdata));
struct filedata_s *firstlink = NULL;
@@ -1016,7 +1017,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
setmeta:
/* Special files require path-based ops */
- int mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);
+ mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);
if (!rc && fd == -1 && mayopen) {
int flags = O_RDONLY;
/* Only follow safe symlinks, and never on temporary files */
@@ -0,0 +1,204 @@
SUMMARY = "The RPM package management system"
DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
package management system capable of installing, uninstalling, \
verifying, querying, and updating software packages. Each software \
package consists of an archive of files along with information about \
the package like its version, a description, etc."
SUMMARY:${PN}-dev = "Development files for manipulating RPM packages"
DESCRIPTION:${PN}-dev = "This package contains the RPM C library and header files. These \
development files will simplify the process of writing programs that \
manipulate RPM packages and databases. These files are intended to \
simplify the process of creating graphical package managers or any \
other tools that need an intimate knowledge of RPM packages in order \
to function."
SUMMARY:python3-rpm = "Python bindings for apps which will manupulate RPM packages"
DESCRIPTION:python3-rpm = "The python3-rpm package contains a module that permits applications \
written in the Python programming language to use the interface \
supplied by the RPM Package Manager libraries."
HOMEPAGE = "http://www.rpm.org"
# libraries are also LGPL - how to express this?
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=c4eec0c20c6034b9407a09945b48a43f"
SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.18.x;protocol=https \
file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
file://0001-Do-not-read-config-files-from-HOME.patch \
file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \
file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \
file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \
file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
file://0001-perl-disable-auto-reqs.patch \
file://0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch \
file://0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch \
file://0001-build-pack.c-do-not-insert-payloadflags-into-.rpm-me.patch \
file://0001-configure.ac-add-linux-gnux32-variant-to-triplet-han.patch \
file://0001-python-Use-Py_hash_t-instead-of-long-in-hdr_hash.patch \
file://fix-declaration.patch \
file://ea3187cfcf9cac87e5bc5e7db79b0338da9e355e.patch \
"
PE = "1"
SRCREV = "4588bc3f994338502d2770ad24cbfcdaa6c335ec"
S = "${WORKDIR}/git"
DEPENDS = "lua libgcrypt file popt xz bzip2 elfutils python3"
DEPENDS:append:class-native = " file-replacement-native bzip2-replacement-native"
inherit autotools gettext pkgconfig python3native
export PYTHON_ABI
AUTOTOOLS_AUXDIR = "${S}/build-aux"
# OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
EXTRA_AUTORECONF:append = " --exclude=gnu-configize"
# Vendor is detected differently on x86 and aarch64 hosts and can feed into target packages
EXTRA_OECONF:append = " --enable-python --with-crypto=libgcrypt --with-vendor=pc"
EXTRA_OECONF:append:libc-musl = " --disable-nls --disable-openmp"
# --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
# --localstatedir prevents rpm from writing its database to native sysroot when building images
# Forcibly disable plugins for native/nativesdk, as the inhibit and prioreset
# plugins both behave badly inside builds.
EXTRA_OECONF:append:class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
EXTRA_OECONF:append:class-nativesdk = " --sysconfdir=/etc --disable-plugins"
BBCLASSEXTEND = "native nativesdk"
PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'inhibit', '', d)} sqlite zstd"
# The inhibit plugin serves no purpose outside of the target
PACKAGECONFIG:remove:class-native = "inhibit"
PACKAGECONFIG:remove:class-nativesdk = "inhibit"
PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils"
PACKAGECONFIG[inhibit] = "--enable-inhibit-plugin,--disable-inhibit-plugin,dbus"
PACKAGECONFIG[rpm2archive] = "--with-archive,--without-archive,libarchive"
PACKAGECONFIG[sqlite] = "--enable-sqlite=yes,--enable-sqlite=no,sqlite3"
PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
PACKAGECONFIG[ndb] = "--enable-ndb,--disable-ndb"
PACKAGECONFIG[bdb-ro] = "--enable-bdb-ro,--disable-bdb-ro"
PACKAGECONFIG[zstd] = "--enable-zstd=yes,--enable-zstd=no,zstd"
ASNEEDED = ""
# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
# libmagic also has sysroot path contamination, so override it
WRAPPER_TOOLS = " \
${bindir}/rpm \
${bindir}/rpm2archive \
${bindir}/rpm2cpio \
${bindir}/rpmbuild \
${bindir}/rpmdb \
${bindir}/rpmgraph \
${bindir}/rpmkeys \
${bindir}/rpmsign \
${bindir}/rpmspec \
${libdir}/rpm/rpmdeps \
"
do_configure:prepend() {
mkdir -p ${S}/build-aux
}
do_install:append:class-native() {
for tool in ${WRAPPER_TOOLS}; do
test -x ${D}$tool && create_wrapper ${D}$tool \
RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
RPM_NO_CHROOT_FOR_SCRIPTS=1
done
}
do_install:append:class-nativesdk() {
rm -rf ${D}/var
mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh
export RPM_CONFIGDIR="${libdir}/rpm"
export RPM_ETCCONFIGDIR="${SDKPATHNATIVE}"
export RPM_NO_CHROOT_FOR_SCRIPTS=1
EOF
}
# Rpm's make install creates var/tmp which clashes with base-files packaging
do_install:append:class-target() {
rm -rf ${D}/var
}
do_install:append:class-nativesdk() {
rm -rf ${D}${SDKPATHNATIVE}/var
# Ensure find-debuginfo is located correctly inside SDK
mkdir -p ${D}${libdir}/rpm
echo "%__find_debuginfo ${SDKPATHNATIVE}/usr/bin/find-debuginfo" >> ${D}${libdir}/rpm/macros
}
do_install:append () {
sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
${D}/${libdir}/rpm/macros
}
FILES:${PN} += "${libdir}/rpm-plugins/*.so \
"
FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh"
FILES:${PN}-dev += "${libdir}/rpm-plugins/*.la \
"
PACKAGE_BEFORE_PN += "${PN}-build ${PN}-sign ${PN}-archive"
RRECOMMENDS:${PN} += "rpm-sign rpm-archive"
FILES:${PN}-build = "\
${bindir}/rpmbuild \
${bindir}/gendiff \
${bindir}/rpmspec \
${libdir}/librpmbuild.so.* \
${libdir}/rpm/brp-* \
${libdir}/rpm/check-* \
${libdir}/rpm/sepdebugcrcfix \
${libdir}/rpm/find-lang.sh \
${libdir}/rpm/*provides* \
${libdir}/rpm/*requires* \
${libdir}/rpm/*deps* \
${libdir}/rpm/*.prov \
${libdir}/rpm/*.req \
${libdir}/rpm/config.* \
${libdir}/rpm/mkinstalldirs \
${libdir}/rpm/macros.p* \
${libdir}/rpm/fileattrs/* \
"
FILES:${PN}-sign = "\
${bindir}/rpmsign \
${libdir}/librpmsign.so.* \
"
FILES:${PN}-archive = "\
${bindir}/rpm2archive \
"
PACKAGES += "python3-rpm"
PROVIDES += "python3-rpm"
FILES:python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/* ${PYTHON_SITEPACKAGES_DIR}/rpm-*.egg-info"
RDEPENDS:${PN}-build = "bash perl python3-core debugedit"
PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess"
# Do not specify a sysroot when compiling on a target.
rpm_package_preprocess () {
sed -i -e 's:--sysroot[^ ]*::g' \
${PKGD}/${libdir}/rpm/macros
}
SSTATE_HASHEQUIV_FILEMAP = " \
populate_sysroot:*/rpm/macros:${TMPDIR} \
populate_sysroot:*/rpm/macros:${COREBASE} \
"