pisi should manage <ExcludeArch> tags with regex

This commit is contained in:
Mehmet Emre Atasever
2011-04-27 07:35:10 +00:00
parent e76942903b
commit f291d21fb6
2 changed files with 10 additions and 5 deletions
+2 -1
View File
@@ -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>
+5 -1
View File
@@ -311,8 +311,12 @@ 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:
if re.match(arch, architecture):
raise ExcludedArchitectureException( raise ExcludedArchitectureException(
_("pspec.xml avoids this package from building for '%s'") _("pspec.xml avoids this package from building for '%s'")
% architecture) % architecture)