Open thesamesam opened 2 years ago
This is related to https://github.com/pkgcore/pkgcheck/issues/414 but it's a bit different.
The other bug (#414) is about USE flags which exist and (usually) do something but shouldn't (should be made either always on, or maybe even always off) because they provide little utility.
This bug (#427) is about zombie USE flags (USE flags in IUSE which have no effect on the output or build process at all, it does nothing, and its value isn't even checked).
The other bug might hit some cases of this bug.
OK, so as preparation, the list of places where a USE flag can be used:
*DEPEND
HOMEPAGE
, SRC_URI
, LICENSE
, REQUIRED_USE
, PROPERTIES
and RESTRICT
(PMS, chapter 8.1)use
, usev
, useq
(banned), use_with
, use_enable
, usex
Special cases that I exclude:
test
doc
I'd suggest disabling the check if any variable reference is found for those invocations- IE, use $VAR
. It's a stretch, but consider an eclass that is renaming a use flag- I would use an intermediate var to hold what the flag is for the 'before' and 'after', and this check wouldn't like that.
It's possible to have USE flags in IUSE which are declared in metadata.xml (or global USE flags) which don't actually do anything (no references in dependencies, or in the ebuilds).
Example: see https://gitweb.gentoo.org/repo/gentoo.git/commit/net-misc/iputils?id=0b738488bed8d9735db35ade5a01834b3e07ebcf.