diff options
author | Ulrich Müller <ulm@gentoo.org> | 2020-02-16 16:57:16 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2020-02-20 20:06:49 +0100 |
commit | 353f6addd6f45cefb2d316ebbfb0fd6f031ed9d6 (patch) | |
tree | 0927abf2b59269c6164a4f54f1b98f45f108df5d /ebuild-writing | |
parent | general-concepts/slotting: SLOT 0 is not special. (diff) | |
download | devmanual-353f6addd6f45cefb2d316ebbfb0fd6f031ed9d6.tar.gz devmanual-353f6addd6f45cefb2d316ebbfb0fd6f031ed9d6.tar.bz2 devmanual-353f6addd6f45cefb2d316ebbfb0fd6f031ed9d6.zip |
Sync example phase functions from PMS.
This follows the recent PMS update:
https://gitweb.gentoo.org/proj/pms.git/commit/?id=0d4ffd51d3dc86782dae2db9fe632f45af7eec87
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'ebuild-writing')
-rw-r--r-- | ebuild-writing/eapi/text.xml | 2 | ||||
-rw-r--r-- | ebuild-writing/functions/src_install/text.xml | 2 | ||||
-rw-r--r-- | ebuild-writing/functions/src_prepare/text.xml | 12 |
3 files changed, 8 insertions, 8 deletions
diff --git a/ebuild-writing/eapi/text.xml b/ebuild-writing/eapi/text.xml index 57c899e..9a2de35 100644 --- a/ebuild-writing/eapi/text.xml +++ b/ebuild-writing/eapi/text.xml @@ -272,7 +272,7 @@ If USE flag is set, echo [true output][true suffix] (defaults to "yes"), </p> <codesample lang="ebuild"> src_prepare() { - if declare -p PATCHES | grep -q "^declare -a "; then + if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" else [[ -n ${PATCHES} ]] && eapply ${PATCHES} diff --git a/ebuild-writing/functions/src_install/text.xml b/ebuild-writing/functions/src_install/text.xml index 1dd1bac..6ad3412 100644 --- a/ebuild-writing/functions/src_install/text.xml +++ b/ebuild-writing/functions/src_install/text.xml @@ -47,7 +47,7 @@ src_install() { FAQ CREDITS CHANGELOG ; do [[ -s "${d}" ]] && dodoc "${d}" done - elif declare -p DOCS | grep -q "^declare -a " ; then + elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then dodoc "${DOCS[@]}" else dodoc ${DOCS} diff --git a/ebuild-writing/functions/src_prepare/text.xml b/ebuild-writing/functions/src_prepare/text.xml index 5cbfcf1..d62f2fd 100644 --- a/ebuild-writing/functions/src_prepare/text.xml +++ b/ebuild-writing/functions/src_prepare/text.xml @@ -49,12 +49,12 @@ implementation: <codesample lang="ebuild"> src_prepare() { - if declare -p PATCHES | grep -q "^declare -a "; then - [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" - else - [[ -n ${PATCHES} ]] && eapply ${PATCHES} - fi - eapply_user + if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then + [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" + else + [[ -n ${PATCHES} ]] && eapply ${PATCHES} + fi + eapply_user } </codesample> |