From ed5f48bdd16a9a1bb078be457afdb13b4e652637 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Fri, 18 Jan 2013 21:51:35 -0800 Subject: [PATCH] Move confdefaults out of main.py --- catalyst/defaults.py | 14 ++++++++++++++ catalyst/main.py | 19 +++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 50d1d185..9398d641 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -66,3 +66,17 @@ contents_definitions = { # isoinfo_f should be a last resort only "isoinfo_f":["calc_contents","isoinfo -f -i %(file)s"], } + + +confdefaults = { + "distdir": "/usr/portage/distfiles", + "hash_function": "crc32", + "options": "", + "packagedir": "/usr/portage/packages", + "portdir": "/usr/portage", + "repo_name": "portage", + "sharedir": "/usr/share/catalyst", + "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", + "snapshot_name": "portage-", + "storedir": "/var/tmp/catalyst", + } diff --git a/catalyst/main.py b/catalyst/main.py index a8770dae..77e6f73d 100755 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -22,8 +22,8 @@ sys.path.append(__selfpath__ + "/modules") import catalyst.config import catalyst.util from catalyst.support import CatalystError, find_binary, LockInUse -from defaults import (required_build_targets, valid_build_targets, - hash_definitions +from catalyst.defaults import (required_build_targets, valid_build_targets, + hash_definitions, confdefaults ) from hash_utils import HashMap @@ -76,19 +76,6 @@ def parse_config(myconfig): myconf={} config_file="" - confdefaults = { - "distdir": "/usr/portage/distfiles", - "hash_function": "crc32", - "options": "", - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", - "repo_name": "portage", - "sharedir": "/usr/share/catalyst", - "snapshot_name": "portage-", - "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", - "storedir": "/var/tmp/catalyst", - } - # first, try the one passed (presumably from the cmdline) if myconfig: if os.path.exists(myconfig): @@ -121,7 +108,7 @@ def parse_config(myconfig): sys.exit(1) # now, load up the values into conf_values so that we can use them - for x in confdefaults.keys(): + for x in list(confdefaults): if x in myconf: print "Setting",x,"to config file value \""+myconf[x]+"\"" conf_values[x]=myconf[x] -- 2.26.2