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>
+8 -4
View File
@@ -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)