1 |
commit: 96845942dcabadb96bc0202c03d19e497278de69 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 31 08:42:00 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 7 06:53:46 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96845942 |
7 |
|
8 |
distutils-r1.eclass: Move install QA checks to post-phase function |
9 |
|
10 |
Perform the install QA check (the invalid package name check) in a post- |
11 |
phase function. This enables it to be performed even when |
12 |
distutils-r1_python_install is not used. |
13 |
|
14 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
15 |
|
16 |
eclass/distutils-r1.eclass | 54 ++++++++++++++++++++++++++-------------------- |
17 |
1 file changed, 31 insertions(+), 23 deletions(-) |
18 |
|
19 |
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass |
20 |
index b690f21f9159..30391ad67f3a 100644 |
21 |
--- a/eclass/distutils-r1.eclass |
22 |
+++ b/eclass/distutils-r1.eclass |
23 |
@@ -1566,29 +1566,6 @@ distutils-r1_python_install() { |
24 |
esetup.py "${args[@]}" |
25 |
fi |
26 |
|
27 |
- local forbidden_package_names=( |
28 |
- examples test tests |
29 |
- .pytest_cache .hypothesis |
30 |
- ) |
31 |
- local p |
32 |
- for p in "${forbidden_package_names[@]}"; do |
33 |
- if [[ -d ${root}$(python_get_sitedir)/${p} ]]; then |
34 |
- die "Package installs '${p}' package which is forbidden and likely a bug in the build system." |
35 |
- fi |
36 |
- done |
37 |
- |
38 |
- local shopt_save=$(shopt -p nullglob) |
39 |
- shopt -s nullglob |
40 |
- local pypy_dirs=( |
41 |
- "${root}${EPREFIX}/usr/$(get_libdir)"/pypy*/share |
42 |
- "${root}${EPREFIX}/usr/lib"/pypy*/share |
43 |
- ) |
44 |
- ${shopt_save} |
45 |
- |
46 |
- if [[ -n ${pypy_dirs} ]]; then |
47 |
- die "Package installs 'share' in PyPy prefix, see bug #465546." |
48 |
- fi |
49 |
- |
50 |
if [[ ! ${DISTUTILS_SINGLE_IMPL} || ${DISTUTILS_USE_PEP517} ]]; then |
51 |
multibuild_merge_root "${root}" "${D%/}" |
52 |
if [[ ${DISTUTILS_USE_PEP517} ]]; then |
53 |
@@ -1845,6 +1822,37 @@ distutils-r1_src_test() { |
54 |
return ${ret} |
55 |
} |
56 |
|
57 |
+# @FUNCTION: _distutils-r1_post_python_install |
58 |
+# @INTERNAL |
59 |
+# @DESCRIPTION: |
60 |
+# Post-phase function called after python_install. |
61 |
+_distutils-r1_post_python_install() { |
62 |
+ debug-print-function ${FUNCNAME} "${@}" |
63 |
+ |
64 |
+ local forbidden_package_names=( |
65 |
+ examples test tests |
66 |
+ .pytest_cache .hypothesis |
67 |
+ ) |
68 |
+ local p |
69 |
+ for p in "${forbidden_package_names[@]}"; do |
70 |
+ if [[ -d ${D}$(python_get_sitedir)/${p} ]]; then |
71 |
+ die "Package installs '${p}' package which is forbidden and likely a bug in the build system." |
72 |
+ fi |
73 |
+ done |
74 |
+ |
75 |
+ local shopt_save=$(shopt -p nullglob) |
76 |
+ shopt -s nullglob |
77 |
+ local pypy_dirs=( |
78 |
+ "${D}${EPREFIX}/usr/$(get_libdir)"/pypy*/share |
79 |
+ "${D}${EPREFIX}/usr/lib"/pypy*/share |
80 |
+ ) |
81 |
+ ${shopt_save} |
82 |
+ |
83 |
+ if [[ -n ${pypy_dirs} ]]; then |
84 |
+ die "Package installs 'share' in PyPy prefix, see bug #465546." |
85 |
+ fi |
86 |
+} |
87 |
+ |
88 |
# @FUNCTION: _distutils-r1_check_namespace_pth |
89 |
# @INTERNAL |
90 |
# @DESCRIPTION: |