From 14d16b44526fda69d8a7fa21379061001eb840ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20=C3=87a=C4=9Flayan?= Date: Sat, 20 Feb 2010 10:26:37 +0000 Subject: [PATCH] Feature: Add ability to avoid source packages from building on specific architectures Example: psyco .. .. x86_64 will avoid the package psyco from building on systems where pisi.conf->architecture == x86_64 --- pisi-spec.rng | 3 +++ pisi/operations/build.py | 8 ++++++++ pisi/specfile.py | 1 + 3 files changed, 12 insertions(+) diff --git a/pisi-spec.rng b/pisi-spec.rng index 1c72dfe7..92dd4363 100644 --- a/pisi-spec.rng +++ b/pisi-spec.rng @@ -26,6 +26,9 @@ + + + diff --git a/pisi/operations/build.py b/pisi/operations/build.py index d3cdb5de..4364c5f2 100644 --- a/pisi/operations/build.py +++ b/pisi/operations/build.py @@ -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() diff --git a/pisi/specfile.py b/pisi/specfile.py index 48755b9d..ca9e954f 100644 --- a/pisi/specfile.py +++ b/pisi/specfile.py @@ -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]