From dda574e080b69428bf08273db64f832100fda3d5 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 5 Jan 2013 12:36:01 +0000 Subject: [PATCH] [matter] add soft-blocker parameter support --- matter/matter/builder.py | 10 ++++++++++ matter/matter/spec.py | 7 +++++++ matter/matter_examples/entropy.particle | 5 +++++ matter/matter_examples/fail.particle | 5 +++++ matter/matter_examples/misc.particle | 5 +++++ matter/matter_examples/zlib.particle | 5 +++++ 6 files changed, 37 insertions(+) diff --git a/matter/matter/builder.py b/matter/matter/builder.py index d648e3172..2fb63d04b 100644 --- a/matter/matter/builder.py +++ b/matter/matter/builder.py @@ -313,6 +313,16 @@ class PackageBuilder(object): # list of _emerge.Package.Package objects package_queue = graph.altlist() + allow_soft_blocker = self._params['soft-blocker'] == "yes" + if not allow_soft_blocker: + blockers = [x for x in package_queue if isinstance(x, Blocker)] + if blockers: + # sorry, we're not allowed to have soft-blockers + print_warning("the following soft-blockers were found:") + print_warning("\n ".join([x.atom for x in blockers])) + print_warning("but 'soft-blocker: no' in config, aborting") + return None + # filter out blockers real_queue = [x for x in package_queue if not isinstance( x, Blocker)] diff --git a/matter/matter/spec.py b/matter/matter/spec.py index 294762b41..2254a082a 100644 --- a/matter/matter/spec.py +++ b/matter/matter/spec.py @@ -185,6 +185,13 @@ class MatterSpec(GenericSpecFunctions): 'desc': "Allow compiling packages even if they " "are not \n\tactually installed on the System? (yes/no)", }, + 'soft-blocker': { + 'cb': self.valid_yes_no, + 've': self.ve_string_stripper, + 'default': "yes", + 'desc': "Allow soft-blockers in the merge queue?\n " + "Packages will be unmerged if yes. (yes/no)", + }, 'pkgpre': { 'cb': self.not_none, 've': self.ve_string_open_file_read, diff --git a/matter/matter_examples/entropy.particle b/matter/matter_examples/entropy.particle index 3be32aea3..84e2d660a 100644 --- a/matter/matter_examples/entropy.particle +++ b/matter/matter_examples/entropy.particle @@ -46,6 +46,11 @@ spm-repository-change-if-upstreamed: yes # Default is: no not-installed: no +# Allow soft-blockers in the merge queue? Packages will be unmerged if yes. +# Valid values are either "yes" or "no" +# Default is: yes +soft-blocker: yes + # Allow dependencies to be pulled in? # Valid values are either "yes" or "no" # Default is: no diff --git a/matter/matter_examples/fail.particle b/matter/matter_examples/fail.particle index db960326f..4df4529ab 100644 --- a/matter/matter_examples/fail.particle +++ b/matter/matter_examples/fail.particle @@ -27,6 +27,11 @@ spm-repository-change: yes # Default is: no not-installed: yes +# Allow soft-blockers in the merge queue? Packages will be unmerged if yes. +# Valid values are either "yes" or "no" +# Default is: yes +soft-blocker: yes + # Allow dependencies to be pulled in? # Valid values are either "yes" or "no" # Default is: no diff --git a/matter/matter_examples/misc.particle b/matter/matter_examples/misc.particle index bfe2f4268..c7dfe0738 100644 --- a/matter/matter_examples/misc.particle +++ b/matter/matter_examples/misc.particle @@ -34,6 +34,11 @@ spm-repository-change-if-upstreamed: yes # Default is: no not-installed: no +# Allow soft-blockers in the merge queue? Packages will be unmerged if yes. +# Valid values are either "yes" or "no" +# Default is: yes +soft-blocker: yes + # Allow dependencies to be pulled in? # Valid values are either "yes" or "no" # Default is: no diff --git a/matter/matter_examples/zlib.particle b/matter/matter_examples/zlib.particle index a327dac64..362209fbc 100644 --- a/matter/matter_examples/zlib.particle +++ b/matter/matter_examples/zlib.particle @@ -34,6 +34,11 @@ spm-repository-change-if-upstreamed: yes # Default is: no not-installed: no +# Allow soft-blockers in the merge queue? Packages will be unmerged if yes. +# Valid values are either "yes" or "no" +# Default is: yes +soft-blocker: yes + # Allow dependencies to be pulled in? # Valid values are either "yes" or "no" # Default is: no