fix macros autopath num error

Signed-off-by: yangchenguang <yangchenguang@kylinsec.com.cn>
(cherry picked from commit 660cc6d31e01064789ea42e31fcf8e42c09a7add)
This commit is contained in:
yangchenguang 2024-03-26 10:50:57 +08:00 committed by openeuler-sync-bot
parent 61dca9f7ad
commit 44692f0e43
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,36 @@
From 0e09712b6e67c704ea1c9fcc57d6fb0497691063 Mon Sep 17 00:00:00 2001
From: yangchenguang <yangchenguang@kylinsec.com.cn>
Date: Tue, 26 Mar 2024 10:27:35 +0800
Subject: [PATCH] fix macros autopath num error
fix: https://github.com/rpm-software-management/rpm/commit/c495d73449cb707bf8b3a0f47a67bba115c00bcf
%autopatch: Fix patch number parameters
Those where not converted to integers for to lookup though not converted
to the actual file name.
Thanks to Vít Ondruch for pointing this out, suggesting the fix and
insisting on a test case!
Resolves: #1766
Signed-off-by: yangchenguang <yangchenguang@kylinsec.com.cn>
---
macros.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/macros.in b/macros.in
index 4dbf5b6..643b02b 100644
--- a/macros.in
+++ b/macros.in
@@ -1256,7 +1256,7 @@ for i, p in ipairs(patches) do
bynum[patch_nums[i]] = p
end
for i, a in ipairs(arg) do
- local p = bynum[a]
+ local p = bynum[tonumber(a)]
if p then
print(rpm.expand("%__apply_patch -m %{basename:"..p.."} "..options..p.." "..i.."\\n"))
else
--
2.39.1

View File

@ -1,6 +1,6 @@
Name: rpm
Version: 4.17.0
Release: 35
Release: 36
Summary: RPM Package Manager
License: GPLv2+
URL: http://www.rpm.org/
@ -120,6 +120,7 @@ Patch6081: backport-Fix-spec-parser-leaks-from-trans-f-file.patch
Patch6082: backport-Tip-toe-around-rpmfiFN-thin-ice-in-fsm.patch
Patch6083: backport-Fix-a-memleak-on-invalid-command-line-options.patch
Patch6084: backport-Let-eBPF-ELF-files-be-packaged-in-noarch-packages.patch
Patch6085: fix-macros-autopath-num-error.patch
BuildRequires: gcc autoconf automake libtool make gawk popt-devel openssl-devel readline-devel
BuildRequires: zlib-devel zstd-devel >= 1.3.8 xz-devel bzip2-devel libarchive-devel ima-evm-utils-devel
@ -410,6 +411,9 @@ make check || (cat tests/rpmtests.log; exit 0)
%{_mandir}/man1/gendiff.1*
%changelog
* Tue Mar 26 2024 yangchenguang <yangchenguang@kylinsec.com.cn> - 4.17.0-36
- fix macros autopath num error
* Mon Mar 25 2024 hongjinghao<hongjinghao@huawei.com> - 4.17.0-35
- Fix memleak and let eBPF ELF files be packaged in noarch packages