From: Brian Dolbec Date: Sat, 19 Jan 2013 05:51:35 +0000 (-0800) Subject: Move confdefaults out of main.py X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=36015f8b32646ce265770dfb6e9a6098b36d5316;p=catalyst.git Move confdefaults out of main.py --- diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 50d1d185..6eff39ed 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -66,3 +66,19 @@ contents_definitions = { # isoinfo_f should be a last resort only "isoinfo_f":["calc_contents","isoinfo -f -i %(file)s"], } + + +confdefaults={ + "storedir": "/var/tmp/catalyst", + "sharedir": "/usr/lib/catalyst", + "distdir": "/usr/portage/distfiles", + "repo_name": "portage", + "portdir": "/usr/portage", + "packagedir": "/usr/portage/packages", + "port_tmpdir": "/var/tmp/portage", + "options": "", + "snapshot_name": "portage-", + "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", + "hash_function": "crc32", + } + diff --git a/catalyst/main.py b/catalyst/main.py index 2bf75659..d5f68cc2 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -18,8 +18,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 @@ -72,20 +72,6 @@ def parse_config(myconfig): myconf={} config_file="" - confdefaults={ - "storedir": "/var/tmp/catalyst", - "sharedir": "/usr/lib/catalyst", - "distdir": "/usr/portage/distfiles", - "repo_name": "portage", - "portdir": "/usr/portage", - "packagedir": "/usr/portage/packages", - "port_tmpdir": "/var/tmp/portage", - "options": "", - "snapshot_name": "portage-", - "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", - "hash_function": "crc32", - } - # first, try the one passed (presumably from the cmdline) if myconfig: if os.path.exists(myconfig): @@ -120,7 +106,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]