From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id AE0121382C5 for ; Mon, 5 Feb 2018 02:48:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8D93CE09C7; Mon, 5 Feb 2018 02:48:39 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4A7C6E09C2 for ; Mon, 5 Feb 2018 02:48:38 +0000 (UTC) Received: from [IPv6:2600:8802:605:7900:2e33:7aff:fef2:3005] (unknown [IPv6:2600:8802:605:7900:2e33:7aff:fef2:3005]) (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 A5FC3335C38; Mon, 5 Feb 2018 02:48:36 +0000 (UTC) Subject: Re: [gentoo-portage-dev] [PATCH 2/2] portage.package.ebuild.config: Always export filtered USE_EXPAND vars To: gentoo-portage-dev@lists.gentoo.org, =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= References: <20180204134046.26868-1-mgorny@gentoo.org> <20180204134046.26868-2-mgorny@gentoo.org> From: Zac Medico Message-ID: Date: Sun, 4 Feb 2018 18:48:33 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 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 In-Reply-To: <20180204134046.26868-2-mgorny@gentoo.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sgdruQPief3jgFlgLHt2MvuxyDXeBQkQx" X-Archives-Salt: 9445a964-e279-48d9-8b4a-cad027e0c083 X-Archives-Hash: ab1b588617df36163d60b74b3549e90c This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sgdruQPief3jgFlgLHt2MvuxyDXeBQkQx Content-Type: multipart/mixed; boundary="DbBPI9QNSTLGTF5WqLlZfkeAdYKZyk05w"; protected-headers="v1" From: Zac Medico To: gentoo-portage-dev@lists.gentoo.org, =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= Message-ID: Subject: Re: [gentoo-portage-dev] [PATCH 2/2] portage.package.ebuild.config: Always export filtered USE_EXPAND vars References: <20180204134046.26868-1-mgorny@gentoo.org> <20180204134046.26868-2-mgorny@gentoo.org> In-Reply-To: <20180204134046.26868-2-mgorny@gentoo.org> --DbBPI9QNSTLGTF5WqLlZfkeAdYKZyk05w Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 02/04/2018 05:40 AM, Micha=C5=82 G=C3=B3rny wrote: > Ensure that all USE_EXPAND variables are always exported with filtered > USE flags inside, even if none of those flags are declared in IUSE. > This is the behavior required for EAPI 5+ by the PMS. >=20 > Since the behavior for earlier EAPIs is left undefined and having > different behavior would be confusing to users, apply it in earlier > EAPIs as well. > --- > bin/ebuild.sh | 6 ---- > pym/portage/package/ebuild/config.py | 55 ++--------------------------= -------- > 2 files changed, 3 insertions(+), 58 deletions(-) >=20 > diff --git a/bin/ebuild.sh b/bin/ebuild.sh > index 94a44d534..a914384d6 100755 > --- a/bin/ebuild.sh > +++ b/bin/ebuild.sh > @@ -704,12 +704,6 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then > fi > fi > =20 > -# unset USE_EXPAND variables that contain only the special "*" token > -for x in ${USE_EXPAND} ; do > - [ "${!x}" =3D=3D "*" ] && unset ${x} > -done > -unset x > - > if has nostrip ${FEATURES} ${RESTRICT} || has strip ${RESTRICT} > then > export DEBUGBUILD=3D1 > diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package= /ebuild/config.py > index 35cf4f614..739896923 100644 > --- a/pym/portage/package/ebuild/config.py > +++ b/pym/portage/package/ebuild/config.py > @@ -1359,47 +1359,7 @@ class config(object): > filtered_var_split.append(x) > var_split =3D filtered_var_split > =20 > - if var_split: > - value =3D ' '.join(var_split) > - else: > - # Don't export empty USE_EXPAND vars unless the user config > - # exports them as empty. This is required for vars such as > - # LINGUAS, where unset and empty have different meanings. > - # The special '*' token is understood by ebuild.sh, which > - # will unset the variable so that things like LINGUAS work > - # properly (see bug #459350). > - if has_wildcard: > - value =3D '*' > - else: > - if has_iuse: > - already_set =3D False > - # Skip the first 'env' configdict, in order to > - # avoid infinite recursion here, since that dict's > - # __getitem__ calls the current __getitem__. > - for d in self._settings.lookuplist[1:]: > - if key in d: > - already_set =3D True > - break > - > - if not already_set: > - for x in self._unfiltered_use: > - if x[:prefix_len] =3D=3D prefix: > - already_set =3D True > - break > - > - if already_set: > - value =3D '' > - else: > - value =3D '*' > - else: > - # It's not in IUSE, so just allow the variable content > - # to pass through if it is defined somewhere. This > - # allows packages that support LINGUAS but don't > - # declare it in IUSE to use the variable outside of the > - # USE_EXPAND context. > - value =3D None > - > - return value > + return ' '.join(var_split) > =20 > def _setcpv_recursion_gate(f): > """ > @@ -1775,7 +1735,7 @@ class config(object): > self, unfiltered_use, use, self.usemask, > portage_iuse, use_expand_split, self._use_expand_dict) > =20 > - use_expand_iuses =3D {} > + use_expand_iuses =3D dict((k, set()) for k in use_expand_split) > for x in portage_iuse: > x_split =3D x.split('_') > if len(x_split) =3D=3D 1: > @@ -1783,18 +1743,9 @@ class config(object): > for i in range(len(x_split) - 1): > k =3D '_'.join(x_split[:i+1]) > if k in use_expand_split: > - v =3D use_expand_iuses.get(k) > - if v is None: > - v =3D set() > - use_expand_iuses[k] =3D v > - v.add(x) > + v =3D use_expand_iuses[k].add(x) This assignment to v is unnecessary, but otherwise both patches look good= =2E --=20 Thanks, Zac --DbBPI9QNSTLGTF5WqLlZfkeAdYKZyk05w-- --sgdruQPief3jgFlgLHt2MvuxyDXeBQkQx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iHEEARECADEWIQSG5RNTeMgVEruefzL96O+FrlcZowUCWnfGAhMcem1lZGljb0Bn ZW50b28ub3JnAAoJEP3o74WuVxmjt2UAnRsOFGRxYYlQzo8PvgsGDyimfJ6iAJ93 dcKzNTg2q7VteQ+eqfe0/iga1A== =vTTw -----END PGP SIGNATURE----- --sgdruQPief3jgFlgLHt2MvuxyDXeBQkQx--