comparison 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
comparison
equal deleted inserted replaced
282:f58f9adb7dc3 283:cd10b835d9b8
19 19
20 changemsg_template = "Update to SVN enterprise35 branch rev. %(revision)d" 20 changemsg_template = "Update to SVN enterprise35 branch rev. %(revision)d"
21 21
22 def __init__(self, *args, **kw): 22 def __init__(self, *args, **kw):
23 super(BaseSourcePackager, self).__init__(*args, **kw) 23 super(BaseSourcePackager, self).__init__(*args, **kw)
24 self.enterprise_version = (time.strftime("%Y%m%d", time.localtime()) \ 24 self.enterprise_version = (self.parent.pkg_date + "."
25 + "." + str(self.revision)) 25 + str(self.revision))
26 26
27 def determine_package_version(self, directory): 27 def determine_package_version(self, directory):
28 enterprise_version = self.enterprise_version 28 enterprise_version = self.enterprise_version
29 return self.track.version_template % locals() 29 return self.track.version_template % locals()
30 30
34 def update_version_numbers(self, pkgbasedir): 34 def update_version_numbers(self, pkgbasedir):
35 """Updates the version numbers in the code in pkgbasedir. 35 """Updates the version numbers in the code in pkgbasedir.
36 The default implementation does nothing. Derived classes should 36 The default implementation does nothing. Derived classes should
37 override this method if necessary. 37 override this method if necessary.
38 """ 38 """
39
40
41 class BaseRevisionPackager(treepkg.packager.RevisionPackager):
42
43 def __init__(self, *args, **kw):
44 self.pkg_date = kw.pop("pkg_date",
45 time.strftime("%Y%m%d", time.localtime()))
46 super(BaseRevisionPackager, self).__init__(*args, **kw)
39 47
40 48
41 class BasePackageTrack(treepkg.packager.PackageTrack): 49 class BasePackageTrack(treepkg.packager.PackageTrack):
42 50
43 extra_config_desc = [("version_template", str, "%(enterprise_version)s"), 51 extra_config_desc = [("version_template", str, "%(enterprise_version)s"),
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)