changeset 349:ae68f75f0e71

treepkg is able to use package descriptions from tags now
author Bjoern Ricks <bricks@intevation.de>
date Tue, 11 May 2010 07:37:28 +0000
parents bcd01f68662c
children b41f54880572
files recipes/kde/enterprise/generic.py
diffstat 1 files changed, 26 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/recipes/kde/enterprise/generic.py	Mon May 10 10:59:02 2010 +0000
+++ b/recipes/kde/enterprise/generic.py	Tue May 11 07:37:28 2010 +0000
@@ -1,6 +1,7 @@
-# Copyright (C) 2007, 2008, 2009 by Intevation GmbH
+# Copyright (C) 2007 - 2010 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh@intevation.de>
+# Bjoern Ricks <bjoern.ricks@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]+)/",
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)