When merging an eapi1 ebuild to the vdb, portage currently knocks the IUSE entry down to eapi0; specifically, it strips any leading +/- per token. Upshot of this, built_with_use keeps working. Downside, that info is actually useful to --new-use algo's. Needs correction, since currently pkgcore *does* write eapi1 IUSE to the vdb, and sounds of it from zac, portage will be making the same jump. CC'ing zac so he's aware of when this is completed.
Created attachment 147945 [details, diff] quicky patch to eutils.eclass:built_with_use Admittedly, it's a bit ugly making 2 extra has calls. That said, it's safer/cleaner then the alternative of trying to reformat BUILT_IUSE so it's a single has invocation.
Zac: weren't we going to get a nice way to actually implement this rather then searching VDB directly?
portageq metadata exists, but isn't really covered by PMS (plus I've nfc when portageq grew that method). In other words, doesn't do jack for the eapi1 issue in place right now.
Well fine with me to commit so that built_with_use supports EAPI=0 and EAPI=1.
Created attachment 147996 [details, diff] fancy patch using pattern matching to avoid multiple hasq calls
Created attachment 147997 [details, diff] fancy patch using pattern matching to avoid multiple hasq calls
Well, I messed up the second patch too. s/USE/IUSE_BUILT/
doing a =~ like that is probably sanest as the edge word detectors (\< \>) dont work if the edge is not a word (so like a + or -)
Not extensively tested, but something like local IUSE_BUILT=( $(<${IUSEFILE}) ) ... if ! has $1 ${IUSE_BUILT[@]#[-+]} ; then is probably nicest.
(In reply to comment #9) > local IUSE_BUILT=( $(<${IUSEFILE}) ) > ... > if ! has $1 ${IUSE_BUILT[@]#[-+]} ; then That looks good especially since it's compatible with bash-2.x (unlike the =~ method which requires >=bash-3.0).
(In reply to comment #2) > Zac: weren't we going to get a nice way to actually implement this rather then > searching VDB directly? We can make built_with_use detect the existence of a package-manager provided function that serves as a way to access the installed package database without accessing /var/db/pkg directly. Even if we do that though, all that should do is provide the raw IUSE metadata, so we still need to add support to built_with_use to handle default IUSE. More on that here: http://archives.gentoo.org/gentoo-dev/msg_3c332fef8206b0fc289260759f4c9720.xml
Created attachment 148557 [details, diff] eutils.eclass.patch Final answer?
Created attachment 148558 [details, diff] eutils.eclass.patch You have to make IUSE_BUILT into an array for it to work. This patch should be good to go.
Okay, I went ahead and committed this. Thanks everyone.