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