During emerge, I got the warning 'sed' called in global scope for packages using linux-mod.eclass. Reproducible: Always Steps to Reproduce: 1. emerge --sync 2. emerge -avuDN world Actual Results: If you have packages using linux-mod.eclass, you get the above warning. Expected Results: No warnings. linux-mod.eclass is calling 'sed' at two lines: sed -i 's:SUBDIRS=:M=:g' "${1}" sed -i -e "/.*${CATEGORY}\/${PN}-${PVR}.*/d" This is not in agreement with Gentoo Ebuild policy (http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=3&chap=1): "An external application (such as grep, sed or awk) should never be called in global scope for performance reasons, and alternatives such as using built-in bash replacement should be used instead. Useful alternatives can be found in the Advanced Bash Scripting Guide."
That line in the handbook actually refers to the ebuild policy. sed is used ~122 times in all of our eclasses. I don't see this as a policy violation.
[QA] They are inside a function; so, the eclass itself has no guarantee for it to be ran in global scope. If you however find an ebuild that calls these functions in global scope, feel free to let us know.
+ 14 Jan 2014; Michael Pagano <mpagano@gentoo.org> linux-mod.eclass: + Remove use of sed in linux-mod.eclass. Replace with bash. +
Missed the second spot. I will look at this next.
sed not called in global scope