pisi should manage <ExcludeArch> tags with regex
This commit is contained in:
+2
-1
@@ -175,8 +175,9 @@
|
||||
<define name="ExcludeArch">
|
||||
<element name="ExcludeArch">
|
||||
<choice>
|
||||
<value>i686</value>
|
||||
<value>i[3-6]86</value>
|
||||
<value>x86_64</value>
|
||||
<value>arm.*</value>
|
||||
</choice>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
@@ -311,11 +311,15 @@ class Builder:
|
||||
def build(self):
|
||||
"""Build the package in one shot."""
|
||||
|
||||
# excludeArch should accept regex.
|
||||
# eg. <exludeArch>arm.*</exludeArch> armv7l, armv5te matches
|
||||
# <exludeArch>i[3-6]86</exludeArch> i386, i486, i586, i686 matches
|
||||
architecture = ctx.config.values.general.architecture
|
||||
if architecture in self.spec.source.excludeArch:
|
||||
raise ExcludedArchitectureException(
|
||||
_("pspec.xml avoids this package from building for '%s'")
|
||||
% architecture)
|
||||
for arch in self.spec.source.excludeArch:
|
||||
if re.match(arch, architecture):
|
||||
raise ExcludedArchitectureException(
|
||||
_("pspec.xml avoids this package from building for '%s'")
|
||||
% architecture)
|
||||
|
||||
ctx.ui.status(_("Building source package: %s")
|
||||
% self.spec.source.name)
|
||||
|
||||
Reference in New Issue
Block a user