[Treepkg-commits] r466 - trunk/treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Oct 25 16:00:04 CEST 2010


Author: aheinecke
Date: 2010-10-25 16:00:03 +0200 (Mon, 25 Oct 2010)
New Revision: 466

Modified:
   trunk/treepkg/packager.py
Log:
* Only check the time once per version calculation
* Check if a dictionary is supplied to determine_package_version
  by checking the type instead the name of the type.


Modified: trunk/treepkg/packager.py
===================================================================
--- trunk/treepkg/packager.py	2010-10-25 13:54:18 UTC (rev 465)
+++ trunk/treepkg/packager.py	2010-10-25 14:00:03 UTC (rev 466)
@@ -28,6 +28,7 @@
 from cmdexpand import cmdexpand
 from builder import PBuilder
 from sbuilder import SbdmockBuilder
+from types import DictType
 
 def _fromparent(attr):
     """Creates a property that delegates its value to self.parent.<attr>"""
@@ -97,7 +98,7 @@
 
         Default variables that can be resolved are:
              revision - The revision of the package
-             short_revision - the first seven characters of the revision
+             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
@@ -113,11 +114,12 @@
         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())
+        localtime = time.localtime()
+        pkg_date = time.strftime("%Y%m%d", localtime)
+        pkg_time = time.strftime("%H%M", localtime)
         upstream_version = self.determine_upstream_version(directory)
         version_dict = locals().copy()
-        if type(additionals).__name__=='dict':
+        if type(additionals) is DictType:
             version_dict.update(additionals)
         return self.track.version_template % version_dict
 



More information about the Treepkg-commits mailing list