diff recipes/kde_enterprise_3_5/base.py @ 283:cd10b835d9b8

kdepim recipes: introduce a BaseRevisionPackager that allows the track to set the packaging date. Make the BaseSourcePackager use the date from the parent RevisionPackager.
author Bernhard Herzog <bh@intevation.de>
date Tue, 04 Aug 2009 10:13:12 +0000
parents d2382953b2c8
children 4376c5315c72
line wrap: on
line diff
--- a/recipes/kde_enterprise_3_5/base.py	Tue Aug 04 10:09:12 2009 +0000
+++ b/recipes/kde_enterprise_3_5/base.py	Tue Aug 04 10:13:12 2009 +0000
@@ -21,8 +21,8 @@
 
     def __init__(self, *args, **kw):
         super(BaseSourcePackager, self).__init__(*args, **kw)
-        self.enterprise_version = (time.strftime("%Y%m%d", time.localtime()) \
-                                   + "." + str(self.revision))
+        self.enterprise_version = (self.parent.pkg_date + "."
+                                   + str(self.revision))
 
     def determine_package_version(self, directory):
         enterprise_version = self.enterprise_version
@@ -38,6 +38,14 @@
         """
 
 
+class BaseRevisionPackager(treepkg.packager.RevisionPackager):
+
+    def __init__(self, *args, **kw):
+        self.pkg_date = kw.pop("pkg_date",
+                               time.strftime("%Y%m%d", time.localtime()))
+        super(BaseRevisionPackager, self).__init__(*args, **kw)
+
+
 class BasePackageTrack(treepkg.packager.PackageTrack):
 
     extra_config_desc = [("version_template", str, "%(enterprise_version)s"),
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)