changeset 514:0c2cc67a29aa

set tag scm types to continous scm types if not set by user fix error reporting
author Bjoern Ricks <bricks@intevation.de>
date Wed, 10 Nov 2010 09:33:36 +0000
parents 3e08d6546d52
children e5698096f1ec
files recipes/kde/enterprise/generic.py treepkg/packager.py
diffstat 2 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/recipes/kde/enterprise/generic.py	Wed Nov 10 09:24:48 2010 +0000
+++ b/recipes/kde/enterprise/generic.py	Wed Nov 10 09:33:36 2010 +0000
@@ -60,11 +60,11 @@
     extra_config_desc = [("tags_url", str, ""),
                          ("tags_pattern", str, ""),
                          ("tags_subdir", str, ""),
-                         ("tags_scm_type", str, scm_type),
+                         ("tags_scm_type", str, None),
                          ("tags_rules_url", str, None),
-                         ("tags_rules_pattern", str, None),
+                         ("tags_rules_pattern", str, ""),
                          ("tags_rules_subdir", str, ""),
-                         ("tags_rules_scm_type", str, rules_scm_type)]
+                         ("tags_rules_scm_type", str, None)]
 
     def __init__(self, *args, **kw):
         tags_url = kw.pop("tags_url")
@@ -73,15 +73,24 @@
         tags_rules_url = kw.pop("tags_rules_url")
         tags_rules_pattern = kw.pop("tags_rules_pattern", tags_pattern)
         tags_rules_subdir = kw.pop("tags_rules_subdir")
+        tags_scm_type = kw.pop("tags_scm_type")
+        tags_rules_scm_type = kw.pop("tags_rules_scm_type")
         super(PackageTrack, self).__init__(*args, **kw)
+
+        if not tags_scm_type:
+            tags_scm_type = self.scm_type
+        if not tags_rules_scm_type:
+            tags_rules_scm_type = self.rules_scm_type 
+
         if tags_scm_type == "git":
             self.tag_detector = git.TagDetector(tags_url, tags_pattern)
         elif tags_scm_type == "svn":
             self.tag_detector = subversion.TagDetector(tags_url, tags_pattern,
                                                    tags_subdir)
         else:
-            raise packager.PackageError("Unknown scm type \"%s\" for tag" \
+            raise treepkg.packager.PackagerError("Unknown scm type \"%s\" for tag" \
                     " sources set" % tags_scm_type)
+
         if tags_rules_scm_type == "git":
             self.tag_rules_detector = git.TagDetector(tags_rules_url,
                     tags_rules_pattern)
@@ -89,7 +98,7 @@
             self.tag_rules_detector = subversion.TagDetector(tags_rules_url,
                     tags_rules_pattern, tags_rules_subdir)
         else:
-            raise packager.PackageError("Unknown scm type \"%s\" for tag" \
+            raise treepkg.packager.PackagerError("Unknown scm type \"%s\" for tag" \
                     " rules set" % tags_rules_scm_type)
         self.found_tag_rules = False
         if tags_rules_url:
--- a/treepkg/packager.py	Wed Nov 10 09:24:48 2010 +0000
+++ b/treepkg/packager.py	Wed Nov 10 09:33:36 2010 +0000
@@ -534,6 +534,8 @@
         self.pkg_dir_regex = re.compile(r"(?P<revision>[0-9a-f]+)"
                                         r"-(?P<rules_revision>[0-9a-f]+)$")
         self.status_hook = status_hook
+	self.scm_type = scm_type
+	self.rules_scm_type = rules_scm_type
         
         if svn_url:
             url = svn_url
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)