!344 backport some patches from upstream

From: @hugel 
Reviewed-by: @xujing99 
Signed-off-by: @xujing99
This commit is contained in:
openeuler-ci-bot 2024-06-12 08:19:22 +00:00 committed by Gitee
commit a61350084f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 196 additions and 1 deletions

View File

@ -0,0 +1,33 @@
From 6c01f4c84f768b6c6b247a11106bf51b40015e66 Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Mon, 18 Mar 2024 09:56:51 +0200
Subject: [PATCH] Fix an enum/int type mismatch in rpmfiArchiveReadToFilePsm()
rpmfiDigestAlgo() hysterically returns a signed int (and that's what
really ought to be changed) but lets at least make all these uses
consistent.
Conflict:modify pgpHashAlgo instead of rpmHashAlgo because
01d6605d93e9b5 is not mearged.
Reference:https://github.com/rpm-software-management/rpm/commit/6c01f4c84f768b6c6b247a11106bf51b40015e66
---
lib/rpmfi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/rpmfi.c b/lib/rpmfi.c
index cfb388b4c..db1460711 100644
--- a/lib/rpmfi.c
+++ b/lib/rpmfi.c
@@ -2384,7 +2384,7 @@ int rpmfiArchiveReadToFilePsm(rpmfi fi, FD_t fd, int nodigest, rpmpsm psm)
rpm_loff_t left = rpmfiFSize(fi);
const unsigned char * fidigest = NULL;
- pgpHashAlgo digestalgo = 0;
+ int digestalgo = 0;
int rc = 0;
char buf[BUFSIZ*4];
--
2.33.0

View File

@ -0,0 +1,28 @@
From 90cfa466ae88b06595012084eada25a42064322c Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Mon, 18 Mar 2024 09:48:48 +0200
Subject: [PATCH] Fix an enum/int type mismatch in transaction verify code
Conflict:NA
Reference:https://github.com/rpm-software-management/rpm/commit/90cfa466ae88b06595012084eada25a42064322c
---
lib/transaction.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/transaction.c b/lib/transaction.c
index fcde554a6..6a49eb242 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -1288,7 +1288,7 @@ static int verifyPackageFiles(rpmts ts, rpm_loff_t total)
.vfylevel = vfylevel,
};
int verified = 0;
- rpmRC prc = RPMRC_FAIL;
+ int prc = RPMRC_FAIL;
rpmtsNotify(ts, p, RPMCALLBACK_VERIFY_PROGRESS, oc++, total);
FD_t fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_OPEN_FILE, 0, 0);
--
2.33.0

View File

@ -0,0 +1,30 @@
From 3a227fdf2965aa6bfc0727170419e9da6cf1fbe2 Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Mon, 18 Mar 2024 09:50:05 +0200
Subject: [PATCH] Fix enum type mismatch in rpmTagGetValue()
This returns a tag value, not type.
Conflict:NA
Reference:https://github.com/rpm-software-management/rpm/commit/3a227fdf2965aa6bfc0727170419e9da6cf1fbe2
---
lib/tagname.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/tagname.c b/lib/tagname.c
index 4e7c30d2b..4748cf19c 100644
--- a/lib/tagname.c
+++ b/lib/tagname.c
@@ -171,7 +171,7 @@ rpmTagType rpmTagGetType(rpmTagVal tag)
rpmTagVal rpmTagGetValue(const char * tagstr)
{
const struct headerTagTableEntry_s *t;
- rpmTagType tagval = RPMTAG_NOT_FOUND;
+ rpmTagVal tagval = RPMTAG_NOT_FOUND;
pthread_once(&tagsLoaded, loadTags);
--
2.33.0

View File

@ -0,0 +1,68 @@
From f2eb6fa6ba77fbf5f62add8a01544cce8c0beb6b Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Fri, 15 Mar 2024 16:41:28 +0200
Subject: [PATCH] Fix some int/enum confusion in the build code
These things are not really returning rpmRC values, especially as they
need to pass around RPMRC_MISSINGBUILDREQUIRES which is not part of the
enum.
For doRmSource(), 0 and 1 aren't any more enums values than 0 and -1 are,
and besides, the sole caller isn't even checking the return code.
Conflict:NA
Reference:https://github.com/rpm-software-management/rpm/commit/f2eb6fa6ba77fbf5f62add8a01544cce8c0beb6b
---
build/build.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/build/build.c b/build/build.c
index 8e6c8f842..69ab69fc9 100644
--- a/build/build.c
+++ b/build/build.c
@@ -78,7 +78,7 @@ static char * buildHost(void)
/**
*/
-static rpmRC doRmSource(rpmSpec spec)
+static int doRmSource(rpmSpec spec)
{
struct Source *p;
Package pkg;
@@ -100,7 +100,7 @@ static rpmRC doRmSource(rpmSpec spec)
}
}
exit:
- return !rc ? 0 : 1;
+ return rc;
}
/*
@@ -290,9 +290,9 @@ static int doBuildRequires(rpmSpec spec, int test)
return rc;
}
-static rpmRC doCheckBuildRequires(rpmts ts, rpmSpec spec, int test)
+static int doCheckBuildRequires(rpmts ts, rpmSpec spec, int test)
{
- rpmRC rc = RPMRC_OK;
+ int rc = RPMRC_OK;
rpmps ps = rpmSpecCheckDeps(ts, spec);
if (ps) {
@@ -323,9 +323,9 @@ static rpmRC doBuildDir(rpmSpec spec, int test, StringBuf *sbp)
return rc;
}
-static rpmRC buildSpec(rpmts ts, BTA_t buildArgs, rpmSpec spec, int what)
+static int buildSpec(rpmts ts, BTA_t buildArgs, rpmSpec spec, int what)
{
- rpmRC rc = RPMRC_OK;
+ int rc = RPMRC_OK;
int missing_buildreqs = 0;
int test = (what & RPMBUILD_NOBUILD);
char *cookie = buildArgs->cookie ? xstrdup(buildArgs->cookie) : NULL;
--
2.33.0

View File

@ -0,0 +1,28 @@
From 1d6987a8ede061db611ff02eda62315e0ae24d2b Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Mon, 18 Mar 2024 10:02:52 +0200
Subject: [PATCH] Use the internal DB_CTRL* enum for intenal uses consistently
Conflict:NA
Reference:https://github.com/rpm-software-management/rpm/commit/1d6987a8ede061db611ff02eda62315e0ae24d2b
---
lib/rpmdb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
index 2f0d72afd..4ad12230b 100644
--- a/lib/rpmdb.c
+++ b/lib/rpmdb.c
@@ -69,7 +69,7 @@ static int buildIndexes(rpmdb db)
dbSetFSync(db, 0);
- dbCtrl(db, RPMDB_CTRL_LOCK_RW);
+ dbCtrl(db, DB_CTRL_LOCK_RW);
mi = rpmdbInitIterator(db, RPMDBI_PACKAGES, NULL, 0);
while ((h = rpmdbNextIterator(mi))) {
--
2.33.0

View File

@ -1,6 +1,6 @@
Name: rpm
Version: 4.15.1
Release: 56
Release: 57
Summary: RPM Package Manager
License: GPLv2+
URL: http://www.rpm.org/
@ -215,6 +215,11 @@ Patch193: backport-Fix-spec-parser-leaks-from-trans-f-file.patch
Patch194: backport-Tip-toe-around-rpmfiFN-thin-ice-in-fsm.patch
Patch195: backport-Fix-a-memleak-on-invalid-command-line-options.patch
Patch196: backport-Let-eBPF-ELF-files-be-packaged-in-noarch-packages.patch
Patch197: backport-Fix-some-int-enum-confusion-in-the-build-code.patch
Patch198: backport-Use-the-internal-DB_CTRL-enum-for-intenal-uses-consi.patch
Patch199: backport-Fix-an-enum-int-type-mismatch-in-rpmfiArchiveReadToF.patch
Patch200: backport-Fix-an-enum-int-type-mismatch-in-transaction-verify-.patch
Patch201: backport-Fix-enum-type-mismatch-in-rpmTagGetValue.patch
BuildRequires: gcc autoconf automake libtool make gawk popt-devel openssl-devel readline-devel libdb-devel
BuildRequires: zlib-devel libzstd-devel xz-devel bzip2-devel libarchive-devel ima-evm-utils-devel
@ -511,6 +516,9 @@ make check || (cat tests/rpmtests.log; exit 0)
%{_mandir}/man1/gendiff.1*
%changelog
* Wed Jun 12 2024 gengqihu<gengqihu2@h-partners.com> - 4.15.1-57
- Backport some patches from upstream
* Mon Mar 25 2024 hongjinghao<hongjinghao@huawei.com> - 4.15.1-56
- Fix memleak and let eBPF ELF files be packaged in noarch packages