[Treepkg-commits] r305 - trunk/recipes/kde/enterprise

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue May 11 09:37:28 CEST 2010


Author: bricks
Date: 2010-05-11 09:37:28 +0200 (Tue, 11 May 2010)
New Revision: 305

Modified:
   trunk/recipes/kde/enterprise/generic.py
Log:
treepkg is able to use package descriptions from tags now


Modified: trunk/recipes/kde/enterprise/generic.py
===================================================================
--- trunk/recipes/kde/enterprise/generic.py	2010-05-10 10:59:02 UTC (rev 304)
+++ trunk/recipes/kde/enterprise/generic.py	2010-05-11 07:37:28 UTC (rev 305)
@@ -1,6 +1,7 @@
-# Copyright (C) 2007, 2008, 2009 by Intevation GmbH
+# Copyright (C) 2007 - 2010 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh at intevation.de>
+# Bjoern Ricks <bjoern.ricks at intevation.de>
 #
 # This program is free software under the GPL (>=v2)
 # Read the file COPYING coming with the software for details.
@@ -52,30 +53,43 @@
 
     extra_config_desc = [("tags_url", str, ""),
                          ("tags_pattern", str, ""),
-                         ("tags_subdir", str, "")]
+                         ("tags_subdir", str, ""),
+                         ("tags_rules_subdir", str, "")]
 
     def __init__(self, *args, **kw):
         tags_url = kw.pop("tags_url")
         tags_pattern = kw.pop("tags_pattern")
         tags_subdir = kw.pop("tags_subdir")
+        tags_rules_subdir = kw.pop("tags_rules_subdir")
         super(PackageTrack, self).__init__(*args, **kw)
         self.tag_detector = subversion.TagDetector(tags_url, tags_pattern,
                                                    tags_subdir)
+        self.tag_rules_detector = subversion.TagDetector(tags_url, tags_pattern,
+                                                   tags_rules_subdir)
+        self.use_tag_rules = False
+        if tags_rules_subdir:
+            self.use_tag_rules = True
 
     def packager_for_new_revision(self):
         logging.info("Checking tags")
         self.tag_url = None
         tag_url, tag_revision = self.tag_detector.newest_tag_revision()
+        tag_rules_url, tag_rules_revision = self.tag_rules_detector.newest_tag_revision()
         logging.info("Found: %s: %s", tag_url, tag_revision)
+        if self.use_tag_rules and tag_rules_url is None:
+            self.use_tag_rules = False
         if tag_url is not None:
-            revision = (tag_revision,
-                        self.rules_working_copy.last_changed_revision())
+            if not self.use_tag_rules:
+                tag_rules_revision = self.rules_working_copy.last_changed_revision()
+            revision = (tag_revision, tag_rules_revision)
             logging.info("New revision is %s", revision)
             if revision not in self.get_revision_numbers():
                 logging.info("Revision %s has not been packaged yet",
                              revision)
                 self.tag_url = tag_url
                 self.tag_revision = tag_revision
+                self.tag_rules_url = tag_rules_url
+                self.tag_rules_revision = tag_rules_revision
                 tag_date, tag_change_count = self.tag_pkg_parameters(tag_url)
                 pkg_revision = (self.pkg_revision_template
                                 % dict(pkg_revision=tag_change_count,
@@ -99,6 +113,14 @@
         else:
             super(PackageTrack, self).export_sources(to_dir)
 
+    def copy_debian_directory(self, to_dir):
+        if self.use_tag_rules:
+            logging.info("Exporting debian package description from %s to %s",
+                    self.tag_rules_url, to_dir)
+            self.rules_working_copy.export_tag(self.tag_rules_url, to_dir)
+        else:
+            super(PackageTrack, self).copy_debian_directory(to_dir)
+
     def tag_pkg_parameters(self, tag_url):
         match = re.search(r"/enterprise[^.]*\.[^.]*\."
                           r"(?P<date>[0-9]{8})\.(?P<baserev>[0-9]+)/",



More information about the Treepkg-commits mailing list