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-commits+bounces-410603-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1RcSBi-00086L-LD
	for garchives@archives.gentoo.org; Mon, 19 Dec 2011 01:38:48 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id BF19321C197;
	Mon, 19 Dec 2011 01:38:39 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 8C46421C197
	for <gentoo-commits@lists.gentoo.org>; Mon, 19 Dec 2011 01:38:39 +0000 (UTC)
Received: from pelican.gentoo.org (unknown [66.219.59.40])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 15EE11B400D
	for <gentoo-commits@lists.gentoo.org>; Mon, 19 Dec 2011 01:38:39 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id 7BB3780042
	for <gentoo-commits@lists.gentoo.org>; Mon, 19 Dec 2011 01:38:38 +0000 (UTC)
From: "Arfrever Frehtes Taifersar Arahesis" <arfrever@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Arfrever Frehtes Taifersar Arahesis" <arfrever@gentoo.org>
Message-ID: <2ea565e1af3416ab5743c4b7181476d9a6734123.arfrever@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: bin/
X-VCS-Repository: proj/portage
X-VCS-Files: bin/ebuild.sh
X-VCS-Directories: bin/
X-VCS-Committer: arfrever
X-VCS-Committer-Name: Arfrever Frehtes Taifersar Arahesis
X-VCS-Revision: 2ea565e1af3416ab5743c4b7181476d9a6734123
Date: Mon, 19 Dec 2011 01:38:38 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 8c84a1f1-aed2-48d2-974a-7d42e350fc0a
X-Archives-Hash: 6cd6ce82c88c9f9dac268cc6bd757925

commit:     2ea565e1af3416ab5743c4b7181476d9a6734123
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DO=
T> Org>
AuthorDate: Mon Dec 19 01:33:27 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DO=
T> org>
CommitDate: Mon Dec 19 01:33:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a=
=3Dcommit;h=3D2ea565e1

Disallow some functions in global scope in EAPI=3D"4-python".

---
 bin/ebuild.sh |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index af7b3a9..63c246a 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -25,17 +25,27 @@ else
 		libopts register_die_hook register_success_hook \
 		remove_path_entry set_unless_changed strip_duplicate_slashes \
 		unset_unless_changed use_with use_enable ; do
-		eval "${x}() { : ; }"
+		eval "${x}() {
+			if has \"\${EAPI:-0}\" 4-python; then
+				die \"\${FUNCNAME}() calls are not allowed in global scope\"
+			fi
+		}"
 	done
-	# These dummy functions return false, in order to ensure that
+	# These dummy functions return false in older EAPIs, in order to ensure=
 that
 	# `use multislot` is false for the "depend" phase.
 	for x in use useq usev ; do
-		eval "${x}() { return 1; }"
+		eval "${x}() {
+			if has \"\${EAPI:-0}\" 4-python; then
+				die \"\${FUNCNAME}() calls are not allowed in global scope\"
+			else
+				return 1
+			fi
+		}"
 	done
 	# These functions die because calls to them during the "depend" phase
 	# are considered to be severe QA violations.
 	for x in best_version has_version portageq ; do
-		eval "${x}() { die \"\${FUNCNAME} calls are not allowed in global scop=
e\"; }"
+		eval "${x}() { die \"\${FUNCNAME}() calls are not allowed in global sc=
ope\"; }"
 	done
 	unset x
 fi