FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 01-06-2012, 09:06 PM
Michał Górny
 
Default Support installing default docs, similarly to EAPI4.

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=397659
---
eclass/autotools-utils.eclass | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

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
 
Old 01-06-2012, 10:15 PM
Ulrich Mueller
 
Default 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
 
Old 01-07-2012, 08:43 AM
Michał Górny
 
Default 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
 
Old 01-07-2012, 09:05 AM
Ulrich Mueller
 
Default 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
 
Old 01-07-2012, 09:14 AM
Michał Górny
 
Default 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
 
Old 01-07-2012, 09:46 AM
Ulrich Mueller
 
Default 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". ;-)

Ulrich
 

Thread Tools




All times are GMT. The time now is 10:13 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org