On Tue, May 10, 2016 at 5:25 PM, Michael Orlitzky <m...@gentoo.org> wrote: > On 05/10/2016 02:28 PM, Mike Gilbert wrote: >> On Tue, May 10, 2016 at 11:08 AM, Michael Orlitzky <m...@gentoo.org> wrote: >>> 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? >> >> According to PMS, it is only legal in pkg functions. >> >> Can you point to an example where using ROOT in a src function is >> appropriate? >> > > Modulo the question "when should you use $ROOT over $EPREFIX"... > > * the chrome-binary-plugins ebuilds use it in src_install.
This is quite obviously wrong. I happen to maintain that ebuild, so I just fixed. > * dmraid does > > einfo "Appending pkg.m4 from system to aclocal.m4" > cat "${ROOT}"/usr/share/aclocal/pkg.m4 >>"${S}"/aclocal.m4 || \ > die "Could not append pkg.m4 This should be one of two things: cat /usr/share/aclocal/pkg.m4 Or, if prefix support is desired: cat "${EPREFIX}"/usr/share/aclocal/pkg.m4 > Both of those look like EPREFIX candidates to me, but they're not > obviously wrong, either. Maybe it made sense in EAPI <= 3. > > Anywhere that you need addpredict() it also seems reasonable. The > v4l-dvb-saa716x ebuilds use "${ROOT}/usr/src/linux/" where EPREFIX would > not be a good replacement. Nah, usually addpredict is dealing with stuff in the system that is performing the build. Sandboxed phases should never be looking at ROOT. Those ebuilds should probably do addpredict /usr/src/linux instead. > > Something needs to be fixed, though: you're right that the PMS limits > ROOT to pkg_*. Who knew? If we want to be serious about banning ROOT in > src_*, we should add a repoman error. Based on my own understanding of the ROOT variable, its use in src functions is always nonsensical, especially when you consider binpkgs. A binpkg can be installed with a ROOT value that is completely different from its value when the package is being compiled. To put it another way, in src functions, ROOT could/should always be "/". The real value of ROOT isn't determined until merge time. I agree, repoman should be catching this stuff.