1 |
commit: 353f6addd6f45cefb2d316ebbfb0fd6f031ed9d6 |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Feb 16 15:57:16 2020 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Feb 20 19:06:49 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=353f6add |
7 |
|
8 |
Sync example phase functions from PMS. |
9 |
|
10 |
This follows the recent PMS update: |
11 |
https://gitweb.gentoo.org/proj/pms.git/commit/?id=0d4ffd51d3dc86782dae2db9fe632f45af7eec87 |
12 |
|
13 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
14 |
|
15 |
ebuild-writing/eapi/text.xml | 2 +- |
16 |
ebuild-writing/functions/src_install/text.xml | 2 +- |
17 |
ebuild-writing/functions/src_prepare/text.xml | 12 ++++++------ |
18 |
3 files changed, 8 insertions(+), 8 deletions(-) |
19 |
|
20 |
diff --git a/ebuild-writing/eapi/text.xml b/ebuild-writing/eapi/text.xml |
21 |
index 57c899e..9a2de35 100644 |
22 |
--- a/ebuild-writing/eapi/text.xml |
23 |
+++ b/ebuild-writing/eapi/text.xml |
24 |
@@ -272,7 +272,7 @@ If USE flag is set, echo [true output][true suffix] (defaults to "yes"), |
25 |
</p> |
26 |
<codesample lang="ebuild"> |
27 |
src_prepare() { |
28 |
- if declare -p PATCHES | grep -q "^declare -a "; then |
29 |
+ if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then |
30 |
[[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" |
31 |
else |
32 |
[[ -n ${PATCHES} ]] && eapply ${PATCHES} |
33 |
|
34 |
diff --git a/ebuild-writing/functions/src_install/text.xml b/ebuild-writing/functions/src_install/text.xml |
35 |
index 1dd1bac..6ad3412 100644 |
36 |
--- a/ebuild-writing/functions/src_install/text.xml |
37 |
+++ b/ebuild-writing/functions/src_install/text.xml |
38 |
@@ -47,7 +47,7 @@ src_install() { |
39 |
FAQ CREDITS CHANGELOG ; do |
40 |
[[ -s "${d}" ]] && dodoc "${d}" |
41 |
done |
42 |
- elif declare -p DOCS | grep -q "^declare -a " ; then |
43 |
+ elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then |
44 |
dodoc "${DOCS[@]}" |
45 |
else |
46 |
dodoc ${DOCS} |
47 |
|
48 |
diff --git a/ebuild-writing/functions/src_prepare/text.xml b/ebuild-writing/functions/src_prepare/text.xml |
49 |
index 5cbfcf1..d62f2fd 100644 |
50 |
--- a/ebuild-writing/functions/src_prepare/text.xml |
51 |
+++ b/ebuild-writing/functions/src_prepare/text.xml |
52 |
@@ -49,12 +49,12 @@ implementation: |
53 |
|
54 |
<codesample lang="ebuild"> |
55 |
src_prepare() { |
56 |
- if declare -p PATCHES | grep -q "^declare -a "; then |
57 |
- [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" |
58 |
- else |
59 |
- [[ -n ${PATCHES} ]] && eapply ${PATCHES} |
60 |
- fi |
61 |
- eapply_user |
62 |
+ if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then |
63 |
+ [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" |
64 |
+ else |
65 |
+ [[ -n ${PATCHES} ]] && eapply ${PATCHES} |
66 |
+ fi |
67 |
+ eapply_user |
68 |
} |
69 |
</codesample> |