Gentoo Archives: gentoo-dev

From: "Steven J. Long" <slong@××××××××××××××××××.uk>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: Re: [RFC] Cleaning up PMS to have ${D} not end with a slash
Date: Thu, 18 Apr 2013 22:36:24
Message-Id: 20130418230224.GA2509@rathaus.eclipse.co.uk
In Reply to: Re: [gentoo-dev] Re: [RFC] Cleaning up PMS to have ${D} not end with a slash by "Gregory M. Turner"
1 On Mon, Apr 15, 2013 at 11:54:22AM -0700, Gregory M. Turner wrote:
2 > On 4/15/2013 10:31 AM, Steven J. Long wrote:
3 > > On Mon, Apr 15, 2013 at 12:01:24PM +0100, Ciaran McCreesh wrote:
4 > >> The spec guarantees that ROOT will be non-empty and end in a slash. If
5 > >> Portage isn't enforcing this, file a bug.
6 > > Yes, but his point was this:
7 > >
8 > >>> The only thing that would help is if PMS defined that ROOT must not
9 > >>> end with a slash.
10 > >
11 > > ie, let the mangler enforce empty or a valid directory not ending in a
12 > > slash, which is hardly difficult, and makes ROOT easier to work with,
13 > > along the lines of how any shellscripter would do it, similarly to the
14 > > motivation for the change to D. Only with ROOT it's much more important
15 > > that the path is correctly-formed for cross-platform compatibility.
16
17 > That's how EPREFIX works; indeed, you don't need to do ${EPREFIX%/},
18 > ever (unless, perhaps, we are manually scrubbing user inputs that
19 > haven't been scrubbed by portage). Try it yourself: EPREFIX="/"
20 > portageq envvar EPREFIX.
21
22 And you took that decision because it makes writing ebuilds simpler.
23
24 > If we "wanted to" do the same thing to {E,}ROOT we could, at least in
25 > future EAPIs.
26
27 Sure, exactly the point: ED and EROOT (equiv D and ROOT) should just be
28 easy to work with. After all that is the whole reason to provide an ebuild
29 infrastructure in the first place: to make it easy to write scriptlets that
30 compile and install software. Anything that improves that, while staying
31 robust as shell, is worth doing imo. Especially low-hanging fruit like this.
32
33 > However, given that ROOT is named "ROOT", "/" makes some kind of
34 > reasonable, intuitive sense.
35
36 Ofc it does, and I understand where it came from. It just happens to be
37 useless in shellscript, which is what ebuilds are. Nor is anyone arguing
38 that it should change in configuration, or eg in portageq. Just in ebuild
39 space, which was the point Aaron brought up, that Ciaran decided to snip
40 from his reply, while making some random point about portage that had
41 nothing to do with anything.
42
43 > I see double-slash mistakes involving ROOT
44 > here and there, but they are not hopelessly ubiquitous as they are with
45 > D, where, as Michał demonstrates in #465772, approximately 10 ebuilds in
46 > portage use the variable incorrectly for every 1 getting it right!
47
48 Why not just be consistent across all directory variables, which can be
49 done very simply in ebuild.sh, and never have to worry about it for any of
50 them?
51
52 Seems a lot simpler and more robust to me, and we can get on with our lives
53 instead of reading long-winded discussions about whether it's "worth the
54 effort" to support prefix or alt-installs.
55
56 IMO some of those people should "make the effort" to learn the language
57 they're implementing in, instead of criticizing what they clearly don't
58 grok. And the rest should go back to the swamp.
59
60 Regards,
61 steveL.
62 --
63 #friendly-coders -- We're friendly, but we're not /that/ friendly ;-)