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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jan 13 17:18:58 CET 2009


Author: bh
Date: 2009-01-13 17:18:58 +0100 (Tue, 13 Jan 2009)
New Revision: 160

Modified:
   trunk/test/test_readconfig.py
   trunk/treepkg/packager.py
   trunk/treepkg/readconfig.py
Log:
Add a way to specify the svn URL of the repository with the debian rules
subdirectory and use to checkout and update the debian directory of a
PackageTrack.  Update the tests.


Modified: trunk/test/test_readconfig.py
===================================================================
--- trunk/test/test_readconfig.py	2009-01-13 15:03:21 UTC (rev 159)
+++ trunk/test/test_readconfig.py	2009-01-13 16:18:58 UTC (rev 160)
@@ -1,4 +1,4 @@
-# Copyright (C) 2008 by Intevation GmbH
+# Copyright (C) 2008, 2009 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh at intevation.de>
 #
@@ -47,6 +47,7 @@
 base_dir: %(tracks_dir)s/%(name)s
 packager_class: readconfig_test.extraargs
 orig_tarball: %(base_dir)s/mytarball.tgz
+rules_svn_url: file:///tmp/my-debian-repository
 """
 
     files = [("treepkg.cfg", config_contents),
@@ -89,12 +90,14 @@
                  root_cmd=['sudo'],
                  signing_key_id="",
                  svn_url="svn://example.com/extraargs/trunk",
+                 rules_svn_url="file:///tmp/my-debian-repository",
                  orig_tarball=("/home/builder/mill/"
                                "tracks/extraargs/mytarball.tgz")),
             dict(name="simple",
                  base_dir="/home/builder/mill/tracks/simple",
                  deb_email="treepkg at example.com",
                  deb_fullname="TreePKG",
+                 rules_svn_url="",
                  debrevision_prefix="treepkg",
                  handle_dependencies=True,
                  packager_class="readconfig_test.simple",

Modified: trunk/treepkg/packager.py
===================================================================
--- trunk/treepkg/packager.py	2009-01-13 15:03:21 UTC (rev 159)
+++ trunk/treepkg/packager.py	2009-01-13 16:18:58 UTC (rev 160)
@@ -321,7 +321,7 @@
     def __init__(self, name, base_dir, svn_url, root_cmd, pbuilderrc, deb_email,
                  deb_fullname, packager_class="treepkg.packager",
                  debrevision_prefix="treepkg", handle_dependencies=False,
-                 signing_key_id="", do_build=True):
+                 signing_key_id="", do_build=True, rules_svn_url=None):
         self.name = name
         self.base_dir = base_dir
         self.builder = PBuilder(pbuilderrc, root_cmd,
@@ -339,7 +339,12 @@
         repo = SvnRepository(svn_url, self.svn_external_subdirs)
         self.working_copy = SvnWorkingCopy(repo, self.checkout_dir,
                                            logger=logging)
-        self.rules_working_copy = ManualWorkingCopy(self.debian_dir)
+        if rules_svn_url:
+            repo = SvnRepository(rules_svn_url)
+            self.rules_working_copy = SvnWorkingCopy(repo, self.debian_dir,
+                                                     logger=logging)
+        else:
+            self.rules_working_copy = ManualWorkingCopy(self.debian_dir)
 
     checkout_dir = util.filenameproperty("checkout")
     debian_dir = util.filenameproperty("debian")
@@ -350,6 +355,7 @@
         if not os.path.exists(self.base_dir):
             print "creating %s" % (self.base_dir,)
             util.ensure_directory(self.base_dir)
+        # TODO: handle case where debian directory is in version control
         if not os.path.exists(self.debian_dir):
             print ("TODO: the debian directory %s still has to be created"
                    % (self.debian_dir,))

Modified: trunk/treepkg/readconfig.py
===================================================================
--- trunk/treepkg/readconfig.py	2009-01-13 15:03:21 UTC (rev 159)
+++ trunk/treepkg/readconfig.py	2009-01-13 16:18:58 UTC (rev 160)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, 2008 by Intevation GmbH
+# Copyright (C) 2007, 2008, 2009 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh at intevation.de>
 #
@@ -23,10 +23,11 @@
     raise ValueError("cannot determine boolean value of %r" % (s,))
 
 defaults = dict(root_cmd="sudo",
-                signing_key_id="")
+                signing_key_id="",
+                rules_svn_url="")
 
 packager_desc = [
-    "name", "base_dir", "svn_url", "packager_class",
+    "name", "base_dir", "svn_url", "rules_svn_url", "packager_class",
     ("root_cmd", shlex.split), "pbuilderrc",
     "deb_email", "deb_fullname", "debrevision_prefix",
     ("handle_dependencies", convert_bool),



More information about the Treepkg-commits mailing list