[Treepkg-commits] r231 - in trunk: test treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Dec 1 12:26:47 CET 2009


Author: bh
Date: 2009-12-01 12:26:47 +0100 (Tue, 01 Dec 2009)
New Revision: 231

Modified:
   trunk/test/test_readconfig.py
   trunk/treepkg/packager.py
   trunk/treepkg/readconfig.py
Log:
Add per-track configuration option version_template used by the
SourcePackager to construct the version number.  Also add some tests.


Modified: trunk/test/test_readconfig.py
===================================================================
--- trunk/test/test_readconfig.py	2009-11-26 20:20:57 UTC (rev 230)
+++ trunk/test/test_readconfig.py	2009-12-01 11:26:47 UTC (rev 231)
@@ -43,6 +43,7 @@
 handle_dependencies: True
 signing_key_id: abcd1234
 changelog_msg_template: Update to feature branch r%%(revision)d
+version_template: 1.0.svn%%(revision)s
 
 [pkg_extraargs]
 svn_url: svn://example.com/%(name)s/trunk
@@ -103,6 +104,7 @@
                  svn_subset=[(".", False), ("subdir", True)],
                  svn_url="svn://example.com/extraargs/trunk",
                  rules_svn_url="file:///tmp/my-debian-repository",
+                 version_template="%(revision)s",
                  orig_tarball=("/home/builder/mill/"
                                "tracks/extraargs/mytarball.tgz")),
             dict(name="simple",
@@ -121,4 +123,5 @@
                  root_cmd=['sudo'],
                  signing_key_id="abcd1234",
                  svn_subset=[],
-                 svn_url="svn://example.com/simple/trunk")])
+                 svn_url="svn://example.com/simple/trunk",
+                 version_template="1.0.svn%(revision)s")])

Modified: trunk/treepkg/packager.py
===================================================================
--- trunk/treepkg/packager.py	2009-11-26 20:20:57 UTC (rev 230)
+++ trunk/treepkg/packager.py	2009-12-01 11:26:47 UTC (rev 231)
@@ -56,7 +56,7 @@
         The default implementation simply returns the revision converted
         to a string.
         """
-        return str(self.revision)
+        return self.track.version_template % dict(revision=self.revision)
 
     def export_sources(self):
         """Export the sources from the subversion working directory
@@ -342,6 +342,7 @@
 
     def __init__(self, name, base_dir, svn_url, root_cmd, pbuilderrc, deb_email,
                  deb_fullname, packager_class="treepkg.packager",
+                 version_template="%(revision)s",
                  pkg_revision_template="treepkg%(pkg_revision)d",
                  handle_dependencies=False, signing_key_id="", do_build=True,
                  rules_svn_url=None, deb_build_options="", pkg_basename="",
@@ -358,6 +359,7 @@
         self.deb_email = deb_email
         self.deb_fullname = deb_fullname
         self.deb_build_options = deb_build_options
+        self.version_template = version_template
         self.pkg_revision_template = pkg_revision_template
         self.signing_key_id = signing_key_id
         self.do_build = do_build

Modified: trunk/treepkg/readconfig.py
===================================================================
--- trunk/treepkg/readconfig.py	2009-11-26 20:20:57 UTC (rev 230)
+++ trunk/treepkg/readconfig.py	2009-12-01 11:26:47 UTC (rev 231)
@@ -69,6 +69,7 @@
     ("rules_svn_url", str, ""), "packager_class",
     ("root_cmd", shlex.split, "sudo"), "pbuilderrc",
     "deb_email", "deb_fullname", ("deb_build_options", str, ""),
+    ("version_template", str, "%(revision)s"),
     "pkg_revision_template", ("pkg_basename", str, ""),
     ("handle_dependencies", convert_bool),
     ("signing_key_id", str, ""),



More information about the Treepkg-commits mailing list