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:
@@ -26,6 +26,9 @@
|
|||||||
<ref name="Name"/>
|
<ref name="Name"/>
|
||||||
<ref name="Homepage"/>
|
<ref name="Homepage"/>
|
||||||
<ref name="Packager"/>
|
<ref name="Packager"/>
|
||||||
|
<zeroOrMore>
|
||||||
|
<ref name="ExcludeArch">
|
||||||
|
</zeroOrMore>
|
||||||
<oneOrMore>
|
<oneOrMore>
|
||||||
<ref name="License"/>
|
<ref name="License"/>
|
||||||
</oneOrMore>
|
</oneOrMore>
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ class ActionScriptException(Error):
|
|||||||
class AbandonedFilesException(Error):
|
class AbandonedFilesException(Error):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class ExcludedArchitectureException(Error):
|
||||||
|
pass
|
||||||
|
|
||||||
# Helper Functions
|
# Helper Functions
|
||||||
def get_file_type(path, pinfo_list, install_dir):
|
def get_file_type(path, pinfo_list, install_dir):
|
||||||
"""Return the file type of a path according to the given PathInfo
|
"""Return the file type of a path according to the given PathInfo
|
||||||
@@ -241,6 +244,11 @@ class Builder:
|
|||||||
def build(self):
|
def build(self):
|
||||||
"""Build the package in one shot."""
|
"""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)
|
ctx.ui.status(_("Building PiSi source package: %s") % self.spec.source.name)
|
||||||
|
|
||||||
self.compile_action_script()
|
self.compile_action_script()
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ class Source:
|
|||||||
t_Name = [autoxml.String, autoxml.mandatory]
|
t_Name = [autoxml.String, autoxml.mandatory]
|
||||||
t_Homepage = [autoxml.String, autoxml.optional]
|
t_Homepage = [autoxml.String, autoxml.optional]
|
||||||
t_Packager = [Packager, autoxml.mandatory]
|
t_Packager = [Packager, autoxml.mandatory]
|
||||||
|
t_ExcludeArch = [ [autoxml.String], autoxml.optional]
|
||||||
t_License = [ [autoxml.String], autoxml.mandatory]
|
t_License = [ [autoxml.String], autoxml.mandatory]
|
||||||
t_IsA = [ [autoxml.String], autoxml.optional]
|
t_IsA = [ [autoxml.String], autoxml.optional]
|
||||||
t_PartOf = [autoxml.String, autoxml.optional]
|
t_PartOf = [autoxml.String, autoxml.optional]
|
||||||
|
|||||||
Reference in New Issue
Block a user