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-381649-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1R2ral-0002Mh-3H
	for garchives@archives.gentoo.org; Sun, 11 Sep 2011 21:29:31 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 479DE21C16B;
	Sun, 11 Sep 2011 21:29:18 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 00A0821C16B
	for <gentoo-commits@lists.gentoo.org>; Sun, 11 Sep 2011 21:29:17 +0000 (UTC)
Received: from pelican.gentoo.org (unknown [66.219.59.40])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 5355B1B400A
	for <gentoo-commits@lists.gentoo.org>; Sun, 11 Sep 2011 21:29:17 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id AFC3380042
	for <gentoo-commits@lists.gentoo.org>; Sun, 11 Sep 2011 21:29:16 +0000 (UTC)
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org>
Message-ID: <fc4e3c9cae17a0dc0867c7e5ccefbb47eb5e36f7.zmedico@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: bin/
X-VCS-Repository: proj/portage
X-VCS-Files: bin/ebuild.sh bin/phase-helpers.sh
X-VCS-Directories: bin/
X-VCS-Committer: zmedico
X-VCS-Committer-Name: Zac Medico
X-VCS-Revision: fc4e3c9cae17a0dc0867c7e5ccefbb47eb5e36f7
Date: Sun, 11 Sep 2011 21:29:16 +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: 
X-Archives-Hash: 4179f78dbb4bc875e61d7582003b7413

commit:     fc4e3c9cae17a0dc0867c7e5ccefbb47eb5e36f7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 21:29:04 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 21:29:04 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a=
=3Dcommit;h=3Dfc4e3c9c

ebuild.sh: move use* funcs to phase-helpers.sh

---
 bin/ebuild.sh        |   50 +-------------------------------------------=
------
 bin/phase-helpers.sh |   49 ++++++++++++++++++++++++++++++++++++++++++++=
+++++
 2 files changed, 50 insertions(+), 49 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 936405d..ccf84a4 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -127,54 +127,6 @@ esyslog() {
 	return 0
 }
=20
-useq() {
-	has $EBUILD_PHASE prerm postrm || eqawarn \
-		"QA Notice: The 'useq' function is deprecated (replaced by 'use')"
-	use ${1}
-}
-
-usev() {
-	if use ${1}; then
-		echo "${1#!}"
-		return 0
-	fi
-	return 1
-}
-
-use() {
-	local u=3D$1
-	local found=3D0
-
-	# if we got something like '!flag', then invert the return value
-	if [[ ${u:0:1} =3D=3D "!" ]] ; then
-		u=3D${u:1}
-		found=3D1
-	fi
-
-	if [[ $EBUILD_PHASE =3D depend ]] ; then
-		# TODO: Add a registration interface for eclasses to register
-		# any number of phase hooks, so that global scope eclass
-		# initialization can by migrated to phase hooks in new EAPIs.
-		# Example: add_phase_hook before pkg_setup $ECLASS_pre_pkg_setup
-		#if [[ -n $EAPI ]] && ! has "$EAPI" 0 1 2 3 ; then
-		#	die "use() called during invalid phase: $EBUILD_PHASE"
-		#fi
-		true
-
-	# Make sure we have this USE flag in IUSE
-	elif [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE ]] ; then
-		[[ $u =3D~ $PORTAGE_IUSE ]] || \
-			eqawarn "QA Notice: USE Flag '${u}' not" \
-				"in IUSE for ${CATEGORY}/${PF}"
-	fi
-
-	if has ${u} ${USE} ; then
-		return ${found}
-	else
-		return $((!found))
-	fi
-}
-
 # Return true if given package is installed. Otherwise return false.
 # Takes single depend-type atoms.
 has_version() {
@@ -838,7 +790,7 @@ else
 	# in global scope, even though they are completely useless during
 	# the "depend" phase.
 	for x in diropts docompress exeopts insopts \
-		keepdir libopts use_with use_enable ; do
+		keepdir libopts use useq usev use_with use_enable ; do
 		eval "${x}() { : ; }"
 	done
 	unset x

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 337639f..6064346 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -149,6 +149,55 @@ keepdir() {
 	fi
 }
=20
+
+useq() {
+	has $EBUILD_PHASE prerm postrm || eqawarn \
+		"QA Notice: The 'useq' function is deprecated (replaced by 'use')"
+	use ${1}
+}
+
+usev() {
+	if use ${1}; then
+		echo "${1#!}"
+		return 0
+	fi
+	return 1
+}
+
+use() {
+	local u=3D$1
+	local found=3D0
+
+	# if we got something like '!flag', then invert the return value
+	if [[ ${u:0:1} =3D=3D "!" ]] ; then
+		u=3D${u:1}
+		found=3D1
+	fi
+
+	if [[ $EBUILD_PHASE =3D depend ]] ; then
+		# TODO: Add a registration interface for eclasses to register
+		# any number of phase hooks, so that global scope eclass
+		# initialization can by migrated to phase hooks in new EAPIs.
+		# Example: add_phase_hook before pkg_setup $ECLASS_pre_pkg_setup
+		#if [[ -n $EAPI ]] && ! has "$EAPI" 0 1 2 3 ; then
+		#	die "use() called during invalid phase: $EBUILD_PHASE"
+		#fi
+		true
+
+	# Make sure we have this USE flag in IUSE
+	elif [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE ]] ; then
+		[[ $u =3D~ $PORTAGE_IUSE ]] || \
+			eqawarn "QA Notice: USE Flag '${u}' not" \
+				"in IUSE for ${CATEGORY}/${PF}"
+	fi
+
+	if has ${u} ${USE} ; then
+		return ${found}
+	else
+		return $((!found))
+	fi
+}
+
 use_with() {
 	if [ -z "$1" ]; then
 		echo "!!! use_with() called without a parameter." >&2