# HG changeset patch # User Bernhard Herzog # Date 1211560318 0 # Node ID ce9f046058b518982dfae3b18e9ab2c2ee5a45b6 # Parent 5155b4f9443dadaf04d5000d629448f129f080b7 Add the handle_dependencies Option for the config file. Extend the test cases accordingly diff -r 5155b4f9443d -r ce9f046058b5 test/test_readconfig.py --- 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'], diff -r 5155b4f9443d -r ce9f046058b5 treepkg/readconfig.py --- 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 = [