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 987DF138A1A for ; Thu, 22 Jan 2015 21:21:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 68440E0919; Thu, 22 Jan 2015 21:21:20 +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 E57E0E090F for ; Thu, 22 Jan 2015 21:21:19 +0000 (UTC) Received: from [10.0.31.246] (unknown [100.42.98.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id E41A33406C8; Thu, 22 Jan 2015 21:21:18 +0000 (UTC) Message-ID: <54C169CC.1000902@gentoo.org> Date: Thu, 22 Jan 2015 13:21:16 -0800 From: Zac Medico User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-portage-dev@lists.gentoo.org CC: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= Subject: Re: [gentoo-portage-dev] [PATCH] Support USE_EXPAND prefixes in package.use and relevant files References: <1421752723-2045-1-git-send-email-mgorny@gentoo.org> In-Reply-To: <1421752723-2045-1-git-send-email-mgorny@gentoo.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 452acbfb-e2f5-46c9-a21f-08c0c6424688 X-Archives-Hash: 970d2f42dd8550a6ba2eba8d1a7a5c67 On 01/20/2015 03:18 AM, Michał Górny wrote: > Support prefixing groups of USE_EXPAND flags with 'USE_EXPAND:' in user > configuration package.use and similar files. This provides a convenient > way of declaring specifying multiple USE_EXPAND flags and matches the > syntax supported by Paludis. Example: > > dev-util/netbeans NETBEANS_MODULES: php webcommon extide > media-libs/mesa osmesa VIDEO_CARDS: intel nouveau > --- > pym/portage/package/ebuild/_config/UseManager.py | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/pym/portage/package/ebuild/_config/UseManager.py b/pym/portage/package/ebuild/_config/UseManager.py > index 3a4ec22..59f474e 100644 > --- a/pym/portage/package/ebuild/_config/UseManager.py > +++ b/pym/portage/package/ebuild/_config/UseManager.py > @@ -202,10 +202,17 @@ class UseManager(object): > useflag_re = _get_useflag_re(eapi) > for k, v in file_dict.items(): > useflags = [] > + use_expand_prefix = '' > for prefixed_useflag in v: > + if extended_syntax and prefixed_useflag[-1] == ":": > + use_expand_prefix = prefixed_useflag[:-1].lower() + "_" > + continue > + > if prefixed_useflag[:1] == "-": > useflag = prefixed_useflag[1:] > + prefixed_useflag = "-" + use_expand_prefix + useflag > else: > + prefixed_useflag = use_expand_prefix + prefixed_useflag > useflag = prefixed_useflag > if useflag_re.match(useflag) is None: > writemsg(_("--- Invalid USE flag for '%s' in '%s': '%s'\n") % We could match useflag_re against (use_expand_prefix + useflag) here, so that the use_expand_prefix is also validated. Otherwise, the patch looks good. -- Thanks, Zac