public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/_config/, pym/portage/util/
Date: Tue, 21 Nov 2017 00:14:23 +0000 (UTC)	[thread overview]
Message-ID: <1511223108.128c55ed57eea3f02b860a14a7e4f8cae109089a.zmedico@gentoo> (raw)

commit:     128c55ed57eea3f02b860a14a7e4f8cae109089a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 21 00:01:40 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Nov 21 00:11:48 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=128c55ed

UseManager: reject atoms with USE flags (bug 607872)

Reject atoms with USE flags in package.* files since
they trigger infinite recursion in config.setcpv().

Bug: https://bugs.gentoo.org/607872

 pym/portage/package/ebuild/_config/UseManager.py | 5 +++--
 pym/portage/util/__init__.py                     | 6 +++++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/pym/portage/package/ebuild/_config/UseManager.py b/pym/portage/package/ebuild/_config/UseManager.py
index 9ebd0f3ab..7302876ab 100644
--- a/pym/portage/package/ebuild/_config/UseManager.py
+++ b/pym/portage/package/ebuild/_config/UseManager.py
@@ -196,7 +196,8 @@ class UseManager(object):
 		file_dict = grabdict_package(file_name, recursive=recursive,
 			allow_wildcard=extended_syntax, allow_repo=extended_syntax,
 			verify_eapi=(not extended_syntax), eapi=eapi,
-			eapi_default=eapi_default, allow_build_id=allow_build_id)
+			eapi_default=eapi_default, allow_build_id=allow_build_id,
+			allow_use=False)
 		if eapi is not None and eapi_filter is not None and not eapi_filter(eapi):
 			if file_dict:
 				writemsg(_("--- EAPI '%s' does not support '%s': '%s'\n") %
@@ -242,7 +243,7 @@ class UseManager(object):
 				os.path.join(location, file_name),
 				recursive=1, newlines=1, allow_wildcard=True,
 				allow_repo=True, verify_eapi=False,
-				allow_build_id=True)
+				allow_build_id=True, allow_use=False)
 			for k, v in pusedict.items():
 				l = []
 				use_expand_prefix = ''

diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py
index 45710ba72..d63d5f156 100644
--- a/pym/portage/util/__init__.py
+++ b/pym/portage/util/__init__.py
@@ -429,7 +429,7 @@ def read_corresponding_eapi_file(filename, default="0"):
 	return eapi
 
 def grabdict_package(myfilename, juststrings=0, recursive=0, newlines=0,
-	allow_wildcard=False, allow_repo=False, allow_build_id=False,
+	allow_wildcard=False, allow_repo=False, allow_build_id=False, allow_use=True,
 	verify_eapi=False, eapi=None, eapi_default="0"):
 	""" Does the same thing as grabdict except it validates keys
 		with isvalidatom()"""
@@ -458,6 +458,10 @@ def grabdict_package(myfilename, juststrings=0, recursive=0, newlines=0,
 				writemsg(_("--- Invalid atom in %s: %s\n") % (filename, e),
 					noiselevel=-1)
 			else:
+				if not allow_use and k.use:
+					writemsg(_("--- Atom is not allowed to have USE flag(s) in %s: %s\n") % (filename, k),
+						noiselevel=-1)
+					continue
 				atoms.setdefault(k, []).extend(v)
 
 	if juststrings:


             reply	other threads:[~2017-11-21  0:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21  0:14 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-09-26 20:55 [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/_config/, pym/portage/util/ Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1511223108.128c55ed57eea3f02b860a14a7e4f8cae109089a.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox