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 2E97C13877A for ; Sun, 27 Jul 2014 15:39:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E98CFE0D04; Sun, 27 Jul 2014 15:38:56 +0000 (UTC) Received: from mail-oi0-f46.google.com (mail-oi0-f46.google.com [209.85.218.46]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id ABE61E0B9E for ; Sun, 27 Jul 2014 15:38:55 +0000 (UTC) Received: by mail-oi0-f46.google.com with SMTP id i138so5059439oig.19 for ; Sun, 27 Jul 2014 08:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=msuFjmmDihkEStFINXMBNSnKEzgTIJ9Oel+Nt5/lgxU=; b=kQ5EktZemFz/UE1tCc+FD+6PVYTOtfu/hJBR3xGdpXfcmACmam7vXw1vqYBUqEvzie Y5J5NAUhhC6SFMe8QTDoGxzgA0ed3QkSWP8VVfFAuw3VPZMjiptmI6wxO9oucTrY2EFM YPs64Mtc9FE3z120h9d9sx5lpai3pKSP6diBVEvXARTIPVJnIZoeOQY70YPiM/ANxYlC P2/cuHzC92Ho+Vw1IWD7paSBScSnHQ5RseZ1yggQ1X+jFS5L7h6q340f+4aPdA+DVqoV 941psf6NVBkdjh2UGyN0+UV9+mpLGU/2FVqCkJ84r6E2USkBNZQ59CTy9XM0y3iELALj XXDQ== X-Received: by 10.182.24.193 with SMTP id w1mr41260890obf.47.1406475534855; Sun, 27 Jul 2014 08:38:54 -0700 (PDT) Received: from linux1 (cpe-76-187-91-128.tx.res.rr.com. [76.187.91.128]) by mx.google.com with ESMTPSA id v8sm33267417obo.7.2014.07.27.08.38.52 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 27 Jul 2014 08:38:53 -0700 (PDT) Sender: William Hubbs Received: (nullmailer pid 18506 invoked by uid 1000); Sun, 27 Jul 2014 15:38:49 -0000 Date: Sun, 27 Jul 2014 10:38:49 -0500 From: William Hubbs To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] Re: RFC: USE flags in virtuals, to allow a specific provider to be determined Message-ID: <20140727153849.GA17979@linux1> Mail-Followup-To: gentoo-dev@lists.gentoo.org 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> <53D3E94A.9000100@gentoo.org> 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 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: <53D3E94A.9000100@gentoo.org> User-Agent: Mutt/1.5.22 (2013-10-16) X-Archives-Salt: 32774bb4-9f8f-471d-bcaa-b43a352387bd X-Archives-Hash: 42213f6de53f308a0e802ca2b262667d --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 26, 2014 at 01:45:46PM -0400, Jonathan Callen wrote: =20 *snip* > 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=3D5): >=20 > REQUIRED_USE=3D"?? ( foo bar baz )" >=20 > If you want to say "Exactly one of the flags ...", then you use: >=20 > REQUIRED_USE=3D"^^ ( foo bar baz )" >=20 > And, as always, you can say "At least one of the flags ..." with: >=20 > REQUIRED_USE=3D"|| ( foo bar baz )" >=20 > 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: >=20 > " > The following REQUIRED_USE flag constraints are unsatisfied: > at-most-one-of ( foo bar baz ) > " >=20 > Which is, in my opinion, more readable. Now I understand what ciaranm was suggesting in pkg_pretend. Note, this is not shell syntax, but it conveys the idea... pkg_pretend() { count=3D0 for x in foo bar bas; do use $x && count +=3D 1 done # Now, if count =3D=3D 0 none of the flags are used, and # if count > 1 more than one is used, so die whenever appropriate # with any error message you choose. } William --azLHFNyN32YCQGCU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlPVHQkACgkQblQW9DDEZTjRtwCgtBaBlVuXXM+3C/EvGEovfwk/ GwgAoJtd4FMLUtu9MGqAyHmIBBH1T8CX =0goF -----END PGP SIGNATURE----- --azLHFNyN32YCQGCU--