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 DD8EE138262 for ; Sat, 21 May 2016 06:48:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D57A614258; Sat, 21 May 2016 06:48:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 397B014257 for ; Sat, 21 May 2016 06:48:17 +0000 (UTC) Received: from pomiot (d202-252.icpnet.pl [109.173.202.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 78CDD340B79; Sat, 21 May 2016 06:48:15 +0000 (UTC) Date: Sat, 21 May 2016 08:48:09 +0200 From: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] [PATCH 2/2] ebuild.config: Fix filtering all USE_EXPAND variables in EAPI 5+ Message-ID: <20160521084809.33f53d7f.mgorny@gentoo.org> In-Reply-To: <1463783200-9039-2-git-send-email-mgorny@gentoo.org> References: <1463783200-9039-1-git-send-email-mgorny@gentoo.org> <1463783200-9039-2-git-send-email-mgorny@gentoo.org> Organization: Gentoo X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) 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 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/cm9Z8MFpNJNvJ5+7gJLCJzU"; protocol="application/pgp-signature" X-Archives-Salt: a99b1a15-9b7f-448b-b26d-ae3dda00beb6 X-Archives-Hash: 99a703a49cd0deb42b4377e678efeecd --Sig_/cm9Z8MFpNJNvJ5+7gJLCJzU Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, 21 May 2016 00:26:40 +0200 Micha=C5=82 G=C3=B3rny wrote: > Ensure that all USE_EXPAND variables are properly filtered and exported > in EAPI 5 and newer, as required by the PMS. This includes exporting > an empty value if no matching flag is provided in IUSE. >=20 > Bug: https://bugs.gentoo.org/show_bug.cgi?id=3D582140 > --- > pym/portage/eapi.py | 6 +++++- > pym/portage/package/ebuild/config.py | 11 ++++++++--- > 2 files changed, 13 insertions(+), 4 deletions(-) >=20 > diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py > index 1709026..c4fb374 100644 > --- a/pym/portage/eapi.py > +++ b/pym/portage/eapi.py > @@ -50,6 +50,9 @@ def eapi_exports_EBUILD_PHASE_FUNC(eapi): > def eapi_exports_REPOSITORY(eapi): > return eapi in ("4-python", "5-progress") > =20 > +def eapi_exports_USE_EXPAND_variables(eapi): > + return eapi not in ("0", "1", "2", "3", "4", "4-python", "4-slot-abi") > + > def eapi_has_pkg_pretend(eapi): > return eapi not in ("0", "1", "2", "3") > =20 > @@ -101,7 +104,7 @@ def eapi_has_targetroot(eapi): > =20 > _eapi_attrs =3D collections.namedtuple('_eapi_attrs', > 'dots_in_PN dots_in_use_flags exports_EBUILD_PHASE_FUNC ' > - 'feature_flag_test feature_flag_targetroot ' > + 'exports_USE_EXPAND_variables feature_flag_test feature_flag_targetroot= ' > 'hdepend iuse_defaults iuse_effective posixish_locale ' > 'repo_deps required_use required_use_at_most_one_of slot_operator slot_= deps ' > 'src_uri_arrows strong_blocks use_deps use_dep_defaults') > @@ -128,6 +131,7 @@ def _get_eapi_attrs(eapi): > dots_in_PN =3D (eapi is None or eapi_allows_dots_in_PN(eapi)), > dots_in_use_flags =3D (eapi is None or eapi_allows_dots_in_use_flags(e= api)), > exports_EBUILD_PHASE_FUNC =3D (eapi is None or eapi_exports_EBUILD_PHA= SE_FUNC(eapi)), > + exports_USE_EXPAND_variables =3D (eapi is None or eapi_exports_USE_EXP= AND_variables(eapi)), > feature_flag_test =3D True, > feature_flag_targetroot =3D (eapi is not None and eapi_has_targetroot(= eapi)), > hdepend =3D (eapi is not None and eapi_has_hdepend(eapi)), > diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/e= build/config.py > index 5f19996..ee1fadb 100644 > --- a/pym/portage/package/ebuild/config.py > +++ b/pym/portage/package/ebuild/config.py > @@ -1279,7 +1279,7 @@ class config(object): > =20 > def __init__(self, settings, unfiltered_use, > use, usemask, iuse_effective, > - use_expand_split, use_expand_dict): > + use_expand_split, use_expand_dict, eapi_exports_USE_EXPAND_variables): > self._settings =3D settings > self._unfiltered_use =3D unfiltered_use > self._use =3D use > @@ -1287,6 +1287,7 @@ class config(object): > self._iuse_effective =3D iuse_effective > self._use_expand_split =3D use_expand_split > self._use_expand_dict =3D use_expand_dict > + self._eapi_exports_USE_EXPAND_variables =3D eapi_exports_USE_EXPAND_v= ariables > =20 > def __getitem__(self, key): > prefix =3D key.lower() + '_' > @@ -1330,7 +1331,7 @@ class config(object): > filtered_var_split.append(x) > var_split =3D filtered_var_split > =20 > - if var_split: > + if var_split or self._eapi_exports_USE_EXPAND_variables: > value =3D ' '.join(var_split) > else: > # Don't export empty USE_EXPAND vars unless the user config > @@ -1725,9 +1726,13 @@ class config(object): > x in self.get('USE_EXPAND', '').split()) > lazy_use_expand =3D self._lazy_use_expand( > self, unfiltered_use, use, self.usemask, > - portage_iuse, use_expand_split, self._use_expand_dict) > + portage_iuse, use_expand_split, self._use_expand_dict, > + eapi_attrs.exports_USE_EXPAND_variables) > =20 > use_expand_iuses =3D {} > + if eapi_attrs.exports_USE_EXPAND_variables: > + for k in use_expand_split: > + use_expand_iuses[k] =3D set() > for x in portage_iuse: > x_split =3D x.split('_') > if len(x_split) =3D=3D 1: After some thinking, I'll prepare another patch that applies the change to all EAPIs. The behavior for earlier EAPIs is implementation-defined by PMS and having it inconsistent will only confuse users. --=20 Best regards, Micha=C5=82 G=C3=B3rny --Sig_/cm9Z8MFpNJNvJ5+7gJLCJzU Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJXQASqXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2REJCMDdDQzRGMERBRDA2RUEwQUZFNDFC MDdBMUFFQUVGQjQ0NjRFAAoJELB6GurvtEZOWXsP/jdyV5u+e/tDsNSj+m/VxGaT ivKUj6Rjux9lxomZtucGtpNITAQEs0UtnCUPx389d90n8YxtM2ZoJTA9l9hT64cC XNKepqLVPgS0hBA9o7D4usb9CEY5gv1yIG+uLIqJgKOOUeyzkmUal5DK+rNvcbJ7 9zV43szOJYsDzxSgo7wSq+1iXM+QuliwlGCvkBq3WLohNrfx+zJr7LbV16rUThnQ B2gDinqCQkWAPMcQBVcnWGo1fEZwoCtZxzLs+2DBATK5lQgpp+SRSCM6T3u86rZb ybdo07B0AnrdaSBkYXEWbKkp4o3nyc77ebh7xoVyNn4UfKa7ySyjsM7MgJxeLXHl SXHa5ImumlRlvH+lETgwPvhaKFybw44TIuwQsXMiGMqJlFEhx9CwSvIc1D2v+2tm JgJvRQ8FXrwWDoKJDiVhRbIm1yfKY3Y2uykzq2Ck6UmayxMzxdM910eJ6TFpKB9J JuaYJ7AbD4fhPiveWPzop7COHtCDyPlb6zBsBY9lV2IIdpz8Fzq+nEvMhMB95GgT tDcZXowK8Z9xKu8RUx8xOBgFOkOpKwfvno3r/dBbVz2Zq+BjMNBS40lzwcDbuWPm FyYBgLoC3F4BsZCyF27g8/mQ9zctGnwLcg/2f2LY5fBDh5epeb1XjwXNCOXO4DD5 J0VgLj15kJCCvxpTh5Xr =ttJ6 -----END PGP SIGNATURE----- --Sig_/cm9Z8MFpNJNvJ5+7gJLCJzU--