[jhbuild] skip phases that do not exist



commit a9e5660fe65d73aaee6d996a91a43629db8d121c
Author: Frédéric Péters <fpeters 0d be>
Date:   Sat May 23 17:36:36 2009 +0200

    skip phases that do not exist
---
 jhbuild/frontends/buildscript.py |    5 +++++
 jhbuild/modtypes/__init__.py     |    3 +++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/jhbuild/frontends/buildscript.py b/jhbuild/frontends/buildscript.py
index 0d91ffc..01482e0 100644
--- a/jhbuild/frontends/buildscript.py
+++ b/jhbuild/frontends/buildscript.py
@@ -118,6 +118,11 @@ class BuildScript:
                 except SkipToEnd:
                     break
 
+                if not module.has_phase(phase):
+                    # skip phases that do not exist, this can happen when
+                    # phases were explicitely passed to this method.
+                    continue
+
                 self.start_phase(module.name, phase)
                 error = None
                 try:
diff --git a/jhbuild/modtypes/__init__.py b/jhbuild/modtypes/__init__.py
index 5af1374..cd67654 100644
--- a/jhbuild/modtypes/__init__.py
+++ b/jhbuild/modtypes/__init__.py
@@ -168,6 +168,9 @@ class Package:
         else:
             return (None, None)
 
+    def has_phase(self, phase):
+        return hasattr(self, 'do_' + phase)
+
     def check_build_policy(self, buildscript):
         if not buildscript.config.build_policy in ('updated', 'updated-deps'):
             return



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]