diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index f2daa55..e5ce908 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -428,6 +428,15 @@ autotools-utils_src_install() {
# XXX: support installing them from builddir as well?
if [[ ${DOCS} ]]; then
dodoc "${DOCS[@]}" || die "dodoc failed"
+ else
+ local f
+ # same list as in PMS
+ for f in README* ChangeLog AUTHORS NEWS TODO CHANGES
+ THANKS BUGS FAQ CREDITS CHANGELOG; do
+ if [[ -s ${f} ]]; then
+ dodoc "${f}" || die "(default) dodoc ${f} failed"
+ fi
+ done
fi
if [[ ${HTML_DOCS} ]]; then
dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
--
1.7.8.2
01-06-2012, 10:15 PM
Ulrich Mueller
Support installing default docs, similarly to EAPI4.
>>>>> On Fri, 6 Jan 2012, Michał Górny wrote:
> if [[ ${DOCS} ]]; then
> dodoc "${DOCS[@]}" || die "dodoc failed"
> + else
> + local f
> + # same list as in PMS
> + for f in README* ChangeLog AUTHORS NEWS TODO CHANGES
> + THANKS BUGS FAQ CREDITS CHANGELOG; do
> + if [[ -s ${f} ]]; then
> + dodoc "${f}" || die "(default) dodoc ${f} failed"
> + fi
> + done
> fi
Why only "similarly to EAPI 4" and not identical with it? The latter
would follow the principle of least surprise.
Taken from _eapi4_src_install() in phase-helpers.sh:
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
dodoc "${DOCS[@]}"
else
dodoc ${DOCS}
fi
Ulrich
01-07-2012, 08:43 AM
Michał Górny
Support installing default docs, similarly to EAPI4.
On Sat, 7 Jan 2012 00:15:50 +0100
Ulrich Mueller <ulm@gentoo.org> wrote:
> >>>>> On Fri, 6 Jan 2012, Michał Górny wrote:
>
> > if [[ ${DOCS} ]]; then
> > dodoc "${DOCS[@]}" || die "dodoc failed"
> > + else
> > + local f
> > + # same list as in PMS
> > + for f in README* ChangeLog AUTHORS NEWS TODO
> > CHANGES
> > + THANKS BUGS FAQ CREDITS CHANGELOG;
> > do
> > + if [[ -s ${f} ]]; then
> > + dodoc "${f}" || die "(default)
> > dodoc ${f} failed"
> > + fi
> > + done
> > fi
>
> Why only "similarly to EAPI 4" and not identical with it? The latter
> would follow the principle of least surprise.
Well, the defaults are identical. And DOCS as non-array was never
supported.
--
Best regards,
Michał Górny
01-07-2012, 09:05 AM
Ulrich Mueller
Support installing default docs, similarly to EAPI4.
>>>>> On Sat, 7 Jan 2012, Michał Górny wrote:
>> Why only "similarly to EAPI 4" and not identical with it? The
>> latter would follow the principle of least surprise.
> Well, the defaults are identical. And DOCS as non-array was never
> supported.
Yes, unfortunately some eclasses support DOCS only as an array, others
only as a space-separated list.
IMHO, when such code is touched, it should be changed in a way that
both forms are supported, i.e. to behave like the EAPI 4 default.
Ulrich
01-07-2012, 09:14 AM
Michał Górny
Support installing default docs, similarly to EAPI4.
On Sat, 7 Jan 2012 11:05:09 +0100
Ulrich Mueller <ulm@gentoo.org> wrote:
> >>>>> On Sat, 7 Jan 2012, Michał Górny wrote:
>
> >> Why only "similarly to EAPI 4" and not identical with it? The
> >> latter would follow the principle of least surprise.
>
> > Well, the defaults are identical. And DOCS as non-array was never
> > supported.
>
> Yes, unfortunately some eclasses support DOCS only as an array, others
> only as a space-separated list.
>
> IMHO, when such code is touched, it should be changed in a way that
> both forms are supported, i.e. to behave like the EAPI 4 default.
And IMHO all that 'others' should be modified to support bash arrays.
Or bash should be modified to support using space-separated lists as
arrays because the current behavior is ridiculous.
--
Best regards,
Michał Górny
01-07-2012, 09:46 AM
Ulrich Mueller
Support installing default docs, similarly to EAPI4.
>>>>> On Sat, 7 Jan 2012, Michał Górny wrote:
> On Sat, 7 Jan 2012 11:05:09 +0100
> Ulrich Mueller <ulm@gentoo.org> wrote:
>> Yes, unfortunately some eclasses support DOCS only as an array,
>> others only as a space-separated list.
>>
>> IMHO, when such code is touched, it should be changed in a way that
>> both forms are supported, i.e. to behave like the EAPI 4 default.
> And IMHO all that 'others' should be modified to support bash
> arrays.
I guess a better solution would be to have an install_docs (or
whatever it'd be named) function in eutils.eclass so that other
eclasses could just call it. This should be identical with the EAPI 4
default, i.e. the second half of _eapi4_src_install() in Portage.
It doesn't make sense to have duplicate code in many eclasses.
> Or bash should be modified to support using space-separated lists as
> arrays because the current behavior is ridiculous.
I would already be happy if there was an easier way to check the type
of a variable than to parse the output of "declare -p". ;-)