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=69c1839e501cbbf05c1790b267ed1b5b356091c0;p=catalyst.git Move confdefaults out of main.py --- diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 748d1dd7..b83e4f55 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -21,6 +21,22 @@ valid_config_file_values.extend(["PKGCACHE", "KERNCACHE", "CCACHE", "DISTCC", verbosity = 1 +confdefaults={ + "distdir": "/usr/portage/distfiles", + "hash_function": "crc32", + "icecream": "/var/cache/icecream", + "local_overlay": "/usr/local/portage", + "options": "", + "packagedir": "/usr/portage/packages", + "portdir": "/usr/portage", + "port_tmpdir": "/var/tmp/portage", + "repo_name": "portage", + "sharedir": "/usr/lib/catalyst", + "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", + "snapshot_name": "portage-", + "storedir": "/var/tmp/catalyst", + } + PORT_LOGDIR_CLEAN = \ 'find "${PORT_LOGDIR}" -type f ! -name "summary.log*" -mtime +30 -delete' @@ -48,3 +64,4 @@ SOURCE_MOUNT_DEFAULTS = { "proc": "/proc", "shm": "shmfs", } + diff --git a/catalyst/main.py b/catalyst/main.py index e2ef9762..5748d317 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -22,7 +22,8 @@ from . import __version__ import catalyst.config import catalyst.util from catalyst.support import CatalystError, find_binary, LockInUse -from catalyst.defaults import required_build_targets, valid_build_targets +from catalyst.defaults import (required_build_targets, valid_build_targets, + confdefaults) from hash_utils import HashMap, HASH_DEFINITIONS from contents import ContentsMap, CONTENTS_DEFINITIONS @@ -70,21 +71,6 @@ def parse_config(myconfig): myconf={} config_file="" - confdefaults = { - "distdir": "/usr/portage/distfiles", - "hash_function": "crc32", - "icecream": "/var/cache/icecream", - "local_overlay": "/usr/local/portage", - "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): @@ -117,7 +103,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]