[Treepkg-commits] r477 - in trunk: recipes/kde/enterprise treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Nov 10 10:33:36 CET 2010


Author: bricks
Date: 2010-11-10 10:33:36 +0100 (Wed, 10 Nov 2010)
New Revision: 477

Modified:
   trunk/recipes/kde/enterprise/generic.py
   trunk/treepkg/packager.py
Log:
set tag scm types to continous scm types if not set by user
fix error reporting


Modified: trunk/recipes/kde/enterprise/generic.py
===================================================================
--- trunk/recipes/kde/enterprise/generic.py	2010-11-10 09:24:48 UTC (rev 476)
+++ trunk/recipes/kde/enterprise/generic.py	2010-11-10 09:33:36 UTC (rev 477)
@@ -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:

Modified: trunk/treepkg/packager.py
===================================================================
--- trunk/treepkg/packager.py	2010-11-10 09:24:48 UTC (rev 476)
+++ trunk/treepkg/packager.py	2010-11-10 09:33:36 UTC (rev 477)
@@ -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



More information about the Treepkg-commits mailing list