mavit / rpms / rpm

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