Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 215673 - eutils built_with_use doesn't handle eapi1 default IUSE in vdb properly
Summary: eutils built_with_use doesn't handle eapi1 default IUSE in vdb properly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2008-04-01 08:19 UTC by Brian Harring (RETIRED)
Modified: 2008-04-05 22:40 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
quicky patch to eutils.eclass:built_with_use (eutils.patch,402 bytes, patch)
2008-04-01 08:20 UTC, Brian Harring (RETIRED)
Details | Diff
fancy patch using pattern matching to avoid multiple hasq calls (eutils.eclass.patch,553 bytes, patch)
2008-04-01 19:55 UTC, Zac Medico
Details | Diff
fancy patch using pattern matching to avoid multiple hasq calls (eutils.eclass.patch,555 bytes, patch)
2008-04-01 20:02 UTC, Zac Medico
Details | Diff
eutils.eclass.patch (eutils.eclass.patch,531 bytes, patch)
2008-04-03 23:41 UTC, Doug Goldstein (RETIRED)
Details | Diff
eutils.eclass.patch (eutils.eclass.patch,798 bytes, patch)
2008-04-04 00:03 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Harring (RETIRED) gentoo-dev 2008-04-01 08:19:45 UTC
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.
Comment 1 Brian Harring (RETIRED) gentoo-dev 2008-04-01 08:20:38 UTC
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.
Comment 2 Doug Goldstein (RETIRED) gentoo-dev 2008-04-01 19:21:20 UTC
Zac: weren't we going to get a nice way to actually implement this rather then searching VDB directly?
Comment 3 Brian Harring (RETIRED) gentoo-dev 2008-04-01 19:26:26 UTC
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.
Comment 4 Doug Goldstein (RETIRED) gentoo-dev 2008-04-01 19:38:49 UTC
Well fine with me to commit so that built_with_use supports EAPI=0 and EAPI=1.
Comment 5 Zac Medico gentoo-dev 2008-04-01 19:55:50 UTC
Created attachment 147996 [details, diff]
fancy patch using pattern matching to avoid multiple hasq calls
Comment 6 Zac Medico gentoo-dev 2008-04-01 20:02:43 UTC
Created attachment 147997 [details, diff]
fancy patch using pattern matching to avoid multiple hasq calls
Comment 7 Zac Medico gentoo-dev 2008-04-01 20:04:58 UTC
Well, I messed up the second patch too. s/USE/IUSE_BUILT/
Comment 8 SpanKY gentoo-dev 2008-04-01 21:44:00 UTC
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 -)
Comment 9 David Leverton 2008-04-02 18:20:21 UTC
Not extensively tested, but something like

local IUSE_BUILT=( $(<${IUSEFILE}) )
...
if ! has $1 ${IUSE_BUILT[@]#[-+]} ; then

is probably nicest.
Comment 10 Zac Medico gentoo-dev 2008-04-02 21:07:22 UTC
(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).
Comment 11 Zac Medico gentoo-dev 2008-04-03 16:12:13 UTC
(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
Comment 12 Doug Goldstein (RETIRED) gentoo-dev 2008-04-03 23:41:32 UTC
Created attachment 148557 [details, diff]
eutils.eclass.patch

Final answer?
Comment 13 Zac Medico gentoo-dev 2008-04-04 00:03:29 UTC
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.
Comment 14 Zac Medico gentoo-dev 2008-04-05 22:40:46 UTC
Okay, I went ahead and committed this. Thanks everyone.