From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from <gentoo-user+bounces-123002-garchives=archives.gentoo.org@lists.gentoo.org>) id 1QMrbL-0003c3-8i for garchives@archives.gentoo.org; Thu, 19 May 2011 01:00:31 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 35CDE1C0D8; Thu, 19 May 2011 00:59:06 +0000 (UTC) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) by pigeon.gentoo.org (Postfix) with ESMTP id DD1AC1C0D8 for <gentoo-user@lists.gentoo.org>; Thu, 19 May 2011 00:59:05 +0000 (UTC) Received: by wyi11 with SMTP id 11so2085322wyi.40 for <gentoo-user@lists.gentoo.org>; Wed, 18 May 2011 17:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=oRdcfHwM63FraPJoyWgTslKmz0ax9qo+h7+eKWZjTyw=; b=FKjoJoUziDeVM/nabmJSpYg0lwjxJAHjH0gtuxVd74E2vtQ7rKvlb7Zv0zqlZHO2hu z/LNZKNnIxYyi5oGoBAYfS6An6SZ79EPmg+HjwQw00pj1/f8PK1aJ0Ub+/ORxaLfcZi1 1WcEGZfZ7jxwbTYAJ+1C2g1D3LNO2/lYOpy7M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :content-type:content-transfer-encoding:message-id; b=fJYhtw0kzPGtH8TQ9qRYq2rSaYImgx27fNsa6mmijtg5D3rS/QPGHV/ITmfuZPE0ku Ebqu3m3mi5aRt49TMW3Nws/68e9318nfALHgk778HJHq2hpFlpWk15rK02Z5DwTBNYbg rR73IqCMgAKxYm9X/qYwqWbCzSj+isPtnjKMA= Received: by 10.227.37.22 with SMTP id v22mr2478323wbd.27.1305766745100; Wed, 18 May 2011 17:59:05 -0700 (PDT) Received: from nazgul.localnet (196-215-114-244.dynamic.isadsl.co.za [196.215.114.244]) by mx.google.com with ESMTPS id h11sm1285898wbc.43.2011.05.18.17.59.02 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 May 2011 17:59:03 -0700 (PDT) From: Alan McKinnon <alan.mckinnon@gmail.com> To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] portage python USE flags. Date: Thu, 19 May 2011 02:58:17 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.38-ck-r1; KDE/4.6.3; x86_64; ; ) References: <4DD464A8.6050502@gmail.com> In-Reply-To: <4DD464A8.6050502@gmail.com> Precedence: bulk List-Post: <mailto:gentoo-user@lists.gentoo.org> List-Help: <mailto:gentoo-user+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-user.gentoo.org> X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105190258.18116.alan.mckinnon@gmail.com> X-Archives-Salt: X-Archives-Hash: ebc4256ed34e1aec2c4eaee87a21199e Apparently, though unproven, at 02:30 on Thursday 19 May 2011, Dale did opine thusly: > I have a quick question. I sync'd a bit ago and noticed something a bit > odd. Here it is: > > [ebuild U *] sys-apps/portage-2.2.0_alpha34 [2.2.0_alpha33] > USE="(ipc) -build -doc -epydoc -python2 -python3 (-selinux)" > LINGUAS="-pl" 794 kB > > I know portage needs python but check out the USE flags. Both python2 > and python3 are disabled. Shouldn't one of those be enabled? Even > better, shouldn't portage complain a bit about this before emerging? > Thing is, I'm tempted to enable them both. 2.7 is currently being used > but won't 3.1 be used eventually? Should I enable both or just emerge as > is? > > That is the unstable version so if this is a problem, I want to file a > bug before someone else runs into this and ends up with a borked system. The solution, as always, is in the ebuild. But first a clarification: USE flags are NOT some scheme where support will or will not be built, or that other packages will be magically removed somehow. They are programming variables and are used as such. Inside the ebuild, the code looks at the flag and does something with it. Usually it does what you expect: python_dep="python3? ( =dev-lang/python-3* ) !python2? ( !python3? ( build? ( || ( dev-lang/python:2.7 dev-lang/python:2.6 ) ) !build? ( || ( dev-lang/python:2.7 dev-lang/python:2.6 >=dev- lang/python-3 ) ) ) ) python2? ( !python3? ( || ( dev-lang/python:2.7 dev-lang/python:2.6 ) ) )" What that basically comes down to (2nd and 3rd cases swapped for clarity) is: python3 is set = require python-3 python2 is set and python3 is not set = require python-2.6 or python-2.7 python2 is not set python3 is not set = require python-2.6 or python-2.7 Elsewhere is the ebuild you get stuff like this: if use python3; then python_set_active_version 3 elif use python2; then python_set_active_version 2 Which basically means "always set active version to python-2.x regardless of anything else unless USE=python-3, in which case set the active version to python-3. So, no bug here, nothing to see, move along folks. -- alan dot mckinnon at gmail dot com