public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: [gentoo-catalyst] [PATCH 7/8] Move confdefaults out of main.py
Date: Wed,  2 Apr 2014 13:29:42 -0700	[thread overview]
Message-ID: <1396470583-8756-7-git-send-email-dolsen@gentoo.org> (raw)
In-Reply-To: <1396470583-8756-2-git-send-email-dolsen@gentoo.org>

---
 catalyst/defaults.py | 17 +++++++++++++++++
 catalyst/main.py     | 20 +++-----------------
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 748d1dd..b83e4f5 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 e2ef976..5748d31 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]
-- 
1.8.5.3



  parent reply	other threads:[~2014-04-02 20:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02 20:29 [gentoo-catalyst] [PATCH 2/8] Initial separation and creation of contents.py Brian Dolbec
2014-04-02 20:29 ` [gentoo-catalyst] [PATCH 3/8] main.py: print the output of an ImportError to help in debugging Brian Dolbec
2014-04-02 20:29 ` [gentoo-catalyst] [PATCH 4/8] Fix undefined variable: RLIMIT_NOFILE Brian Dolbec
2014-04-02 20:29 ` [gentoo-catalyst] [PATCH 5/8] Creation of a new defaults.py Brian Dolbec
2014-04-02 20:29 ` [gentoo-catalyst] [PATCH 6/8] Move generic_stage_targets.py constants to defaults.py Brian Dolbec
2014-04-02 20:29 ` Brian Dolbec [this message]
2014-04-02 20:29 ` [gentoo-catalyst] [PATCH 8/8] livecdfs-update: No tmpfs on /lib/firmware Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396470583-8756-7-git-send-email-dolsen@gentoo.org \
    --to=dolsen@gentoo.org \
    --cc=gentoo-catalyst@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox