Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: bin/
Date: Thu, 30 Aug 2012 05:05:31
Message-Id: 1346303082.6b4b621f1abcf21d3bfa54b323126a3ef11eb52c.zmedico@gentoo
1 commit: 6b4b621f1abcf21d3bfa54b323126a3ef11eb52c
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 30 05:04:42 2012 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 30 05:04:42 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6b4b621f
7
8 EAPI 5: User patches (no-op dummy stub for now)
9
10 A real apply_user_patches implementation will be a bit more work, so
11 for now we'll just implement the minimum amount necessary to satisfy
12 the spec:
13 http://git.overlays.gentoo.org/gitweb/?p=proj/pms.git;a=commit;h=a8bf7862967cce36b7f1b408934a774126da2538
14
15 ---
16 bin/phase-functions.sh | 23 ++++++++++++++++++++++-
17 bin/phase-helpers.sh | 15 +++++++++++++++
18 bin/save-ebuild-env.sh | 4 +++-
19 3 files changed, 40 insertions(+), 2 deletions(-)
20
21 diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
22 index c23be74..ff7d855 100644
23 --- a/bin/phase-functions.sh
24 +++ b/bin/phase-functions.sh
25 @@ -277,7 +277,8 @@ dyn_clean() {
26 "$PORTAGE_BUILDDIR"/.{configured,compiled,tested,packaged} \
27 "$PORTAGE_BUILDDIR"/.die_hooks \
28 "$PORTAGE_BUILDDIR"/.ipc_{in,out,lock} \
29 - "$PORTAGE_BUILDDIR"/.exit_status
30 + "$PORTAGE_BUILDDIR"/.exit_status \
31 + "$PORTAGE_BUILDDIR"/.apply_user_patches
32
33 rm -rf "${PORTAGE_BUILDDIR}/build-info"
34 rm -rf "${WORKDIR}"
35 @@ -381,6 +382,14 @@ dyn_prepare() {
36 die "Failed to create $PORTAGE_BUILDDIR/.prepared"
37 vecho ">>> Source prepared."
38 ebuild_phase post_src_prepare
39 + case "${EAPI}" in
40 + 0|1|2|3|4|4-python|4-slot-abi)
41 + ;;
42 + *)
43 + [[ ! -f ${PORTAGE_BUILDDIR}/.apply_user_patches ]] && \
44 + die "src_prepare must call apply_user_patches at least once"
45 + ;;
46 + esac
47
48 trap - SIGINT SIGQUIT
49 }
50 @@ -804,6 +813,18 @@ _ebuild_phase_funcs() {
51 eval "default_src_install() { _eapi4_src_install \"\$@\" ; }"
52 [[ $phase_func = src_install ]] && \
53 eval "default() { _eapi4_$phase_func \"\$@\" ; }"
54 + case "$eapi" in
55 + 4|4-python|4-slot-abi)
56 + ;;
57 + *)
58 + ! declare -F src_prepare >/dev/null && \
59 + src_prepare() { _eapi5_src_prepare "$@" ; }
60 + default_src_prepare() { _eapi5_src_prepare "$@" ; }
61 + [[ $phase_func = src_prepare ]] && \
62 + eval "default() { _eapi5_$phase_func \"\$@\" ; }"
63 + apply_user_patches() { _eapi5_apply_user_patches "$@" ; }
64 + ;;
65 + esac
66 ;;
67 esac
68
69
70 diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
71 index 3f02c07..3230870 100644
72 --- a/bin/phase-helpers.sh
73 +++ b/bin/phase-helpers.sh
74 @@ -598,6 +598,21 @@ _eapi4_src_install() {
75 fi
76 }
77
78 +_eapi5_src_prepare() {
79 + apply_user_patches
80 +}
81 +
82 +apply_user_patches() {
83 + die "apply_user_patches is not supported with EAPI ${EAPI}"
84 +}
85 +
86 +_eapi5_apply_user_patches() {
87 + # This is a no-op that is just enough to fullfill the spec.
88 + [[ -f ${PORTAGE_BUILDDIR}/.apply_user_patches ]] && return 1
89 + > "${PORTAGE_BUILDDIR}/.apply_user_patches" || die
90 + return 1
91 +}
92 +
93 # @FUNCTION: has_version
94 # @USAGE: <DEPEND ATOM>
95 # @DESCRIPTION:
96
97 diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
98 index 47a2aca..4bf6e4e 100644
99 --- a/bin/save-ebuild-env.sh
100 +++ b/bin/save-ebuild-env.sh
101 @@ -46,7 +46,8 @@ save_ebuild_env() {
102 done
103 unset x
104
105 - unset -f assert assert_sigpipe_ok dump_trace die diefunc \
106 + unset -f apply_user_patches assert assert_sigpipe_ok \
107 + dump_trace die diefunc \
108 quiet_mode vecho elog_base eqawarn elog \
109 esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \
110 KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \
111 @@ -67,6 +68,7 @@ save_ebuild_env() {
112 save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
113 set_unless_changed unset_unless_changed source_all_bashrcs \
114 ebuild_main ebuild_phase ebuild_phase_with_hooks \
115 + _eapi5_apply_user_patches _eapi5_src_prepare \
116 _ebuild_arg_to_phase _ebuild_phase_funcs default \
117 _hasg _hasgq _unpack_tar \
118 ${QA_INTERCEPTORS}