On 05/08/2016 01:42 PM, Mike Gilbert wrote:
> The current description of ROOT makes no sense and just confuses people.
> The new description is paraphrased from PMS.
The current version is bad, but the PMS version isn't great either.
We really need examples for D, ROOT, ED, EROOT, and EPREFIX.
When/where/why should they (not) be used? How do they compare/contrast?
A lot of people just guess. Our invocation of emake DESTDIR="${D}"
pretty well explains $D, but how the rest of them interact is left up to
your imagination.
We have maybe 150 ebuilds in the tree using $ROOT in src_* functions.
Some are bugs, but many look OK to me. Do we really want to say "never"
do that?
Here's the world's worst bash parser that I used to find them. It
doesn't work, but it gives you a list of likely candidates if you run it
on every ebuild in gentoo.git.
#!/usr/bin/python3
from sys import argv
in_src_func = False
with open(argv[1]) as f:
for line in f:
if not in_src_func:
if line[0:4] == "src_" and line.rstrip()[-1] == "{":
in_src_func = True
else:
if line.rstrip() == "}":
in_src_func = False
else:
if "$ROOT" in line or "${ROOT}" in line:
print(argv[1], ":", line.strip())