Re: [gentoo-dev] [PATCH autotools-utils 1/4] Support installing default docs, similarly to EAPI4.
On Sat, 7 Jan 2012 00:15:50 +0100 Ulrich Mueller u...@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 signature.asc Description: PGP signature
Re: [gentoo-dev] [PATCH autotools-utils 1/4] 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
Re: [gentoo-dev] [PATCH autotools-utils 1/4] Support installing default docs, similarly to EAPI4.
On Sat, 7 Jan 2012 11:05:09 +0100 Ulrich Mueller u...@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 signature.asc Description: PGP signature
Re: [gentoo-dev] [PATCH autotools-utils 1/4] 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 u...@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
Re: [gentoo-dev] [PATCH autotools-utils 1/4] 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