Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: Gentoo Developer Mailing List <gentoo-dev@l.g.o>
Subject: [gentoo-dev] [RFC] Cleaning up PMS to have ${D} not end with a slash
Date: Sat, 13 Apr 2013 21:26:53
Message-Id: 20130413232357.0711438b@pomiocik.lan
1 Hello,
2
3 As most of you probably doesn't know, PMS guarantees that ${D} always
4 ends with a slash. It seems that this particular wording was enforced
5 by historical portage behavior (instead of fixing the ebuilds...) yet
6 it didn't ever get really widespread.
7
8 Specifically, it is awfully counter-intuitive and even PMS gets it
9 wrong in most of the time (see: einstall). I could sum up the issues
10 with it in three snippets:
11
12 1) "${D}"usr/bin/foo
13
14 2) emake install DESTDIR="${D%/}"
15
16 3) local foodir=/usr/share/foo
17 insinto ${foodir}
18 ...
19 bar "${D}${foodir#/}"
20
21 Ugly, isn't it? And since it's completely counter-intuitive, most
22 ebuilds and eclasses get it wrong. Either by appending a slash just to
23 be sure (and having double slashes) or even conditionally stripping one.
24
25 While we could keep 'fixing' the ebuilds to follow the weird PMS
26 requirement, I'd rather go the other way -- fixing PMS to reflect
27 common sense.
28
29 The plan would be to:
30
31 1) lift the requirement that ${D} needs to end with slash,
32
33 2) fix all the ebuilds and eclasses which rely on that to use explicit
34 slash -- resulting in double slashes in the transition period,
35
36 3) make portage not append the slash anymore,
37
38 4) update PMS to specify that all directory variables do not end with
39 a slash,
40
41 5) slowly update the remaining ebuilds and eclasses to remove
42 the conditional slash removal/appending code.
43
44 This is mostly possible since majority of systems supported by Gentoo
45 does work fine with double slashes in paths, and the custom Cygwin port
46 fails randomly anyway due to this specific issue. We'd break it
47 completely for the transition period but afterwards, it will all be
48 clean and sane again.
49
50 Your thoughts?
51
52 --
53 Best regards,
54 Michał Górny

Attachments

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

Replies