public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [gentoo-portage-dev] [PATCH 04/13] Add tentative support for EAPI6 einstalldocs function
  @ 2014-08-18 17:56 99% ` Michał Górny
  0 siblings, 0 replies; 1+ results
From: Michał Górny @ 2014-08-18 17:56 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Add the einstalldocs function to conveniently install documentation
using the default patterns or DOCS and HTML_DOCS variables.
---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 22 ++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 6ace20d..978a410 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -68,6 +68,10 @@ ___eapi_has_get_libdir() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
+___eapi_has_einstalldocs() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_master_repositories() {
 	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
 }
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 8edbc07..6ccf4f4 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -853,6 +853,28 @@ if ___eapi_has_get_libdir; then
 	}
 fi
 
+if ___eapi_has_einstalldocs; then
+	einstalldocs() {
+		if ! declare -p DOCS &>/dev/null ; then
+			local d
+			for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
+					THANKS BUGS FAQ CREDITS CHANGELOG ; do
+				[[ -s ${d} ]] && dodoc "${d}"
+			done
+		elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then
+			[[ ${DOCS[@]} ]] && dodoc -r "${DOCS[@]}"
+		else
+			[[ ${DOCS} ]] && dodoc -r ${DOCS}
+		fi
+
+		if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then
+			[[ ${HTML_DOCS[@]} ]] && dohtml -r "${HTML_DOCS[@]}"
+		else
+			[[ ${HTML_DOCS} ]] && dohtml -r ${HTML_DOCS}
+		fi
+	}
+fi
+
 if ___eapi_has_master_repositories; then
 	master_repositories() {
 		local output repository=$1 retval
-- 
2.0.4



^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2014-08-18 17:56     [gentoo-portage-dev] [PATCHES] Initial EAPI6 patch set for review Michał Górny
2014-08-18 17:56 99% ` [gentoo-portage-dev] [PATCH 04/13] Add tentative support for EAPI6 einstalldocs function Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox