From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0F01413827E for ; Sat, 14 Dec 2013 03:37:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D0E9EE0BB5; Sat, 14 Dec 2013 03:37:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 38F6AE0BAC for ; Sat, 14 Dec 2013 03:37:13 +0000 (UTC) Received: from big_daddy.dol-sen.ca (S010600222de111ff.vc.shawcable.net [96.49.5.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id 50A6133F4DC; Sat, 14 Dec 2013 03:37:12 +0000 (UTC) From: Brian Dolbec To: gentoo-catalyst@lists.gentoo.org Cc: Brian Dolbec Subject: [gentoo-catalyst] [PATCH 2/3] Move confdefaults out of main.py Date: Fri, 13 Dec 2013 19:36:56 -0800 Message-Id: <1386992217-9464-3-git-send-email-dolsen@gentoo.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386992217-9464-1-git-send-email-dolsen@gentoo.org> References: <1386992217-9464-1-git-send-email-dolsen@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Archives-Salt: 90848f84-6521-42a9-bce2-de58f4d089c8 X-Archives-Hash: d53f40994f53d25480e786c166cd1f5a --- catalyst/defaults.py | 15 +++++++++++++++ catalyst/main.py | 19 +++---------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 50d1d18..aa1e9e8 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -66,3 +66,18 @@ 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", + "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", + } + diff --git a/catalyst/main.py b/catalyst/main.py index be21970..e969896 100644 --- 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", - "packagedir": "/usr/portage/packages", - "portdir": "/usr/portage", - "port_tmpdir": "/var/tmp/portage", - "repo_name": "portage", - "sharedir": "/usr/lib/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): @@ -123,7 +110,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.3.2