]> scripts.mit.edu Git - wizard.git/commitdiff
Don't register strategies which are redundant.
authorEdward Z. Yang <ezyang@mit.edu>
Sun, 17 Jul 2011 05:02:31 +0000 (01:02 -0400)
committerEdward Z. Yang <ezyang@mit.edu>
Sun, 17 Jul 2011 05:02:31 +0000 (01:02 -0400)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
TODO
wizard/install/__init__.py

diff --git a/TODO b/TODO
index 65347cee9cff502fac9fc6a6c8045eb79d4252bc..8b85d2708f369b64b0704e71b7ef2a50a7027fc2 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,5 +1,4 @@
-- Environment variables don't seem to be overriding plugin
-  strategies; rejigger the order.
+- Strategy introspection and disabling.
 - prepare-config (and others) create .wizard dir even
   when not strictly necessary
 - Bug out immediately if tags are not present in the master tip
index 1f68e742d6946acdb2e9c9723606a180cf33375f..972dc3b4edc07a20fdb741d3cb6b782b7c7c672f 100644 (file)
@@ -305,6 +305,14 @@ class ArgSchema(object):
         for strategy_cls in raw_strategies:
             try:
                 strategy = strategy_cls(self, application, dir, web_stub_path)
+                # don't bother with strategies who are already
+                # fully handled
+                if strategy.provides <= self.provides:
+                    # this could exacerbate a bug in a strategy
+                    # which thinks that it's OK post prepare, but
+                    # actually isn't.  There's now not an easy way to
+                    # say "don't actually run that strategy, please.
+                    continue
                 strategy.prepare()
                 self.provides |= strategy.provides
                 self.strategies.append(strategy)