[Treepkg-commits] r18 - in trunk: . test treepkg
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Nov 7 11:13:24 CET 2007
Author: bh
Date: 2007-11-07 11:13:24 +0100 (Wed, 07 Nov 2007)
New Revision: 18
Modified:
trunk/demo.cfg
trunk/test/test_packager.py
trunk/treepkg/packager.py
trunk/treepkg/readconfig.py
Log:
Make the prefix used in the debian revision number configurable.
This involves a new config file setting documented in demo.cfg, the
necessary changes to the packagers and updated and new test cases
Modified: trunk/demo.cfg
===================================================================
--- trunk/demo.cfg 2007-11-06 17:30:11 UTC (rev 17)
+++ trunk/demo.cfg 2007-11-07 10:13:24 UTC (rev 18)
@@ -37,7 +37,12 @@
deb_email: packager at example.com
deb_fullname: Sample Packager
+# A prefix used in the package revision number of the generated debian
+# package. E. g. with a prefix "treepkg", the default, a generated
+# package might be named foo_1.0-Q1_all.deb
+debrevision_prefix: treepkg
+
[treepkg]
# Section for general tree packager configuration
Modified: trunk/test/test_packager.py
===================================================================
--- trunk/test/test_packager.py 2007-11-06 17:30:11 UTC (rev 17)
+++ trunk/test/test_packager.py 2007-11-07 10:13:24 UTC (rev 18)
@@ -105,7 +105,7 @@
self.trackdir = self.create_temp_dir(self.id() + "-track")
self.create_files(self.trackdir, self.debian_files)
- def test(self):
+ def runtest(self, debrevision, **extra_track_args):
baseurl = create_svn_repository(self.svndir)
svn_url = baseurl + "/trunk"
subversion.checkout(svn_url, self.svnworkdir)
@@ -117,20 +117,27 @@
svn_url=svn_url, pbuilderrc="",
root_cmd=[sys.executable, rootcmd],
deb_email="treepkg at example.com",
- deb_fullname="treepkg tester")
+ deb_fullname="treepkg tester",
+ **extra_track_args)
group = PackagerGroup([track], 1)
group.check_package_tracks()
# Now check the source and binary package files
pkgdir = os.path.join(self.trackdir, "pkg", "2-1")
self.assertEquals(sorted(os.listdir(os.path.join(pkgdir, "src"))),
- ["testpkg_2-kk1.diff.gz",
- "testpkg_2-kk1.dsc",
+ ["testpkg_2-%s.diff.gz" % debrevision,
+ "testpkg_2-%s.dsc" % debrevision,
"testpkg_2.orig.tar.gz"])
self.assertEquals(sorted(os.listdir(os.path.join(pkgdir, "binary"))),
- ["testpkg_2-kk1_all.deb",
- "testpkg_2-kk1_i386.changes"])
+ ["testpkg_2-%s_all.deb" % debrevision,
+ "testpkg_2-%s_i386.changes" % debrevision])
+ def test_default_debrevision_prefix(self):
+ self.runtest("treepkg1")
+
+ def test_custom_debrevision_prefix(self):
+ self.runtest("kk1", debrevision_prefix="kk")
+
class StoppingPackager(treepkg.packager.RevisionPackager):
def package(self):
Modified: trunk/treepkg/packager.py
===================================================================
--- trunk/treepkg/packager.py 2007-11-06 17:30:11 UTC (rev 17)
+++ trunk/treepkg/packager.py 2007-11-07 10:13:24 UTC (rev 18)
@@ -121,8 +121,9 @@
oldversionprefix = oldversion.split(":")[0] + ":"
else:
oldversionprefix = ""
+ debrev = self.track.debrevision_prefix + "1"
run.call(cmdexpand("debchange -c $changelog"
- " -v ${oldversionprefix}${pkgbaseversion}-kk1"
+ " -v ${oldversionprefix}${pkgbaseversion}-${debrev}"
" $changemsg", **locals()),
env=self.track.debian_environment())
@@ -279,7 +280,8 @@
extra_config_desc = []
def __init__(self, name, base_dir, svn_url, root_cmd, pbuilderrc, deb_email,
- deb_fullname, packager_class="treepkg.packager"):
+ deb_fullname, packager_class="treepkg.packager",
+ debrevision_prefix="treepkg"):
self.name = name
self.base_dir = base_dir
self.svn_url = svn_url
@@ -287,6 +289,7 @@
self.pbuilderrc = pbuilderrc
self.deb_email = deb_email
self.deb_fullname = deb_fullname
+ self.debrevision_prefix = debrevision_prefix
self.pkg_dir_template = "%(revision)d-%(increment)d"
self.pkg_dir_regex \
= re.compile(r"(?P<revision>[0-9]+)-(?P<increment>[0-9]+)$")
Modified: trunk/treepkg/readconfig.py
===================================================================
--- trunk/treepkg/readconfig.py 2007-11-06 17:30:11 UTC (rev 17)
+++ trunk/treepkg/readconfig.py 2007-11-07 10:13:24 UTC (rev 18)
@@ -18,7 +18,7 @@
packager_desc = [
"name", "base_dir", "svn_url", "packager_class",
("root_cmd", shlex.split), "pbuilderrc",
- "deb_email", "deb_fullname",
+ "deb_email", "deb_fullname", "debrevision_prefix",
]
treepkg_desc = [
More information about the Treepkg-commits
mailing list