changeset 524:e90a21cfbc3b

added an option to fail if a tag could not be found instread of building trunk fail is the default now
author Bjoern Ricks <bricks@intevation.de>
date Thu, 11 Nov 2010 11:50:08 +0000
parents 10a7fed8bf80
children e73a4bbc35e7
files recipes/kde/enterprise/tags.py
diffstat 1 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/recipes/kde/enterprise/tags.py	Thu Nov 11 11:47:31 2010 +0000
+++ b/recipes/kde/enterprise/tags.py	Thu Nov 11 11:50:08 2010 +0000
@@ -10,6 +10,7 @@
 
 import logging
 
+from treepkg.readconfig import convert_bool
 import recipes.kde.enterprise.generic as enterprise
 
 class PackageTrack(enterprise.PackageTrack):
@@ -19,7 +20,18 @@
 
     revision_packager_cls = enterprise.RevisionPackager
 
+    extra_config_desc = [("tags_url", str, ""),
+                         ("tags_pattern", str, ""),
+                         ("tags_subdir", str, ""),
+                         ("tags_scm_type", str, None),
+                         ("tags_rules_url", str, None),
+                         ("tags_rules_pattern", str, ""),
+                         ("tags_rules_subdir", str, ""),
+                         ("tags_rules_scm_type", str, None),
+                         ("fail_if_tag_not_found", convert_bool, "true")]
+
     def __init__(self, *args, **kw):
+        self.fail_if_tag_not_found = kw.pop("fail_if_tag_not_found")
         super(PackageTrack, self).__init__(*args, **kw)
 
     def packager_for_new_revision(self):
@@ -31,7 +43,10 @@
         logging.info("Found: %s: %s", tag_url, tag_revision)
         logging.info("Found rules: %s: %s", tag_rules_url, tag_rules_revision)
         if self.use_tag_rules and tag_rules_url is None:
-            self.use_tag_rules = False # maybe it's better to raise an exception
+            self.use_tag_rules = False
+            logging.error("No rules found in tag but tag should be used to" \
+                          " build package.")
+            return
         if tag_url is not None:
             if not self.use_tag_rules:
                 tag_rules_revision = self.rules_working_copy.last_changed_revision()
@@ -56,7 +71,11 @@
                 logging.info("Revision %s has already been packaged.",
                              revision)
         
-        else: # tag_url is not set -> build trunk
+        else:
+            if self.fail_if_tag_not_found:
+                logging.error("Could not find tag for track %s", self.name)
+                return
+            # tag_url is not set -> build trunk
             # don't use rules from tags for trunk builds
             self.use_tag_rules = False
             return super(PackageTrack, self).new_revsision_packager()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)