1 |
commit: 0ca9ec75522dbf9c55ad422070b6a92140faa5d1 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 19 05:51:35 2013 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Sat Mar 22 18:01:31 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=0ca9ec75 |
7 |
|
8 |
Move confdefaults out of main.py |
9 |
|
10 |
--- |
11 |
catalyst/defaults.py | 17 +++++++++++++++++ |
12 |
catalyst/main.py | 20 +++----------------- |
13 |
2 files changed, 20 insertions(+), 17 deletions(-) |
14 |
|
15 |
diff --git a/catalyst/defaults.py b/catalyst/defaults.py |
16 |
index 748d1dd..b83e4f5 100644 |
17 |
--- a/catalyst/defaults.py |
18 |
+++ b/catalyst/defaults.py |
19 |
@@ -21,6 +21,22 @@ valid_config_file_values.extend(["PKGCACHE", "KERNCACHE", "CCACHE", "DISTCC", |
20 |
|
21 |
verbosity = 1 |
22 |
|
23 |
+confdefaults={ |
24 |
+ "distdir": "/usr/portage/distfiles", |
25 |
+ "hash_function": "crc32", |
26 |
+ "icecream": "/var/cache/icecream", |
27 |
+ "local_overlay": "/usr/local/portage", |
28 |
+ "options": "", |
29 |
+ "packagedir": "/usr/portage/packages", |
30 |
+ "portdir": "/usr/portage", |
31 |
+ "port_tmpdir": "/var/tmp/portage", |
32 |
+ "repo_name": "portage", |
33 |
+ "sharedir": "/usr/lib/catalyst", |
34 |
+ "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", |
35 |
+ "snapshot_name": "portage-", |
36 |
+ "storedir": "/var/tmp/catalyst", |
37 |
+ } |
38 |
+ |
39 |
PORT_LOGDIR_CLEAN = \ |
40 |
'find "${PORT_LOGDIR}" -type f ! -name "summary.log*" -mtime +30 -delete' |
41 |
|
42 |
@@ -48,3 +64,4 @@ SOURCE_MOUNT_DEFAULTS = { |
43 |
"proc": "/proc", |
44 |
"shm": "shmfs", |
45 |
} |
46 |
+ |
47 |
|
48 |
diff --git a/catalyst/main.py b/catalyst/main.py |
49 |
index e2ef976..5748d31 100644 |
50 |
--- a/catalyst/main.py |
51 |
+++ b/catalyst/main.py |
52 |
@@ -22,7 +22,8 @@ from . import __version__ |
53 |
import catalyst.config |
54 |
import catalyst.util |
55 |
from catalyst.support import CatalystError, find_binary, LockInUse |
56 |
-from catalyst.defaults import required_build_targets, valid_build_targets |
57 |
+from catalyst.defaults import (required_build_targets, valid_build_targets, |
58 |
+ confdefaults) |
59 |
from hash_utils import HashMap, HASH_DEFINITIONS |
60 |
from contents import ContentsMap, CONTENTS_DEFINITIONS |
61 |
|
62 |
@@ -70,21 +71,6 @@ def parse_config(myconfig): |
63 |
myconf={} |
64 |
config_file="" |
65 |
|
66 |
- confdefaults = { |
67 |
- "distdir": "/usr/portage/distfiles", |
68 |
- "hash_function": "crc32", |
69 |
- "icecream": "/var/cache/icecream", |
70 |
- "local_overlay": "/usr/local/portage", |
71 |
- "options": "", |
72 |
- "packagedir": "/usr/portage/packages", |
73 |
- "portdir": "/usr/portage", |
74 |
- "repo_name": "portage", |
75 |
- "sharedir": "/usr/share/catalyst", |
76 |
- "snapshot_name": "portage-", |
77 |
- "snapshot_cache": "/var/tmp/catalyst/snapshot_cache", |
78 |
- "storedir": "/var/tmp/catalyst", |
79 |
- } |
80 |
- |
81 |
# first, try the one passed (presumably from the cmdline) |
82 |
if myconfig: |
83 |
if os.path.exists(myconfig): |
84 |
@@ -117,7 +103,7 @@ def parse_config(myconfig): |
85 |
sys.exit(1) |
86 |
|
87 |
# now, load up the values into conf_values so that we can use them |
88 |
- for x in confdefaults.keys(): |
89 |
+ for x in list(confdefaults): |
90 |
if x in myconf: |
91 |
print "Setting",x,"to config file value \""+myconf[x]+"\"" |
92 |
conf_values[x]=myconf[x] |