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 | 22 ++++++++++++++++++++++ |
6 |
2 files changed, 26 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 8edbc07..6ccf4f4 100644 |
25 |
--- a/bin/phase-helpers.sh |
26 |
+++ b/bin/phase-helpers.sh |
27 |
@@ -853,6 +853,28 @@ if ___eapi_has_get_libdir; then |
28 |
} |
29 |
fi |
30 |
|
31 |
+if ___eapi_has_einstalldocs; then |
32 |
+ einstalldocs() { |
33 |
+ if ! declare -p DOCS &>/dev/null ; then |
34 |
+ local d |
35 |
+ for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \ |
36 |
+ THANKS BUGS FAQ CREDITS CHANGELOG ; do |
37 |
+ [[ -s ${d} ]] && dodoc "${d}" |
38 |
+ done |
39 |
+ elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then |
40 |
+ [[ ${DOCS[@]} ]] && dodoc -r "${DOCS[@]}" |
41 |
+ else |
42 |
+ [[ ${DOCS} ]] && dodoc -r ${DOCS} |
43 |
+ fi |
44 |
+ |
45 |
+ if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then |
46 |
+ [[ ${HTML_DOCS[@]} ]] && dohtml -r "${HTML_DOCS[@]}" |
47 |
+ else |
48 |
+ [[ ${HTML_DOCS} ]] && dohtml -r ${HTML_DOCS} |
49 |
+ fi |
50 |
+ } |
51 |
+fi |
52 |
+ |
53 |
if ___eapi_has_master_repositories; then |
54 |
master_repositories() { |
55 |
local output repository=$1 retval |
56 |
-- |
57 |
2.0.4 |