# HG changeset patch # User Andre Heinecke # Date 1287994701 0 # Node ID 35759274aeb4db533787b98b1bc3495382780cda # Parent fd52f1e231ba8c8dd2ad35ea8a2c1df41b6b9c4b Expose package time and a short revision to the version templates. diff -r fd52f1e231ba -r 35759274aeb4 treepkg/packager.py --- 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':