changeset 502:35759274aeb4

Expose package time and a short revision to the version templates.
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 25 Oct 2010 08:18:21 +0000
parents fd52f1e231ba
children 44a005311f62
files treepkg/packager.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/packager.py	Mon Oct 25 08:17:31 2010 +0000
+++ b/treepkg/packager.py	Mon Oct 25 08:18:21 2010 +0000
@@ -97,8 +97,10 @@
 
         Default variables that can be resolved are:
              revision - The revision of the package
+             short_revision - the first seven characters of the revision
              rules_revision - The revision of the packaging rules
              pkg_date - The current date in the form: YYYYMMDD
+             pkg_time - The current ime in the form: HHMM
              pkg_revision - The number of times a new package has
                             been created from this track.
              upstream_version - The version parsed from the sources or
@@ -108,7 +110,11 @@
         revision = self.revision
         rules_revision = self.parent.rules_revision
         pkg_revision = self.parent.pkg_revision
+        short_revision = revision
+        if len(pkg_revision) > 7:
+            short_revision = short_revision[:7]
         pkg_date = time.strftime("%Y%m%d", time.localtime())
+        pkg_time = time.strftime("%H%M", time.localtime())
         upstream_version = self.determine_upstream_version(directory)
         version_dict = locals().copy()
         if type(additionals).__name__=='dict':
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)