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 4F08A1387FD for ; Wed, 2 Apr 2014 20:09:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1BA84E0E23; Wed, 2 Apr 2014 20:09:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 63E30E0E23 for ; Wed, 2 Apr 2014 20:09:49 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CE07C33FDF2 for ; Wed, 2 Apr 2014 20:09:47 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 18AFA188FD for ; Wed, 2 Apr 2014 20:09:46 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1396469064.69c1839e501cbbf05c1790b267ed1b5b356091c0.dol-sen@gentoo> Subject: [gentoo-commits] proj/catalyst:pending commit in: catalyst/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/defaults.py catalyst/main.py X-VCS-Directories: catalyst/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 69c1839e501cbbf05c1790b267ed1b5b356091c0 X-VCS-Branch: pending Date: Wed, 2 Apr 2014 20:09:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 68e949c3-3c34-4c10-a3e4-f4244ff4d83f X-Archives-Hash: 2a2650a0978332cc90aad9e008ea31d4 Message-ID: <20140402200946.84kdvF_Ey0aQFRe7s4aQ9L1ILBXoFpD-hDuExWs10xg@z> commit: 69c1839e501cbbf05c1790b267ed1b5b356091c0 Author: Brian Dolbec gentoo org> AuthorDate: Sat Jan 19 05:51:35 2013 +0000 Commit: Brian Dolbec gmail com> CommitDate: Wed Apr 2 20:04:24 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=69c1839e Move confdefaults out of main.py --- 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]