Gentoo Archives: gentoo-dev

From: William Hubbs <williamh@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFC: USE flags in virtuals, to allow a specific provider to be determined
Date: Fri, 25 Jul 2014 21:23:34
Message-Id: 20140725212323.GA5842@linux1
In Reply to: Re: [gentoo-dev] RFC: USE flags in virtuals, to allow a specific provider to be determined by Ian Stakenvicius
1 On Fri, Jul 25, 2014 at 03:54:53PM -0400, Ian Stakenvicius wrote:
2 > -----BEGIN PGP SIGNED MESSAGE-----
3 > Hash: SHA256
4 >
5 > On 25/07/14 03:51 PM, Pacho Ramos wrote:
6 > > El vie, 25-07-2014 a las 20:46 +0100, Ciaran McCreesh escribió:
7 > >> On Fri, 25 Jul 2014 21:44:02 +0200 Luis Ressel <aranea@×××××.de>
8 > >> wrote:
9 > >>> Okay, I didn't think of that. I'm not sure if the blocker deps
10 > >>> or the REQUIRED_USE would be more helpful for Portage, but
11 > >>> generally I think that the REQUIRED_USE error message is quite
12 > >>> hard to understand for unexperienced users -- much more so than
13 > >>> the error generated by a blocker dep.
14 > >>
15 > >> ...and the fix for that is to scrap REQUIRED_USE and use
16 > >> pkg_pretend instead.
17 > >>
18 > >
19 > > Could you give an example to let us see how pkg_pretend could be
20 > > used to achieve the same as REQUIRED_USE?
21 > >
22 > > Thanks
23 > >
24 > >
25 >
26 > pkg_pretend() {
27 > if use heimdal && use mit-krb5; then
28 > eerror "Please set only one of the use following flags:"
29 > eerror "heimdal, mit-krb5"
30 > die "conflicting use flags set"
31 > fi
32 > }
33
34 I think this could get complicated really quick though.
35 For example, if I have an ebuild with three use flags,
36 flag1/flag2/flag3 with the requirement that one and only one of them
37 must be set, unless bash has an xor operator I don't know about, that
38 is going to need a lot of nesting etc to get right.
39
40 William

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies