From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 008DF13877A for ; Sat, 26 Jul 2014 17:46:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F030AE0F3D; Sat, 26 Jul 2014 17:45:41 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F32C9E0F0A for ; Sat, 26 Jul 2014 17:45:40 +0000 (UTC) Received: from [192.168.1.95] (pool-173-71-214-138.clppva.fios.verizon.net [173.71.214.138]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jcallen) by smtp.gentoo.org (Postfix) with ESMTPSA id D561F33F5F3 for ; Sat, 26 Jul 2014 17:45:39 +0000 (UTC) Message-ID: <53D3E94A.9000100@gentoo.org> Date: Sat, 26 Jul 2014 13:45:46 -0400 From: Jonathan Callen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] Re: RFC: USE flags in virtuals, to allow a specific provider to be determined References: <53D2A6C8.9060900@gentoo.org> <20140725210438.0703f164@gentp.lnet> <53D2AEC3.2080600@gentoo.org> <20140725214402.7a65a988@gentp.lnet> <20140725204649.105e8641@googlemail.com> <1406317889.20388.25.camel@gentoo.org> <53D2B60D.3040402@gentoo.org> <20140725212323.GA5842@linux1> In-Reply-To: <20140725212323.GA5842@linux1> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Archives-Salt: aac4e9f6-891a-4686-9a36-6d01dc82e6a9 X-Archives-Hash: eb2397f6dd34d51227c0f50b4d18fdd0 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 07/25/2014 05:23 PM, William Hubbs wrote: > On Fri, Jul 25, 2014 at 03:54:53PM -0400, Ian Stakenvicius wrote: >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 >> >> On 25/07/14 03:51 PM, Pacho Ramos wrote: >>> El vie, 25-07-2014 a las 20:46 +0100, Ciaran McCreesh >>> escribió: >>>> On Fri, 25 Jul 2014 21:44:02 +0200 Luis Ressel >>>> wrote: >>>>> Okay, I didn't think of that. I'm not sure if the blocker >>>>> deps or the REQUIRED_USE would be more helpful for Portage, >>>>> but generally I think that the REQUIRED_USE error message >>>>> is quite hard to understand for unexperienced users -- much >>>>> more so than the error generated by a blocker dep. >>>> >>>> ...and the fix for that is to scrap REQUIRED_USE and use >>>> pkg_pretend instead. >>>> >>> >>> Could you give an example to let us see how pkg_pretend could >>> be used to achieve the same as REQUIRED_USE? >>> >>> Thanks >>> >>> >> >> pkg_pretend() { if use heimdal && use mit-krb5; then eerror >> "Please set only one of the use following flags:" eerror >> "heimdal, mit-krb5" die "conflicting use flags set" fi } > > I think this could get complicated really quick though. For > example, if I have an ebuild with three use flags, > flag1/flag2/flag3 with the requirement that one and only one of > them must be set, unless bash has an xor operator I don't know > about, that is going to need a lot of nesting etc to get right. > > William > If you want to say "At most one of the flags 'foo', 'bar', and 'baz' may be selected", then you say it like so (requires EAPI=5): REQUIRED_USE="?? ( foo bar baz )" If you want to say "Exactly one of the flags ...", then you use: REQUIRED_USE="^^ ( foo bar baz )" And, as always, you can say "At least one of the flags ..." with: REQUIRED_USE="|| ( foo bar baz )" While each of these can be written using the "foo? ( !bar )"-type primitives, the messages portage outputs are generally better with '??', '^^', and '||', as you might see something like: " The following REQUIRED_USE flag constraints are unsatisfied: at-most-one-of ( foo bar baz ) " Which is, in my opinion, more readable. - -- Jonathan Callen -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCgAGBQJT0+lKAAoJELHSF2kinlg4T8sQAKLq2d4x8UfDTxm8FP6yX5zv g0GGjPe6TNSwJT83FIw2Bof85u2xGUHaozUaxr+3wwgYVmSaH8BcuEc41reaNZu0 aRhFonAySSTVW/OFEW/X+kpfxAgtFAVGsZ2MBXuFLshB+z/OPDL4lPS7pvUCSZVG iXPlLNE05ZvF+mxSU4enKEChRPxYTBso3cXGqog0qAZrefv8I9w+QeesaGvXlr7v 65S9qPcgOhQRz1q5HfoQ55fdGHy53+/9ny86Gpxpg7xbEYUe0t2LCInFPT4ivL28 OAnSbwML7bMzphvT4EM+eHghfWIATRmnY5O7O9X66sOUB/JrtG3eQei/9EyAHwhA JurcdfUu8zcsSjocuqxbQpMGeiEa1bcfzl3u39WUuFAoVsayzXEI3U9SziemmCpU CCeRF+A5mV6PhFQBYczkdeu3xKc9zQoA3s/EaUYybmTli4oVwtMJUm224TWJEFg+ d7AxM49dyRPLHrHxbK69G7RVowXlaPlISCA/hahAmcgtZVD8y1phwP1qB9j8OBlL DTrcuqiv9Ba4J+DmdhsjB/uvVZpoyfMVl9z1ytLKFjiEpo/PyJAPWRlRrAwq/Gz8 1rh4MrSqAEMGB4mEQaohDfMVVaCQmhGXZkpaBMtARiV3BDlI3W0bKPPh+r435ZZc Z7PHHOimf/6acsprx/wI =vExv -----END PGP SIGNATURE-----