Feature: Add ability to avoid source packages from building on specific architectures

Example:

<Source>
    <Name>psyco</Name>
    ..
    ..
    <ExcludeArch>x86_64</ExcludeArch>
</Source>

will avoid the package psyco from building on systems where pisi.conf->architecture == x86_64
This commit is contained in:
Ozan Çağlayan
2010-02-20 10:26:37 +00:00
parent c1309395f2
commit 14d16b4452
3 changed files with 12 additions and 0 deletions
+3
View File
@@ -26,6 +26,9 @@
<ref name="Name"/>
<ref name="Homepage"/>
<ref name="Packager"/>
<zeroOrMore>
<ref name="ExcludeArch">
</zeroOrMore>
<oneOrMore>
<ref name="License"/>
</oneOrMore>
+8
View File
@@ -51,6 +51,9 @@ class ActionScriptException(Error):
class AbandonedFilesException(Error):
pass
class ExcludedArchitectureException(Error):
pass
# Helper Functions
def get_file_type(path, pinfo_list, install_dir):
"""Return the file type of a path according to the given PathInfo
@@ -241,6 +244,11 @@ class Builder:
def build(self):
"""Build the package in one shot."""
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)
ctx.ui.status(_("Building PiSi source package: %s") % self.spec.source.name)
self.compile_action_script()
+1
View File
@@ -164,6 +164,7 @@ class Source:
t_Name = [autoxml.String, autoxml.mandatory]
t_Homepage = [autoxml.String, autoxml.optional]
t_Packager = [Packager, autoxml.mandatory]
t_ExcludeArch = [ [autoxml.String], autoxml.optional]
t_License = [ [autoxml.String], autoxml.mandatory]
t_IsA = [ [autoxml.String], autoxml.optional]
t_PartOf = [autoxml.String, autoxml.optional]