Dnia 2013-08-21, o godz. 12:33:14
Ulrich Mueller <u...@gentoo.org> napisał(a):

> >>>>> On Wed, 21 Aug 2013, Michał Górny wrote:
> 
> > Proposed implementation follows:
> 
> > 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}"
> 
> The first pair of quotes is not needed.
> 
> >         done
> >     elif [[ $(declare -p DOCS) == "declare -a "* ]] ; then
> >         [[ ${DOCS[@]} ]] && dodoc -r "${DOCS[@]}"
> 
> I'd test for [[ ${#DOCS[@]} -gt 0 ]] here, but presumably that's a
> matter of taste.
> 
> >     else
> >         [[ ${DOCS} ]] && dodoc -r ${DOCS}
> >     fi
> >
> >     if [[ $(declare -p HTML_DOCS) == "declare -a "* ]] ; then
> 
> This will emit an error message if HTML_DOCS is unset. So:
> 
>       if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a "* ]] ; then
> 
> >         dohtml -r "${HTML_DOCS[@]}"
> 
> No test for empty array here?

I don't think it's anywhere near necessary. Since HTML_DOCS has no
default, why would people set it to empty array? Well, unless someone
plays with appending...

Then I'll better add it.

> >     elif [[ ${HTML_DOCS} ]]; then
> >         dohtml -r ${HTML_DOCS}
> 
> Make this the same as the DOCS logic, i.e.:
> 
>       else
>           [[ ${HTML_DOCS} ]] && dohtml -r ${HTML_DOCS}
> 
> >     fi
> 
> Maybe add a "return 0" here?

-- 
Best regards,
Michał Górny

Attachment: signature.asc
Description: PGP signature

Reply via email to