From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-752671-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 662F51389E2
	for <garchives@archives.gentoo.org>; Thu,  4 Dec 2014 14:01:54 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 14230E08AF;
	Thu,  4 Dec 2014 14:01:52 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 03B25E08AF
	for <gentoo-commits@lists.gentoo.org>; Thu,  4 Dec 2014 14:01:51 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id B443434065F
	for <gentoo-commits@lists.gentoo.org>; Thu,  4 Dec 2014 14:01:49 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 477CDB8FC
	for <gentoo-commits@lists.gentoo.org>; Thu,  4 Dec 2014 14:01:47 +0000 (UTC)
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1417701695.5e519e0676249133c0d65cb7f3cabefe2653513e.mgorny@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: bin/
X-VCS-Repository: proj/portage
X-VCS-Files: bin/phase-functions.sh bin/phase-helpers.sh
X-VCS-Directories: bin/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: 5e519e0676249133c0d65cb7f3cabefe2653513e
X-VCS-Branch: master
Date: Thu,  4 Dec 2014 14:01:47 +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
X-Archives-Salt: e5c5fb12-837d-420d-b6ea-9c14040bb11b
X-Archives-Hash: 20d69280cbaf8f8101ddfaabd26c08de

commit:     5e519e0676249133c0d65cb7f3cabefe2653513e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 18 11:57:36 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec  4 14:01:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5e519e06

Add tentative EAPI6 phase functions

---
 bin/phase-functions.sh | 11 +++++++++++
 bin/phase-helpers.sh   | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index ee28c27..aec86fd 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -828,6 +828,17 @@ __ebuild_phase_funcs() {
 				declare -F src_install >/dev/null || \
 					src_install() { default; }
 			fi
+
+			# defaults starting with EAPI 6
+			if ! has ${eapi} 2 3 4 4-python 4-slot-abi 5 5-progress 5-hdepend; then
+				[[ ${phase_func} == src_prepare ]] && \
+					default_src_prepare() { __eapi6_src_prepare; }
+				[[ ${phase_func} == src_install ]] && \
+					default_src_install() { __eapi6_src_install; }
+
+				declare -F src_prepare >/dev/null || \
+					src_prepare() { default; }
+			fi
 			;;
 	esac
 }

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index e2376bf..5605efd 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -795,6 +795,24 @@ __eapi4_src_install() {
 	fi
 }
 
+__eapi6_src_prepare() {
+	if [[ $(declare -p PATCHES) == "declare -a"* ]]; then
+		eapply "${PATCHES[@]}"
+	elif [[ -n ${PATCHES} ]]; then
+		eapply ${PATCHES}
+	fi
+
+	eapply_user
+}
+
+__eapi6_src_install() {
+	if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
+		emake DESTDIR="${D}" install
+	fi
+
+	einstalldocs
+}
+
 # @FUNCTION: has_version
 # @USAGE: [--host-root] <DEPEND ATOM>
 # @DESCRIPTION: