From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id B3246138010 for ; Thu, 30 Aug 2012 05:05:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 72403E06F3; Thu, 30 Aug 2012 05:05:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0C5A4E06F3 for ; Thu, 30 Aug 2012 05:05:20 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2D91B33D77C for ; Thu, 30 Aug 2012 05:05:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id EAFC1E543C for ; Thu, 30 Aug 2012 05:05:17 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1346303082.6b4b621f1abcf21d3bfa54b323126a3ef11eb52c.zmedico@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 bin/save-ebuild-env.sh X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 6b4b621f1abcf21d3bfa54b323126a3ef11eb52c X-VCS-Branch: master Date: Thu, 30 Aug 2012 05:05:17 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: c2f62eb5-af79-4dd6-890f-8e4b2c12316f X-Archives-Hash: 1416d06529d5024d128ebeb338182538 commit: 6b4b621f1abcf21d3bfa54b323126a3ef11eb52c Author: Zac Medico gentoo org> AuthorDate: Thu Aug 30 05:04:42 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Aug 30 05:04:42 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6b4b621f EAPI 5: User patches (no-op dummy stub for now) A real apply_user_patches implementation will be a bit more work, so for now we'll just implement the minimum amount necessary to satisfy the spec: http://git.overlays.gentoo.org/gitweb/?p=proj/pms.git;a=commit;h=a8bf7862967cce36b7f1b408934a774126da2538 --- bin/phase-functions.sh | 23 ++++++++++++++++++++++- bin/phase-helpers.sh | 15 +++++++++++++++ bin/save-ebuild-env.sh | 4 +++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh index c23be74..ff7d855 100644 --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@ -277,7 +277,8 @@ dyn_clean() { "$PORTAGE_BUILDDIR"/.{configured,compiled,tested,packaged} \ "$PORTAGE_BUILDDIR"/.die_hooks \ "$PORTAGE_BUILDDIR"/.ipc_{in,out,lock} \ - "$PORTAGE_BUILDDIR"/.exit_status + "$PORTAGE_BUILDDIR"/.exit_status \ + "$PORTAGE_BUILDDIR"/.apply_user_patches rm -rf "${PORTAGE_BUILDDIR}/build-info" rm -rf "${WORKDIR}" @@ -381,6 +382,14 @@ dyn_prepare() { die "Failed to create $PORTAGE_BUILDDIR/.prepared" vecho ">>> Source prepared." ebuild_phase post_src_prepare + case "${EAPI}" in + 0|1|2|3|4|4-python|4-slot-abi) + ;; + *) + [[ ! -f ${PORTAGE_BUILDDIR}/.apply_user_patches ]] && \ + die "src_prepare must call apply_user_patches at least once" + ;; + esac trap - SIGINT SIGQUIT } @@ -804,6 +813,18 @@ _ebuild_phase_funcs() { eval "default_src_install() { _eapi4_src_install \"\$@\" ; }" [[ $phase_func = src_install ]] && \ eval "default() { _eapi4_$phase_func \"\$@\" ; }" + case "$eapi" in + 4|4-python|4-slot-abi) + ;; + *) + ! declare -F src_prepare >/dev/null && \ + src_prepare() { _eapi5_src_prepare "$@" ; } + default_src_prepare() { _eapi5_src_prepare "$@" ; } + [[ $phase_func = src_prepare ]] && \ + eval "default() { _eapi5_$phase_func \"\$@\" ; }" + apply_user_patches() { _eapi5_apply_user_patches "$@" ; } + ;; + esac ;; esac diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index 3f02c07..3230870 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -598,6 +598,21 @@ _eapi4_src_install() { fi } +_eapi5_src_prepare() { + apply_user_patches +} + +apply_user_patches() { + die "apply_user_patches is not supported with EAPI ${EAPI}" +} + +_eapi5_apply_user_patches() { + # This is a no-op that is just enough to fullfill the spec. + [[ -f ${PORTAGE_BUILDDIR}/.apply_user_patches ]] && return 1 + > "${PORTAGE_BUILDDIR}/.apply_user_patches" || die + return 1 +} + # @FUNCTION: has_version # @USAGE: # @DESCRIPTION: diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh index 47a2aca..4bf6e4e 100644 --- a/bin/save-ebuild-env.sh +++ b/bin/save-ebuild-env.sh @@ -46,7 +46,8 @@ save_ebuild_env() { done unset x - unset -f assert assert_sigpipe_ok dump_trace die diefunc \ + unset -f apply_user_patches assert assert_sigpipe_ok \ + dump_trace die diefunc \ quiet_mode vecho elog_base eqawarn elog \ esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \ KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \ @@ -67,6 +68,7 @@ save_ebuild_env() { save_ebuild_env filter_readonly_variables preprocess_ebuild_env \ set_unless_changed unset_unless_changed source_all_bashrcs \ ebuild_main ebuild_phase ebuild_phase_with_hooks \ + _eapi5_apply_user_patches _eapi5_src_prepare \ _ebuild_arg_to_phase _ebuild_phase_funcs default \ _hasg _hasgq _unpack_tar \ ${QA_INTERCEPTORS}