From 492bac7714f4e6a61dd0f87b35c01de5689860db Mon Sep 17 00:00:00 2001 From: panxiaohe Date: Fri, 26 Aug 2022 15:28:38 +0800 Subject: [PATCH] get instance correctly for eu-ar -N, use make macros and upstream patch for no stdin flag --- ...nstance-correctly-for-eu-ar-N-option.patch | 34 +++++++++++++++++++ ...ckport-elfclassify-Fix-no-stdin-flag.patch | 21 +++++++----- elfutils.spec | 14 +++++--- 3 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 Get-instance-correctly-for-eu-ar-N-option.patch rename eu-elfclassify-no-stdin-should-use-classify_flag_no_stdin.patch => backport-elfclassify-Fix-no-stdin-flag.patch (56%) diff --git a/Get-instance-correctly-for-eu-ar-N-option.patch b/Get-instance-correctly-for-eu-ar-N-option.patch new file mode 100644 index 0000000..ad0828f --- /dev/null +++ b/Get-instance-correctly-for-eu-ar-N-option.patch @@ -0,0 +1,34 @@ +From 246d6d0ffcfe9ac6ef3581ca74399036aa827590 Mon Sep 17 00:00:00 2001 +From: panxiaohe +Date: Fri, 12 Aug 2022 17:05:40 +0800 +Subject: [PATCH] get instance correctly for eu-ar -N option + +--- + src/ar.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/ar.c b/src/ar.c +index 42126aa..f8166d3 100644 +--- a/src/ar.c ++++ b/src/ar.c +@@ -518,7 +518,7 @@ do_oper_extract (int oper, const char *arfname, char **argv, int argc, + ENTRY entry; + entry.key = arhdr->ar_name; + ENTRY *res = hsearch (entry, FIND); +- if (res != NULL && (instance < 0 || instance-- == 0) ++ if (res != NULL && (instance < 0 || --instance == 0) + && !found[(char **) res->data - argv]) + found[(char **) res->data - argv] = do_extract = true; + } +@@ -952,7 +952,7 @@ do_oper_delete (const char *arfname, char **argv, int argc, + ENTRY entry; + entry.key = arhdr->ar_name; + ENTRY *res = hsearch (entry, FIND); +- if (res != NULL && (instance < 0 || instance-- == 0) ++ if (res != NULL && (instance < 0 || --instance == 0) + && !found[(char **) res->data - argv]) + found[(char **) res->data - argv] = do_delete = true; + } +-- +2.27.0 + diff --git a/eu-elfclassify-no-stdin-should-use-classify_flag_no_stdin.patch b/backport-elfclassify-Fix-no-stdin-flag.patch similarity index 56% rename from eu-elfclassify-no-stdin-should-use-classify_flag_no_stdin.patch rename to backport-elfclassify-Fix-no-stdin-flag.patch index a89c112..3186143 100644 --- a/eu-elfclassify-no-stdin-should-use-classify_flag_no_stdin.patch +++ b/backport-elfclassify-Fix-no-stdin-flag.patch @@ -1,18 +1,23 @@ -From 6ac20db56ab5e431b128a9f80d294bcf82111e29 Mon Sep 17 00:00:00 2001 -From: panxiaohe -Date: Thu, 17 Feb 2022 15:39:23 +0800 -Subject: [PATCH] eu-elfclassify: --no-stdin option should use - classify_flag_no_stdin +From 6398e94e9ac9a170da088768198d4a2b6e989e19 Mon Sep 17 00:00:00 2001 +From: Mark Wielaard +Date: Sun, 24 Apr 2022 17:48:39 +0200 +Subject: [PATCH] elfclassify: Fix --no-stdin flag +The no-stdin option was using the wrong flag, classify_flag_stdin, +instead of classify_flag_no_stdin. + +https://sourceware.org/bugzilla/show_bug.cgi?id=28724 + +Signed-off-by: Mark Wielaard --- src/elfclassify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elfclassify.c b/src/elfclassify.c -index 535cc49..712e08f 100644 +index 2f70b29a..25fe9a65 100644 --- a/src/elfclassify.c +++ b/src/elfclassify.c -@@ -948,7 +948,7 @@ separated by newlines"), 2 }, +@@ -946,7 +946,7 @@ separated by newlines"), 2 }, { "stdin0", classify_flag_stdin0, NULL, 0, N_("Also read file names to process from standard input, \ separated by ASCII NUL bytes"), 2 }, @@ -22,5 +27,5 @@ index 535cc49..712e08f 100644 { "compressed", 'z', NULL, 0, N_("Try to open compressed files or embedded (kernel) ELF images"), -- -1.8.3.1 +2.27.0 diff --git a/elfutils.spec b/elfutils.spec index 938f0fb..01a3a5d 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,15 +1,16 @@ # -*- rpm-spec from http://elfutils.org/ -*- Name: elfutils Version: 0.180 -Release: 6 +Release: 7 Summary: A collection of utilities and DSOs to handle ELF files and DWARF data URL: http://elfutils.org/ License: GPLv3+ and (GPLv2+ or LGPLv3+) Source: ftp://sourceware.org/pub/elfutils/%{version}/elfutils-%{version}.tar.bz2 -Patch0: eu-elfclassify-no-stdin-should-use-classify_flag_no_stdin.patch +Patch0: backport-elfclassify-Fix-no-stdin-flag.patch Patch1: Fix-error-of-parsing-object-file-perms.patch Patch2: Fix-issue-of-moving-files-by-ar-or-br.patch +Patch3: Get-instance-correctly-for-eu-ar-N-option.patch Provides: elfutils-libelf elfutils-default-yama-scope default-yama-scope elfutils-libs Obsoletes: elfutils-libelf elfutils-default-yama-scope elfutils-libs @@ -112,7 +113,7 @@ such servers to download those files on demand. %build %configure --program-prefix=%{_programprefix} -make -s %{?_smp_mflags} +%make_build %install rm -rf ${RPM_BUILD_ROOT} @@ -128,7 +129,7 @@ mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/cache/debuginfod touch ${RPM_BUILD_ROOT}%{_localstatedir}/cache/debuginfod/debuginfod.sqlite %check -make -s %{?_smp_mflags} check +%make_build check %clean rm -rf ${RPM_BUILD_ROOT} @@ -236,6 +237,11 @@ exit 0 %systemd_postun_with_restart debuginfod.service %changelog +* Fri Aug 26 2022 panxiaohe - 0.180-7 +- Get instance correctly for eu-ar -N option +- Use make macros +- Use upstream patch for no stdin flag + * Wed Aug 24 2022 yixiangzhike - 0.180-6 - Fix issue of moving files by ar or br -- Gitee