Move confdefaults out of main.py
authorBrian Dolbec <dolsen@gentoo.org>
Sat, 19 Jan 2013 05:51:35 +0000 (21:51 -0800)
committerBrian Dolbec <dolsen@gentoo.org>
Wed, 2 Apr 2014 20:04:24 +0000 (13:04 -0700)
catalyst/defaults.py
catalyst/main.py

index 748d1dd7d0f6009d1f4702bfc13527429e4776bd..b83e4f55611fd5bdb23c53b4a6eca5dc44b5fc0d 100644 (file)
@@ -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",
        }
+
index e2ef9762f95b8364d7fdc0c29f248a7d4ccee666..5748d31763de6ecdc001eac8102c6b6579107e74 100644 (file)
@@ -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]