Gentoo Archives: gentoo-catalyst

From: "W. Trevor King" <wking@×××××××.us>
To: gentoo-catalyst@l.g.o
Subject: Re: [gentoo-catalyst] [PATCH 2/2] modules/generic_stage_target.py, modules/stage1_target.py: Add a target_mounts dictionary
Date: Wed, 18 Dec 2013 05:35:52
Message-Id: 20131218053547.GL25409@odin.tremily.us
In Reply to: Re: [gentoo-catalyst] [PATCH 2/2] modules/generic_stage_target.py, modules/stage1_target.py: Add a target_mounts dictionary by Brian Dolbec
1 On Tue, Dec 17, 2013 at 09:18:04PM -0800, Brian Dolbec wrote:
2 > On Tue, 2013-12-17 at 19:28 -0800, W. Trevor King wrote:
3 > > On Tue, Dec 17, 2013 at 05:07:27PM -0800, Brian Dolbec wrote:
4 > > > - "portdir":self.settings["snapshot_cache_path"]+"/portage",\
5 > > > - "distdir":self.settings["distdir"],"port_tmpdir":"tmpfs"}
6 > > > + "portdir":normpath(self.settings["snapshot_cache_path"]+"/" + self.settings["repo_name"]),
7 > > > + "distdir":self.settings["distdir"],"port_tmpdir":"tmpfs"}
8 > >
9 > > Can we do this for the mountmap defaults too, and just override the
10 > > mountmap special cases in the SNAPCACHE branch? I think this would be
11 > > a good commit for that (or we can do it in a commit after this).
12 > >
13 > > I don't think the 'portage' → self.settings["repo_name"] replacement
14 > > should go in this commit.
15 >
16 > repo_name variable is already defined. This one got missed in the
17 > change. You want it in the next commit by itself? Can do.
18
19 That's what I want ;). Just to avoid making this one more complicated
20 than it needs to be.
21
22 > > > - self.mounts.append("/var/log/portage")
23 > > > - self.mountmap["/var/log/portage"]=self.settings["port_logdir"]
24 > > > - self.env["PORT_LOGDIR"]="/var/log/portage"
25 > > > + self.mounts.append("port_logdir")
26 > > > + self.mountmap["port_logdir"]=self.settings["port_logdir"]
27 > > > + self.env["PORT_LOGDIR"]=self.settings["port_logdir"]
28 > >
29 > > I don't know where we stand on 'x=y' vs 'x = y', but I'd prefer the
30 > > latter here.
31 >
32 > I do too, but I thought it was agreed to fix all that separately
33 > later :/
34
35 Matt had me work some ' = ' spacing into the last series, but later
36 works for me.
37
38 > > I also think that the PORT_LOGDIR environment variable
39 > > should be:
40 > >
41 > > self.env["PORT_LOGDIR"] = self.target_mounts["port_logdir"]
42 >
43 > meh, but I also prefer some uniformity. I prefer all-caps for
44 > constants. In this case, the end result later in a new defaults.py
45 > file... since it is internal, why mix case in keys. They are also
46 > pushed into the bash environment for the chroot scripts to use. So,
47 > again, uniformity can be your friend when making changes.
48 > Especially with a large complex app like catalyst.
49
50 I don't care about caps, I was trying to fix settings → target_mounts,
51 since settings holds the mount source ;).
52
53 > > Nothing in the chroot should care where the source comes from ;).
54 > > I'd considering renaming mountmap → source_mounts for clarity,
55 > > using existing settings to override source_mounts at
56 > > initialization, and using source_mounts thereafter.
57 >
58 > mounts and mountmap were existing variable names. With some of the
59 > flack I've gotten over my choice of variable name already, now you
60 > want me to go through even more??? Do it in a separate commit.
61 > (after the rewrite patches are done for.)
62
63 Fair enough ;).
64
65 > > > + #print "bind(); cmd =", cmd
66 > >
67 > > If it's not useful enough to print, I don't think we should commit it
68 > > ;).
69 >
70 > There are various of these added to the code. They are EXTREMELY
71 > helpful and even necessary to debug major code changes. Of which the
72 > mounts, mountmap changes were one of the toughest to debug.
73 >
74 > Both you and I have already stated that we want to convert to using
75 > python's logging. These are just a first step towards that goal. All
76 > that is needed is to search out the #print's and replace them with teh
77 > proper logging statement.
78
79 Ok.
80
81 Cheers,
82 Trevor
83
84 --
85 This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
86 For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

Attachments

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

Replies