changeset 129:ce9f046058b5

Add the handle_dependencies Option for the config file. Extend the test cases accordingly
author Bernhard Herzog <bh@intevation.de>
date Fri, 23 May 2008 16:31:58 +0000
parents 5155b4f9443d
children 84a1716827f8
files test/test_readconfig.py treepkg/readconfig.py
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/test_readconfig.py	Fri May 23 16:11:22 2008 +0000
+++ b/test/test_readconfig.py	Fri May 23 16:31:58 2008 +0000
@@ -29,6 +29,7 @@
 deb_email: treepkg@example.com
 deb_fullname: TreePKG
 debrevision_prefix: treepkg
+handle_dependencies: False
 
 [treepkg]
 instructions_file: %(treepkg_dir)s/instructions
@@ -38,6 +39,7 @@
 svn_url: svn://example.com/%(name)s/trunk
 base_dir: %(tracks_dir)s/%(name)s
 packager_class: readconfig_test.%(name)s
+handle_dependencies: True
 
 [pkg_extraargs]
 svn_url: svn://example.com/%(name)s/trunk
@@ -81,6 +83,7 @@
                  deb_email="treepkg@example.com",
                  deb_fullname="TreePKG",
                  debrevision_prefix="treepkg",
+                 handle_dependencies=False,
                  packager_class="readconfig_test.extraargs",
                  pbuilderrc="/home/builder/mill/pbuilder/pbuilderrc",
                  root_cmd=['sudo'],
@@ -92,6 +95,7 @@
                  deb_email="treepkg@example.com",
                  deb_fullname="TreePKG",
                  debrevision_prefix="treepkg",
+                 handle_dependencies=True,
                  packager_class="readconfig_test.simple",
                  pbuilderrc="/home/builder/mill/pbuilder/pbuilderrc",
                  root_cmd=['sudo'],
--- a/treepkg/readconfig.py	Fri May 23 16:11:22 2008 +0000
+++ b/treepkg/readconfig.py	Fri May 23 16:31:58 2008 +0000
@@ -14,12 +14,21 @@
 import util
 import packager
 
+def convert_bool(s):
+    s = s.lower()
+    if s in ("true", "yes", "1"):
+        return True
+    if s in ("false", "no", "0"):
+        return False
+    raise ValueError("cannot determine boolean value of %r" % (s,))
+
 defaults = dict(root_cmd="sudo")
 
 packager_desc = [
     "name", "base_dir", "svn_url", "packager_class",
     ("root_cmd", shlex.split), "pbuilderrc",
     "deb_email", "deb_fullname", "debrevision_prefix",
+    ("handle_dependencies", convert_bool),
     ]
 
 treepkg_desc = [
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)