Skip to content

Commit

Permalink
rpmbuild: skip only if all macros in ExclusiveArch and ExcludeArch ev…
Browse files Browse the repository at this point in the history
…aluated

Fix fedora-copr#3244
  • Loading branch information
FrostyX committed Nov 18, 2024
1 parent 208d68b commit a8135c6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions rpmbuild/copr_rpmbuild/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,24 @@ def exclusivearch(self):
"""
Evaluated %{exclusivearch} as a list
"""
return self.safe_attr("exclusivearch").split()
values = self.safe_attr("exclusivearch").split()
unknown = " ".join([x for x in values if x.startswith("%")])
if unknown:
log.warning("Unknown macros in ExclusiveArch: %s", unknown)
return []
return values

@property
def excludearch(self):
"""
Evaluated %{excludearch} as a list
"""
return self.safe_attr("excludearch").split()
values = self.safe_attr("excludearch").split()
unknown = " ".join([x for x in values if x.startswith("%")])
if unknown:
log.warning("Unknown macros in ExcludeArch: %s", unknown)
return []
return values

def safe_attr(self, name):
"""
Expand Down

0 comments on commit a8135c6

Please sign in to comment.