changeset 234:eaa696629a91

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.
author Bernhard Herzog <bh@intevation.de>
date Tue, 13 Jan 2009 16:18:58 +0000
parents 757e5504f46a
children a8aa0caf52db
files test/test_readconfig.py treepkg/packager.py treepkg/readconfig.py
diffstat 3 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/test/test_readconfig.py	Tue Jan 13 15:03:21 2009 +0000
+++ b/test/test_readconfig.py	Tue Jan 13 16:18:58 2009 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2008 by Intevation GmbH
+# Copyright (C) 2008, 2009 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh@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@example.com",
                  deb_fullname="TreePKG",
+                 rules_svn_url="",
                  debrevision_prefix="treepkg",
                  handle_dependencies=True,
                  packager_class="readconfig_test.simple",
--- a/treepkg/packager.py	Tue Jan 13 15:03:21 2009 +0000
+++ b/treepkg/packager.py	Tue Jan 13 16:18:58 2009 +0000
@@ -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,))
--- a/treepkg/readconfig.py	Tue Jan 13 15:03:21 2009 +0000
+++ b/treepkg/readconfig.py	Tue Jan 13 16:18:58 2009 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, 2008 by Intevation GmbH
+# Copyright (C) 2007, 2008, 2009 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh@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),
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)