Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Staging 'einstalldocs' for EAPI 6
Date: Wed, 21 Aug 2013 10:33:20
Message-Id: 21012.38762.78303.635558@a1i15.kph.uni-mainz.de
In Reply to: Re: [gentoo-dev] Staging 'einstalldocs' for EAPI 6 by "Michał Górny"
1 >>>>> On Wed, 21 Aug 2013, Micha³ Górny wrote:
2
3 > Proposed implementation follows:
4
5 > einstalldocs() {
6 > if ! declare -p DOCS &>/dev/null ; then
7 > local d
8 > for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
9 > THANKS BUGS FAQ CREDITS CHANGELOG ; do
10 > [[ -s "${d}" ]] && dodoc "${d}"
11
12 The first pair of quotes is not needed.
13
14 > done
15 > elif [[ $(declare -p DOCS) == "declare -a "* ]] ; then
16 > [[ ${DOCS[@]} ]] && dodoc -r "${DOCS[@]}"
17
18 I'd test for [[ ${#DOCS[@]} -gt 0 ]] here, but presumably that's a
19 matter of taste.
20
21 > else
22 > [[ ${DOCS} ]] && dodoc -r ${DOCS}
23 > fi
24 >
25 > if [[ $(declare -p HTML_DOCS) == "declare -a "* ]] ; then
26
27 This will emit an error message if HTML_DOCS is unset. So:
28
29 if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a "* ]] ; then
30
31 > dohtml -r "${HTML_DOCS[@]}"
32
33 No test for empty array here?
34
35 > elif [[ ${HTML_DOCS} ]]; then
36 > dohtml -r ${HTML_DOCS}
37
38 Make this the same as the DOCS logic, i.e.:
39
40 else
41 [[ ${HTML_DOCS} ]] && dohtml -r ${HTML_DOCS}
42
43 > fi
44
45 Maybe add a "return 0" here?
46
47 > }
48
49 Ulrich

Replies

Subject Author
Re: [gentoo-dev] Staging 'einstalldocs' for EAPI 6 Ulrich Mueller <ulm@g.o>
Re: [gentoo-dev] Staging 'einstalldocs' for EAPI 6 "Michał Górny" <mgorny@g.o>