Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Tue, 07 Jun 2022 06:55:29
Message-Id: 1654584831.66e4193a006529a15ecb13658eac02e218bad7e0.mgorny@gentoo
1 commit: 66e4193a006529a15ecb13658eac02e218bad7e0
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 1 08:02:28 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 7 06:53:51 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66e4193a
7
8 python-utils-r1.eclass: Add explicit checks for incorrect phase
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 eclass/python-utils-r1.eclass | 13 +++++++++++++
13 1 file changed, 13 insertions(+)
14
15 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
16 index fd04cf374ce4..b9cf9c03caeb 100644
17 --- a/eclass/python-utils-r1.eclass
18 +++ b/eclass/python-utils-r1.eclass
19 @@ -696,6 +696,9 @@ python_scriptinto() {
20 python_doexe() {
21 debug-print-function ${FUNCNAME} "${@}"
22
23 + [[ ${EBUILD_PHASE} != install ]] &&
24 + die "${FUNCNAME} can only be used in src_install"
25 +
26 local f
27 for f; do
28 python_newexe "${f}" "${f##*/}"
29 @@ -714,6 +717,8 @@ python_doexe() {
30 python_newexe() {
31 debug-print-function ${FUNCNAME} "${@}"
32
33 + [[ ${EBUILD_PHASE} != install ]] &&
34 + die "${FUNCNAME} can only be used in src_install"
35 [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
36 [[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} <path> <new-name>"
37
38 @@ -762,6 +767,9 @@ python_newexe() {
39 python_doscript() {
40 debug-print-function ${FUNCNAME} "${@}"
41
42 + [[ ${EBUILD_PHASE} != install ]] &&
43 + die "${FUNCNAME} can only be used in src_install"
44 +
45 local _PYTHON_REWRITE_SHEBANG=1
46 python_doexe "${@}"
47 }
48 @@ -786,6 +794,9 @@ python_doscript() {
49 python_newscript() {
50 debug-print-function ${FUNCNAME} "${@}"
51
52 + [[ ${EBUILD_PHASE} != install ]] &&
53 + die "${FUNCNAME} can only be used in src_install"
54 +
55 local _PYTHON_REWRITE_SHEBANG=1
56 python_newexe "${@}"
57 }
58 @@ -894,6 +905,8 @@ python_domodule() {
59 python_doheader() {
60 debug-print-function ${FUNCNAME} "${@}"
61
62 + [[ ${EBUILD_PHASE} != install ]] &&
63 + die "${FUNCNAME} can only be used in src_install"
64 [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
65
66 local includedir=$(python_get_includedir)