- Fix ExclusiveArch/ExcludeArch for noarch packages

- Resolves: #1298668
This commit is contained in:
Florian Festi 2016-02-26 11:23:45 +01:00
parent 13b1b5af07
commit 43e89ed19f
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,32 @@
From d53499d1565dd7ba6d93939e552cc604b26dccd7 Mon Sep 17 00:00:00 2001
From: Florian Festi <ffesti@redhat.com>
Date: Fri, 26 Feb 2016 11:15:23 +0100
Subject: [PATCH] Use %_build_cpu instead of noarch when evaluating ExcludeArch
and ExclusiveArch
Some noarch packages need build tools not available on all architectures.
By using %_build_cpu you can restrict the architectures those noarch
packages can be build on.
---
build/parsePreamble.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index 13501de..933f734 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -428,6 +428,11 @@ static rpmRC checkForValidArchitectures(rpmSpec spec)
char *arch = rpmExpand("%{_target_cpu}", NULL);
char *os = rpmExpand("%{_target_os}", NULL);
rpmRC rc = RPMRC_FAIL; /* assume failure */
+
+ if (!strcmp(arch, "noarch")) {
+ free(arch);
+ arch = rpmExpand("%{_build_cpu}", NULL);
+ }
if (isMemberInEntry(spec->buildRestrictions,
arch, RPMTAG_EXCLUDEARCH) == 1) {
--
2.5.0

View File

@ -29,7 +29,7 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
Release: %{?snapver:0.%{snapver}.}25%{?dist}
Release: %{?snapver:0.%{snapver}.}26%{?dist}
Group: System Environment/Base
Url: http://www.rpm.org/
Source0: http://rpm.org/releases/rpm-4.12.x/%{name}-%{srcver}.tar.bz2
@ -71,6 +71,7 @@ Patch115: rpm-4.13.0-unlimited-macro-expand.patch
Patch116: rpm-4.13.0-idle-and-sleep-in-systemd-inhibit.patch
Patch117: rpm-4.13.0-add-mipsr6-support.patch
Patch118: rpm-4.13.0-Use-pkg-dpaths-during-dependency-generation.patch
Patch119: rpm-4.13.0-Noarch-ExclusiveArch.patch
# These are not yet upstream
Patch302: rpm-4.7.1-geode-i686.patch
@ -581,6 +582,9 @@ exit 0
%doc doc/librpm/html/*
%changelog
* Fri Feb 26 2016 Florian Festi <ffesti@rpm.org> - 4.4.13.0-0.rc1.26
- Fix ExclusiveArch/ExcludeArch for noarch packages (#1298668)
* Thu Feb 25 2016 Florian Festi <ffesti@rpm.org> - 4.4.13.0-0.rc1.25
- Fix dependencies for RemovePathPostfixes (#1306559)