Hello,

As most of you probably doesn't know, PMS guarantees that ${D} always
ends with a slash. It seems that this particular wording was enforced
by historical portage behavior (instead of fixing the ebuilds...) yet
it didn't ever get really widespread.

Specifically, it is awfully counter-intuitive and even PMS gets it
wrong in most of the time (see: einstall). I could sum up the issues
with it in three snippets:

1) "${D}"usr/bin/foo

2) emake install DESTDIR="${D%/}"

3) local foodir=/usr/share/foo
   insinto ${foodir}
   ...
   bar "${D}${foodir#/}"

Ugly, isn't it? And since it's completely counter-intuitive, most
ebuilds and eclasses get it wrong. Either by appending a slash just to
be sure (and having double slashes) or even conditionally stripping one.

While we could keep 'fixing' the ebuilds to follow the weird PMS
requirement, I'd rather go the other way -- fixing PMS to reflect
common sense.

The plan would be to:

1) lift the requirement that ${D} needs to end with slash,

2) fix all the ebuilds and eclasses which rely on that to use explicit
slash -- resulting in double slashes in the transition period,

3) make portage not append the slash anymore,

4) update PMS to specify that all directory variables do not end with
a slash,

5) slowly update the remaining ebuilds and eclasses to remove
the conditional slash removal/appending code.

This is mostly possible since majority of systems supported by Gentoo
does work fine with double slashes in paths, and the custom Cygwin port
fails randomly anyway due to this specific issue. We'd break it
completely for the transition period but afterwards, it will all be
clean and sane again.

Your thoughts?

-- 
Best regards,
Michał Górny

Attachment: signature.asc
Description: PGP signature

Reply via email to