Fix: Treat x86_64_v2 as x86_64 in architecture checks

This commit is contained in:
eabdullin 2024-07-09 17:10:30 +03:00
parent c66943d244
commit c9cc2ae55c
2 changed files with 50 additions and 2 deletions

View File

@ -0,0 +1,42 @@
From 86efc664f71721cb2fb1ec512f29b36876f86baa Mon Sep 17 00:00:00 2001
From: eabdullin <ed.abdullin.1@gmail.com>
Date: Tue, 9 Jul 2024 17:03:27 +0300
Subject: [PATCH] Fix: Treat x86_64_v2 as x86_64 in architecture checks
This change allows spec files to use x86_64_v2 as an alias for x86_64, ensuring compatibility with packages and build scripts expecting x86_64.
---
build/parseSpec.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/build/parseSpec.c b/build/parseSpec.c
index d6e998a..102ce5b 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -425,7 +425,24 @@ do { \
return PART_ERROR; \
} \
match = matchTok(exp, s); \
+ /* Additional check for x86_64_v2 */ \
+ char *s_copy = strdup(s); \
+ if (s_copy == NULL) { \
+ rpmlog(RPMLOG_ERR, _("Memory allocation error\n")); \
+ return PART_ERROR; \
+ } \
+ char *newline = strchr(s_copy, '\n'); \
+ if (newline) *newline = '\0'; \
+ char *token_ptr = strtok(s_copy, " "); \
+ while (token_ptr != NULL) { \
+ if (!match && strcmp(token_ptr, "x86_64") == 0 && strcmp(exp, "x86_64_v2") == 0) { \
+ match = 1; \
+ break; \
+ } \
+ token_ptr = strtok(NULL, " "); \
+ } \
free(exp); \
+ free(s_copy); \
} while (0)
--
2.39.3 (Apple Git-146)

View File

@ -36,7 +36,7 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
Release: %{?snapver:0.%{snapver}.}%{baserelease}%{?dist}
Release: %{?snapver:0.%{snapver}.}%{baserelease}%{?dist}.alma.1
Url: http://www.rpm.org/
License: GPL-2.0-or-later
Source0: http://ftp.rpm.org/releases/%{srcdir}/rpm-%{srcver}.tar.bz2
@ -124,6 +124,9 @@ Requires(pre): findutils
Requires(pre): sed
%patchlist
# AlmaLinux specific patches
0001-Fix-Treat-x86_64_v2-as-x86_64-in-architecture-checks.patch
# Set rpmdb path to /usr/lib/sysimage/rpm
rpm-4.17.x-rpm_dbpath.patch
# Disable autoconf config.site processing (#962837)
@ -348,6 +351,7 @@ change.
%prep
%autosetup -n rpm-%{srcver} -p1
cat
%build
%set_build_flags
@ -614,6 +618,9 @@ fi
%doc %{_defaultdocdir}/rpm/API/
%changelog
* Tue Jul 09 2024 Eduard Abdullin <eabdullin@almalinux.org> - 4.19.1.1-2.alma.1
- Fix: Treat x86_64_v2 as x86_64 in architecture checks
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 4.19.1.1-2
- Bump release for June 2024 mass rebuild
@ -1336,4 +1343,3 @@ fi
* Thu Aug 10 2017 Panu Matilainen <pmatilai@redhat.com> - 4.13.90-0.git14000.1
- Rebase to rpm 4.13.90 aka 4.14.0-alpha (#1474836)