Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH 06/18] Add tentative support for EAPI6 einstalldocs function
Date: Mon, 01 Dec 2014 21:30:00
Message-Id: 1417469316-25052-7-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set by "Michał Górny"
1 Add the einstalldocs function to conveniently install documentation
2 using the default patterns or DOCS and HTML_DOCS variables.
3 ---
4 bin/eapi.sh | 4 ++++
5 bin/phase-helpers.sh | 28 ++++++++++++++++++++++++++++
6 2 files changed, 32 insertions(+)
7
8 diff --git a/bin/eapi.sh b/bin/eapi.sh
9 index 6ace20d..978a410 100644
10 --- a/bin/eapi.sh
11 +++ b/bin/eapi.sh
12 @@ -68,6 +68,10 @@ ___eapi_has_get_libdir() {
13 [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
14 }
15
16 +___eapi_has_einstalldocs() {
17 + [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
18 +}
19 +
20 ___eapi_has_master_repositories() {
21 [[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
22 }
23 diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
24 index 764b968..e401676 100644
25 --- a/bin/phase-helpers.sh
26 +++ b/bin/phase-helpers.sh
27 @@ -896,6 +896,34 @@ if ___eapi_has_get_libdir; then
28 }
29 fi
30
31 +if ___eapi_has_einstalldocs; then
32 + einstalldocs() {
33 + (
34 + docinto .
35 + if ! declare -p DOCS &>/dev/null ; then
36 + local d
37 + for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
38 + THANKS BUGS FAQ CREDITS CHANGELOG ; do
39 + [[ -s ${d} ]] && dodoc "${d}"
40 + done
41 + elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then
42 + [[ ${DOCS[@]} ]] && dodoc -r "${DOCS[@]}"
43 + else
44 + [[ ${DOCS} ]] && dodoc -r ${DOCS}
45 + fi
46 + )
47 +
48 + (
49 + docinto html
50 + if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then
51 + [[ ${HTML_DOCS[@]} ]] && dodoc -r "${HTML_DOCS[@]}"
52 + else
53 + [[ ${HTML_DOCS} ]] && dodoc -r ${HTML_DOCS}
54 + fi
55 + )
56 + }
57 +fi
58 +
59 if ___eapi_has_master_repositories; then
60 master_repositories() {
61 local output repository=$1 retval
62 --
63 2.1.3