Gentoo Archives: gentoo-catalyst

From: "W. Trevor King" <wking@×××××××.us>
To: gentoo-catalyst@l.g.o
Subject: Re: [gentoo-catalyst] More proposed Catalyst changes
Date: Thu, 31 Jan 2013 19:47:08
Message-Id: 20130131194653.GA4540@odin.tremily.us
In Reply to: Re: [gentoo-catalyst] More proposed Catalyst changes by "W. Trevor King"
1 On Thu, Jan 31, 2013 at 01:39:22PM -0500, W. Trevor King wrote:
2 > I'll see if I can get through 968d818, … sometime later today.
3
4 I had a second wind ;). Here are some comments on the remaining
5 commits:
6
7 968d818 Initial creation of a defaults file. Split out hash and contents to their own classes, files
8
9 After this, it's not clear to me what the difference is between
10 catalyst.support and catalyst.util. Perhaps they should be merged.
11
12 I'd also use catalyst.targets.__all__ instead of coding a list of
13 targets in the apparently unrelated
14 catalyst.defaults.valid_build_targets.
15
16 a4ef493 re-version to "git-rewrite branch"
17
18 Why?
19
20 9d752a7 move confdefaults out of main.py
21
22 Looks good, except, I'm not sure why you changed from
23 `confdefaults.keys()` to `list(confdefaults)` in parse_config() (which
24 should probably be living in catalyst.config anyway).
25
26 c303dae some options cleanup, unifying their use, reducing redundancy.
27
28 While I like the general thrust of this, I'd be happier with explicit
29 boolean options instead of a set of boolean options. For example:
30
31 confdefaults = {
32 'autoresume': False,
33 'ccache': False,
34
35 }
36
37 6aeb5e3 Move LockInUse from support.py to lock.py, fix bad execption raising, pyflakes cleanup
38
39 With respect to the exception raising, see my comments on 63a25eb in
40 the previous email. Ahh, it looks like you finish that off with
41 04068a1.
42
43 04068a1 massive pyflakes import cleanup and broken CatalystError calls
44
45 A lot of this is great stuff (Hooray no `import *`!). However, I'd
46 split the `print_traceback=True` changes out into their own commit (or
47 just change the default value for CatalystError while you're testing).
48
49 It looks like an unrelated change to
50 catalyst.defaults.required_build_targets snuck into this commit.
51
52 The hash_map changes should probably be squashed into the earlier hash
53 reorganization, rather than going into this commit.
54
55 c672887 begin splitting up generic_stage_target into smaller code blocks so snapshot_target does not need to import it since most of it was not used or initialized properly.
56
57 I'd shift “so snapshot_target…” into the commit body for a shorter
58 summary. Not much to say about the code, since I haven't dug though
59 it yet.
60
61 2b29212 some spacing and comment cleanup, etc.
62
63 Looks ok.
64
65 28888a7 remove redundant /bin/bash additions in cmd() calls
66
67 Looks good.
68
69 97802b6 clean out the old spawn functions, use subprocess.call() instead
70
71 Hooray. Since you're doing this, I'd drop the earlier commits that
72 referenced this change (e.g. d23d96b and 1b2597e).
73
74 624eb0d move base stage and target files to thier own sub-pkg
75
76 s/thier/their/
77
78 The diff looks good.
79
80 5c689a8 update module loading for the new python structure, rename snapshot_target to snapshot
81
82 I think I like this. It's good to use __import__. You're missing a
83 blank line after your import_module docstring summary [1].
84
85 I think that the import_module API should match Python 3's
86 importlib.import_module [2].
87
88 669451d fix options being reset by a config file
89
90 See my comments on c303dae. We should really be using ConfigParser's
91 defaults here, instead of rolling our own default system.
92
93 f56017b fix missed PURGEONLY changes
94
95 This should be squashed into the settings work that caused it.
96
97 c5eb7f7 fix mounts, mountmap hardcoding removal, use normpath to fix paths, add some debug print statements, remove clear & purge code from support.py,
98
99 Split the long commit summary.
100
101 Can we use logging instead of print?
102
103 The except (Failure loading " + x + " plugin) should be squashed into
104 the commit that caused it and be restricted to only catch
105 ImportErrors.
106
107 The mountmap fix for 'proc' → '/proc' should be squashed into the
108 commit that caused it.
109
110 - mypath=self.settings["chroot_path"]
111 + #mypath=self.settings["chroot_path"]
112
113 Just remove this entirely, don't comment it out.
114
115 b2ea321 remove a named parameter in generate_hash() call due to a parameter name change
116
117 Move “due to …” into the commit message body.
118
119 I think keyword arguments are better, because changes to keywords
120 usually occur alongside changes to the argument semantics. A keyword
121 mismatch is an obvious fix, while changes due to a semantic shift can
122 be more subtle.
123
124 a847803 Use normpath from support
125
126 Why are we not using os.path.normpath?
127
128 Also, remove instead of commenting out.
129
130 6108400 chmod +x all sh scripts so they can run from the git checkout
131
132 Looks good,
133
134 242c17d rename all target .py file and classes without the "_target" so they are the same as the .sh files and work with teh simplified module loading.
135
136 Move “so they …” into the commit message body and s/teh/the/.
137
138 I was going to suggest this if you hadn't gotten around to it ;).
139
140 ecc653f fix targets.sh path
141
142 Squash into the commit that caused it.
143
144 d563be8 Comment out a small code block causing TypeError, which also was short circuiting another large code block. FIXME!!!! This whole class seems overly complicated with TOO MANY nested try:excepts:
145
146 Long commit summary.
147
148 I agree that a few of these methods should be split into helper
149 functions for easier reading.
150
151 e05cc34 Break out a few more repeated (path1 + path2)'s to doing it once and using the temp variable. comment out some debug print's
152
153 Long commit summary.
154
155 os.path.join! Also, convert debug prints to use the logging module
156 ;).
157
158 e0738c0 rename a make.conf key to make_conf due to bash variable name restrictions
159
160 Squash into causing commit.
161
162 db2af17 fix my broken subprocess call to use Popen due to environment passing and return code needs
163
164 Squash into causing commit.
165
166 ae61e4a reduce 2 operations into one simpler one
167
168 Just switch to ConfigParser ;).
169
170 b08a757 extend ParserBase to do variable substitution.
171
172 ConfigParser does that to ;).
173
174 265c8ed add a "shdir" setting to make moving the bash code around easier and have less hardcoded paths in the bash scripts
175
176 Long commit summary.
177
178 Your comment claims catalyst runtime executables for both sharedir and
179 shdir.
180
181 dc90e40 migrate all target shell scripts to use the new shdir setting
182
183 Squash into 265c8ed.
184
185 2fa8968 minor cleanup
186
187 Squash into earlier (proposed) global whitespace cleanup and import
188 cleanups.
189
190 d7007a9 fix a bug in relative path use. Add some unique identifiers to echo statements to make identifying the source of a message easier.
191
192 Split into two commits (relative path, unique identifiers). We should
193 also try and figure out less arbitrary identifiers.
194
195 8b9a1c0 add embedded variable substitiution to default settings
196
197 ConfigParser does this.
198
199 1259fa6 make shdir a complete path to ease it's use. Add port_config path setting to remove more hard coded paths in code.
200
201 Squash shdir stuff into the earlier shdir addition.
202
203 Squash port_config into wherever you use it…
204
205 923e8a2 remove trailing slash for consistency in variables and remove extra slashes in paths
206
207 os.path.join()
208
209 55a58ee Add a forced debug print statement in cmd() for better debug output
210
211 Python logging.
212
213 24d69bd Commit my testpath file with instructions to run the git checkout code directly without being installed.
214
215 s/caatalyst/catalyst/
216
217 It would also probably be a good idea to add an example test.conf with
218 relative paths.
219
220 b7036f3 update gitignore
221
222 As I said earlier, the test.* files your ignoring don't seem to exist
223 in my checkout.
224
225 0fb2609 add archdir to settings
226
227 Looks good.
228
229 Cheers,
230 Trevor
231
232 [1]: http://www.python.org/dev/peps/pep-0257/#multi-line-docstrings
233 [2]: http://docs.python.org/dev/library/importlib.html#importlib.import_module
234
235 --
236 This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
237 For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies