* [gentoo-dev] RFC: using array variables in qt4-r2.eclass @ 2012-07-13 12:02 Ben de Groot 2012-07-13 12:34 ` Alexis Ballier 0 siblings, 1 reply; 11+ messages in thread From: Ben de Groot @ 2012-07-13 12:02 UTC (permalink / raw To: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 325 bytes --] Hi, We'd like to start using array variables for DOCS and HTML_DOCS in qt4-r2.eclass, as they are already more widely used in other eclasses. Please check the attached diff and let us know what you think. Thanks on behalf of the Qt team! -- Cheers, Ben | yngwin Gentoo developer Gentoo Qt project lead, Gentoo Wiki admin [-- Attachment #2: qt4-r2.eclass.diff --] [-- Type: application/octet-stream, Size: 3114 bytes --] --- /usr/portage/eclass/qt4-r2.eclass 2012-04-20 07:01:13.000000000 +0800 +++ qt4-r2.eclass.new 2012-07-13 19:45:59.259773917 +0800 @@ -19,6 +19,22 @@ export XDG_CONFIG_HOME="${T}" +# @ECLASS-VARIABLE: DOCS +# @DEFAULT_UNSET +# @DESCRIPTION: +# Array containing documents passed to dodoc command. +# Paths can be absolute or relative to ${S}. +# +# Example: DOCS=( ChangeLog README "${WORKDIR}/doc_folder/" ) + +# @ECLASS-VARIABLE: HTML_DOCS +# @DEFAULT_UNSET +# @DESCRIPTION: +# Array containing documents passed to dohtml command. +# Paths can be absolute or relative to ${S}. +# +# Example: HTML_DOCS=( "doc/document.html" "${WORKDIR}/html_folder/" ) + # @ECLASS-VARIABLE: LANGS # @DEFAULT_UNSET # @DESCRIPTION: @@ -44,6 +60,21 @@ done unset x +# @ECLASS-VARIABLE: PATCHES +# @DEFAULT_UNSET +# @DESCRIPTION: +# Array variable containing all the patches to be applied. This variable +# is expected to be defined in the global scope of ebuilds. Make sure to +# specify the full path. This variable is used in src_prepare phase. +# +# Example: +# @CODE +# PATCHES=( +# "${FILESDIR}/mypatch.patch" +# "${FILESDIR}/mypatch2.patch" +# ) +# @CODE + # @FUNCTION: qt4-r2_src_unpack # @DESCRIPTION: # Default src_unpack function for packages that depend on qt4. If you have to @@ -55,17 +86,6 @@ base_src_unpack "$@" } -# @ECLASS-VARIABLE: PATCHES -# @DEFAULT_UNSET -# @DESCRIPTION: -# In case you have patches to apply, specify them here. Make sure to -# specify the full path. This variable is used in src_prepare phase. -# Example: -# @CODE -# PATCHES=( "${FILESDIR}"/mypatch.patch -# "${FILESDIR}"/mypatch2.patch ) -# @CODE - # @FUNCTION: qt4-r2_src_prepare # @DESCRIPTION: # Default src_prepare function for packages that depend on qt4. If you have to @@ -104,33 +124,23 @@ base_src_compile "$@" } -# @ECLASS-VARIABLE: DOCS -# @DEFAULT_UNSET -# @DESCRIPTION: -# Use this variable if you want to install any documentation. -# Example: -# @CODE -# DOCS="README AUTHORS" -# @CODE - -# @ECLASS-VARIABLE: DOCSDIR -# @DESCRIPTION: -# Directory containing documentation, defaults to ${S}. - # @FUNCTION: qt4-r2_src_install # @DESCRIPTION: # Default src_install function for qt4-based packages. Installs compiled code -# and misc documentation (via DOCS variable). +# documentation (via DOCS and HTML_DOCS variables). + qt4-r2_src_install() { debug-print-function $FUNCNAME "$@" - emake INSTALL_ROOT="${D}" DESTDIR="${D}" install || die "emake install failed" + base_src_install INSTALL_ROOT="${D}" "$@" - # install documentation - local doc= dir=${DOCSDIR:-${S}} - for doc in ${DOCS}; do - dodoc "${dir}/${doc}" || die "dodoc failed" - done + # backward compatibility for non-array variables + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then + dodoc ${DOCS} || die "dodoc failed" + fi + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then + dohtml -r ${HTML_DOCS} || die "dohtml failed" + fi } # Internal function, used by eqmake4 and qt4-r2_src_configure ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass 2012-07-13 12:02 [gentoo-dev] RFC: using array variables in qt4-r2.eclass Ben de Groot @ 2012-07-13 12:34 ` Alexis Ballier 2012-07-13 13:26 ` Davide Pesavento 0 siblings, 1 reply; 11+ messages in thread From: Alexis Ballier @ 2012-07-13 12:34 UTC (permalink / raw To: gentoo-dev On Fri, 13 Jul 2012 20:02:19 +0800 Ben de Groot <yngwin@gentoo.org> wrote: > --- /usr/portage/eclass/qt4-r2.eclass 2012-04-20 > 07:01:13.000000000 +0800 +++ qt4-r2.eclass.new 2012-07-13 > 19:45:59.259773917 +0800 @@ -19,6 +19,22 @@ > > export XDG_CONFIG_HOME="${T}" > > +# @ECLASS-VARIABLE: DOCS > +# @DEFAULT_UNSET > +# @DESCRIPTION: > +# Array containing documents passed to dodoc command. > +# Paths can be absolute or relative to ${S}. > +# > +# Example: DOCS=( ChangeLog README "${WORKDIR}/doc_folder/" ) > + > +# @ECLASS-VARIABLE: HTML_DOCS > +# @DEFAULT_UNSET > +# @DESCRIPTION: > +# Array containing documents passed to dohtml command. > +# Paths can be absolute or relative to ${S}. > +# > +# Example: HTML_DOCS=( "doc/document.html" "${WORKDIR}/html_folder/" > ) + > # @ECLASS-VARIABLE: LANGS > # @DEFAULT_UNSET > # @DESCRIPTION: > @@ -44,6 +60,21 @@ > done > unset x > > +# @ECLASS-VARIABLE: PATCHES > +# @DEFAULT_UNSET > +# @DESCRIPTION: > +# Array variable containing all the patches to be applied. This > variable +# is expected to be defined in the global scope of ebuilds. > Make sure to +# specify the full path. This variable is used in > src_prepare phase. +# > +# Example: > +# @CODE > +# PATCHES=( > +# "${FILESDIR}/mypatch.patch" > +# "${FILESDIR}/mypatch2.patch" > +# ) > +# @CODE > + this sounds like re-ordering and improving comments, no functional change, right ? [...] > + # backward compatibility for non-array variables > + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS 2>/dev/null > 2>&1)" != "declare -a"* ]]; then > + dodoc ${DOCS} || die "dodoc failed" > + fi > + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS > 2>/dev/null 2>&1)" != "declare -a"* ]]; then > + dohtml -r ${HTML_DOCS} || die "dohtml failed" > + fi > } maybe issue an eqawarn in that case telling people to convert to arrays; some time later make this an ewarn telling non-array support will be removed and again later make this a die :) (if you take that route i would expect you to start converting packages to use arrays) +1 for the whole thing btw A. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass 2012-07-13 12:34 ` Alexis Ballier @ 2012-07-13 13:26 ` Davide Pesavento 2012-07-13 13:50 ` Alexis Ballier 0 siblings, 1 reply; 11+ messages in thread From: Davide Pesavento @ 2012-07-13 13:26 UTC (permalink / raw To: gentoo-dev On Fri, Jul 13, 2012 at 2:34 PM, Alexis Ballier <aballier@gentoo.org> wrote: > On Fri, 13 Jul 2012 20:02:19 +0800 > Ben de Groot <yngwin@gentoo.org> wrote: > >> --- /usr/portage/eclass/qt4-r2.eclass 2012-04-20 >> 07:01:13.000000000 +0800 +++ qt4-r2.eclass.new 2012-07-13 >> 19:45:59.259773917 +0800 @@ -19,6 +19,22 @@ >> >> export XDG_CONFIG_HOME="${T}" >> >> +# @ECLASS-VARIABLE: DOCS >> +# @DEFAULT_UNSET >> +# @DESCRIPTION: >> +# Array containing documents passed to dodoc command. >> +# Paths can be absolute or relative to ${S}. >> +# >> +# Example: DOCS=( ChangeLog README "${WORKDIR}/doc_folder/" ) >> + >> +# @ECLASS-VARIABLE: HTML_DOCS >> +# @DEFAULT_UNSET >> +# @DESCRIPTION: >> +# Array containing documents passed to dohtml command. >> +# Paths can be absolute or relative to ${S}. >> +# >> +# Example: HTML_DOCS=( "doc/document.html" "${WORKDIR}/html_folder/" >> ) + >> # @ECLASS-VARIABLE: LANGS >> # @DEFAULT_UNSET >> # @DESCRIPTION: >> @@ -44,6 +60,21 @@ >> done >> unset x >> >> +# @ECLASS-VARIABLE: PATCHES >> +# @DEFAULT_UNSET >> +# @DESCRIPTION: >> +# Array variable containing all the patches to be applied. This >> variable +# is expected to be defined in the global scope of ebuilds. >> Make sure to +# specify the full path. This variable is used in >> src_prepare phase. +# >> +# Example: >> +# @CODE >> +# PATCHES=( >> +# "${FILESDIR}/mypatch.patch" >> +# "${FILESDIR}/mypatch2.patch" >> +# ) >> +# @CODE >> + > > this sounds like re-ordering and improving comments, no functional > change, right ? > Correct, no functional changes in this hunk. > [...] >> + # backward compatibility for non-array variables >> + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS 2>/dev/null >> 2>&1)" != "declare -a"* ]]; then >> + dodoc ${DOCS} || die "dodoc failed" >> + fi >> + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS >> 2>/dev/null 2>&1)" != "declare -a"* ]]; then >> + dohtml -r ${HTML_DOCS} || die "dohtml failed" >> + fi >> } > > maybe issue an eqawarn in that case telling people to convert to > arrays; some time later make this an ewarn telling non-array support > will be removed and again later make this a die :) > (if you take that route i would expect you to start converting packages > to use arrays) > We have no intention of deprecating non-array variables in qt4-r2 eclass. > > +1 for the whole thing btw > > A. > Thanks, Pesa ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass 2012-07-13 13:26 ` Davide Pesavento @ 2012-07-13 13:50 ` Alexis Ballier 2012-07-14 10:29 ` Davide Pesavento 0 siblings, 1 reply; 11+ messages in thread From: Alexis Ballier @ 2012-07-13 13:50 UTC (permalink / raw To: gentoo-dev On Fri, 13 Jul 2012 15:26:58 +0200 Davide Pesavento <pesa@gentoo.org> wrote: > > [...] > >> + # backward compatibility for non-array variables > >> + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS 2>/dev/null > >> 2>&1)" != "declare -a"* ]]; then > >> + dodoc ${DOCS} || die "dodoc failed" > >> + fi > >> + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS > >> 2>/dev/null 2>&1)" != "declare -a"* ]]; then > >> + dohtml -r ${HTML_DOCS} || die "dohtml failed" > >> + fi > >> } > > > > maybe issue an eqawarn in that case telling people to convert to > > arrays; some time later make this an ewarn telling non-array support > > will be removed and again later make this a die :) > > (if you take that route i would expect you to start converting > > packages to use arrays) > > > > We have no intention of deprecating non-array variables in qt4-r2 > eclass. why ? having two codepaths for the same thing, one being inferior, sounds like a good reason to deprecate the inferior one :) A. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass 2012-07-13 13:50 ` Alexis Ballier @ 2012-07-14 10:29 ` Davide Pesavento 2012-07-14 14:00 ` Michał Górny 0 siblings, 1 reply; 11+ messages in thread From: Davide Pesavento @ 2012-07-14 10:29 UTC (permalink / raw To: gentoo-dev On Fri, Jul 13, 2012 at 3:50 PM, Alexis Ballier <aballier@gentoo.org> wrote: > On Fri, 13 Jul 2012 15:26:58 +0200 > Davide Pesavento <pesa@gentoo.org> wrote: > >> > [...] >> >> + # backward compatibility for non-array variables >> >> + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS 2>/dev/null >> >> 2>&1)" != "declare -a"* ]]; then >> >> + dodoc ${DOCS} || die "dodoc failed" >> >> + fi >> >> + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS >> >> 2>/dev/null 2>&1)" != "declare -a"* ]]; then >> >> + dohtml -r ${HTML_DOCS} || die "dohtml failed" >> >> + fi >> >> } >> > >> > maybe issue an eqawarn in that case telling people to convert to >> > arrays; some time later make this an ewarn telling non-array support >> > will be removed and again later make this a die :) >> > (if you take that route i would expect you to start converting >> > packages to use arrays) >> > >> >> We have no intention of deprecating non-array variables in qt4-r2 >> eclass. > > why ? having two codepaths for the same thing, one being inferior, > sounds like a good reason to deprecate the inferior one :) > > A. > Maintaining these two codepaths has practically zero cost, while forcing every ebuild using qt4-r2 to switch to arrays would waste developers' time which is better spent elsewhere. Furthermore, the non-array variant is not necessarily inferior, because it allows you to use bash globbing, brace expansion, etc... Thanks, Pesa ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass 2012-07-14 10:29 ` Davide Pesavento @ 2012-07-14 14:00 ` Michał Górny 2012-07-15 11:00 ` Davide Pesavento 0 siblings, 1 reply; 11+ messages in thread From: Michał Górny @ 2012-07-14 14:00 UTC (permalink / raw To: gentoo-dev; +Cc: pesa [-- Attachment #1: Type: text/plain, Size: 1748 bytes --] On Sat, 14 Jul 2012 12:29:59 +0200 Davide Pesavento <pesa@gentoo.org> wrote: > On Fri, Jul 13, 2012 at 3:50 PM, Alexis Ballier <aballier@gentoo.org> > wrote: > > On Fri, 13 Jul 2012 15:26:58 +0200 > > Davide Pesavento <pesa@gentoo.org> wrote: > > > >> > [...] > >> >> + # backward compatibility for non-array variables > >> >> + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS 2>/dev/null > >> >> 2>&1)" != "declare -a"* ]]; then > >> >> + dodoc ${DOCS} || die "dodoc failed" > >> >> + fi > >> >> + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS > >> >> 2>/dev/null 2>&1)" != "declare -a"* ]]; then > >> >> + dohtml -r ${HTML_DOCS} || die "dohtml failed" > >> >> + fi > >> >> } > >> > > >> > maybe issue an eqawarn in that case telling people to convert to > >> > arrays; some time later make this an ewarn telling non-array > >> > support will be removed and again later make this a die :) > >> > (if you take that route i would expect you to start converting > >> > packages to use arrays) > >> > > >> > >> We have no intention of deprecating non-array variables in qt4-r2 > >> eclass. > > > > why ? having two codepaths for the same thing, one being inferior, > > sounds like a good reason to deprecate the inferior one :) > > > > A. > > > > Maintaining these two codepaths has practically zero cost, while > forcing every ebuild using qt4-r2 to switch to arrays would waste > developers' time which is better spent elsewhere. > > Furthermore, the non-array variant is not necessarily inferior, > because it allows you to use bash globbing, brace expansion, etc... And arrays stopped to allow that overnight? -- Best regards, Michał Górny [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 316 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass 2012-07-14 14:00 ` Michał Górny @ 2012-07-15 11:00 ` Davide Pesavento 2012-07-15 13:42 ` Michał Górny 0 siblings, 1 reply; 11+ messages in thread From: Davide Pesavento @ 2012-07-15 11:00 UTC (permalink / raw To: Michał Górny; +Cc: gentoo-dev On Sat, Jul 14, 2012 at 4:00 PM, Michał Górny <mgorny@gentoo.org> wrote: > On Sat, 14 Jul 2012 12:29:59 +0200 > Davide Pesavento <pesa@gentoo.org> wrote: > >> On Fri, Jul 13, 2012 at 3:50 PM, Alexis Ballier <aballier@gentoo.org> >> wrote: >> > On Fri, 13 Jul 2012 15:26:58 +0200 >> > Davide Pesavento <pesa@gentoo.org> wrote: >> > >> >> > [...] >> >> >> + # backward compatibility for non-array variables >> >> >> + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS 2>/dev/null >> >> >> 2>&1)" != "declare -a"* ]]; then >> >> >> + dodoc ${DOCS} || die "dodoc failed" >> >> >> + fi >> >> >> + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS >> >> >> 2>/dev/null 2>&1)" != "declare -a"* ]]; then >> >> >> + dohtml -r ${HTML_DOCS} || die "dohtml failed" >> >> >> + fi >> >> >> } >> >> > >> >> > maybe issue an eqawarn in that case telling people to convert to >> >> > arrays; some time later make this an ewarn telling non-array >> >> > support will be removed and again later make this a die :) >> >> > (if you take that route i would expect you to start converting >> >> > packages to use arrays) >> >> > >> >> >> >> We have no intention of deprecating non-array variables in qt4-r2 >> >> eclass. >> > >> > why ? having two codepaths for the same thing, one being inferior, >> > sounds like a good reason to deprecate the inferior one :) >> > >> > A. >> > >> >> Maintaining these two codepaths has practically zero cost, while >> forcing every ebuild using qt4-r2 to switch to arrays would waste >> developers' time which is better spent elsewhere. >> >> Furthermore, the non-array variant is not necessarily inferior, >> because it allows you to use bash globbing, brace expansion, etc... > > And arrays stopped to allow that overnight? > I mean that the following won't work as you might expect: DOCS=("*.txt") Thanks, Pesa ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass 2012-07-15 11:00 ` Davide Pesavento @ 2012-07-15 13:42 ` Michał Górny 2012-07-15 15:36 ` Davide Pesavento 0 siblings, 1 reply; 11+ messages in thread From: Michał Górny @ 2012-07-15 13:42 UTC (permalink / raw To: gentoo-dev; +Cc: pesa [-- Attachment #1: Type: text/plain, Size: 2229 bytes --] On Sun, 15 Jul 2012 13:00:47 +0200 Davide Pesavento <pesa@gentoo.org> wrote: > On Sat, Jul 14, 2012 at 4:00 PM, Michał Górny <mgorny@gentoo.org> > wrote: > > On Sat, 14 Jul 2012 12:29:59 +0200 > > Davide Pesavento <pesa@gentoo.org> wrote: > > > >> On Fri, Jul 13, 2012 at 3:50 PM, Alexis Ballier > >> <aballier@gentoo.org> wrote: > >> > On Fri, 13 Jul 2012 15:26:58 +0200 > >> > Davide Pesavento <pesa@gentoo.org> wrote: > >> > > >> >> > [...] > >> >> >> + # backward compatibility for non-array variables > >> >> >> + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS > >> >> >> 2>/dev/null > >> >> >> 2>&1)" != "declare -a"* ]]; then > >> >> >> + dodoc ${DOCS} || die "dodoc failed" > >> >> >> + fi > >> >> >> + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS > >> >> >> 2>/dev/null 2>&1)" != "declare -a"* ]]; then > >> >> >> + dohtml -r ${HTML_DOCS} || die "dohtml failed" > >> >> >> + fi > >> >> >> } > >> >> > > >> >> > maybe issue an eqawarn in that case telling people to convert > >> >> > to arrays; some time later make this an ewarn telling > >> >> > non-array support will be removed and again later make this a > >> >> > die :) (if you take that route i would expect you to start > >> >> > converting packages to use arrays) > >> >> > > >> >> > >> >> We have no intention of deprecating non-array variables in > >> >> qt4-r2 eclass. > >> > > >> > why ? having two codepaths for the same thing, one being > >> > inferior, sounds like a good reason to deprecate the inferior > >> > one :) > >> > > >> > A. > >> > > >> > >> Maintaining these two codepaths has practically zero cost, while > >> forcing every ebuild using qt4-r2 to switch to arrays would waste > >> developers' time which is better spent elsewhere. > >> > >> Furthermore, the non-array variant is not necessarily inferior, > >> because it allows you to use bash globbing, brace expansion, etc... > > > > And arrays stopped to allow that overnight? > > > > I mean that the following won't work as you might expect: > > DOCS=("*.txt") I doubt anyone would expect quoted string to be evaluated as glob. -- Best regards, Michał Górny [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 316 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass 2012-07-15 13:42 ` Michał Górny @ 2012-07-15 15:36 ` Davide Pesavento 2012-07-15 15:53 ` Michał Górny 0 siblings, 1 reply; 11+ messages in thread From: Davide Pesavento @ 2012-07-15 15:36 UTC (permalink / raw To: Michał Górny; +Cc: gentoo-dev On Sun, Jul 15, 2012 at 3:42 PM, Michał Górny <mgorny@gentoo.org> wrote: > On Sun, 15 Jul 2012 13:00:47 +0200 > Davide Pesavento <pesa@gentoo.org> wrote: > >> On Sat, Jul 14, 2012 at 4:00 PM, Michał Górny <mgorny@gentoo.org> >> wrote: >> > On Sat, 14 Jul 2012 12:29:59 +0200 >> > Davide Pesavento <pesa@gentoo.org> wrote: >> > >> >> On Fri, Jul 13, 2012 at 3:50 PM, Alexis Ballier >> >> <aballier@gentoo.org> wrote: >> >> > On Fri, 13 Jul 2012 15:26:58 +0200 >> >> > Davide Pesavento <pesa@gentoo.org> wrote: >> >> > >> >> >> > [...] >> >> >> >> + # backward compatibility for non-array variables >> >> >> >> + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS >> >> >> >> 2>/dev/null >> >> >> >> 2>&1)" != "declare -a"* ]]; then >> >> >> >> + dodoc ${DOCS} || die "dodoc failed" >> >> >> >> + fi >> >> >> >> + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS >> >> >> >> 2>/dev/null 2>&1)" != "declare -a"* ]]; then >> >> >> >> + dohtml -r ${HTML_DOCS} || die "dohtml failed" >> >> >> >> + fi >> >> >> >> } >> >> >> > >> >> >> > maybe issue an eqawarn in that case telling people to convert >> >> >> > to arrays; some time later make this an ewarn telling >> >> >> > non-array support will be removed and again later make this a >> >> >> > die :) (if you take that route i would expect you to start >> >> >> > converting packages to use arrays) >> >> >> > >> >> >> >> >> >> We have no intention of deprecating non-array variables in >> >> >> qt4-r2 eclass. >> >> > >> >> > why ? having two codepaths for the same thing, one being >> >> > inferior, sounds like a good reason to deprecate the inferior >> >> > one :) >> >> > >> >> > A. >> >> > >> >> >> >> Maintaining these two codepaths has practically zero cost, while >> >> forcing every ebuild using qt4-r2 to switch to arrays would waste >> >> developers' time which is better spent elsewhere. >> >> >> >> Furthermore, the non-array variant is not necessarily inferior, >> >> because it allows you to use bash globbing, brace expansion, etc... >> > >> > And arrays stopped to allow that overnight? >> > >> >> I mean that the following won't work as you might expect: >> >> DOCS=("*.txt") > > I doubt anyone would expect quoted string to be evaluated as glob. > It depends on when the expansion is performed, although in the base.eclass case, DOCS=(*.txt) doesn't work either, because the quoting happens inside the eclass function. Anyway, I was just explaining why I argued that "the non-array variant is not necessarily inferior". Using DOCS="*.txt" is actually a supported use case and a valid reason not to deprecate non-array variables. Regards, Pesa ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass 2012-07-15 15:36 ` Davide Pesavento @ 2012-07-15 15:53 ` Michał Górny 2012-07-15 16:15 ` Davide Pesavento 0 siblings, 1 reply; 11+ messages in thread From: Michał Górny @ 2012-07-15 15:53 UTC (permalink / raw To: gentoo-dev; +Cc: pesa [-- Attachment #1: Type: text/plain, Size: 3141 bytes --] On Sun, 15 Jul 2012 17:36:05 +0200 Davide Pesavento <pesa@gentoo.org> wrote: > On Sun, Jul 15, 2012 at 3:42 PM, Michał Górny <mgorny@gentoo.org> > wrote: > > On Sun, 15 Jul 2012 13:00:47 +0200 > > Davide Pesavento <pesa@gentoo.org> wrote: > > > >> On Sat, Jul 14, 2012 at 4:00 PM, Michał Górny <mgorny@gentoo.org> > >> wrote: > >> > On Sat, 14 Jul 2012 12:29:59 +0200 > >> > Davide Pesavento <pesa@gentoo.org> wrote: > >> > > >> >> On Fri, Jul 13, 2012 at 3:50 PM, Alexis Ballier > >> >> <aballier@gentoo.org> wrote: > >> >> > On Fri, 13 Jul 2012 15:26:58 +0200 > >> >> > Davide Pesavento <pesa@gentoo.org> wrote: > >> >> > > >> >> >> > [...] > >> >> >> >> + # backward compatibility for non-array variables > >> >> >> >> + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS > >> >> >> >> 2>/dev/null > >> >> >> >> 2>&1)" != "declare -a"* ]]; then > >> >> >> >> + dodoc ${DOCS} || die "dodoc failed" > >> >> >> >> + fi > >> >> >> >> + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p > >> >> >> >> HTML_DOCS > >> >> >> >> 2>/dev/null 2>&1)" != "declare -a"* ]]; then > >> >> >> >> + dohtml -r ${HTML_DOCS} || die "dohtml > >> >> >> >> failed" > >> >> >> >> + fi > >> >> >> >> } > >> >> >> > > >> >> >> > maybe issue an eqawarn in that case telling people to > >> >> >> > convert to arrays; some time later make this an ewarn > >> >> >> > telling non-array support will be removed and again later > >> >> >> > make this a die :) (if you take that route i would expect > >> >> >> > you to start converting packages to use arrays) > >> >> >> > > >> >> >> > >> >> >> We have no intention of deprecating non-array variables in > >> >> >> qt4-r2 eclass. > >> >> > > >> >> > why ? having two codepaths for the same thing, one being > >> >> > inferior, sounds like a good reason to deprecate the inferior > >> >> > one :) > >> >> > > >> >> > A. > >> >> > > >> >> > >> >> Maintaining these two codepaths has practically zero cost, while > >> >> forcing every ebuild using qt4-r2 to switch to arrays would > >> >> waste developers' time which is better spent elsewhere. > >> >> > >> >> Furthermore, the non-array variant is not necessarily inferior, > >> >> because it allows you to use bash globbing, brace expansion, > >> >> etc... > >> > > >> > And arrays stopped to allow that overnight? > >> > > >> > >> I mean that the following won't work as you might expect: > >> > >> DOCS=("*.txt") > > > > I doubt anyone would expect quoted string to be evaluated as glob. > > > > It depends on when the expansion is performed, although in the > base.eclass case, DOCS=(*.txt) doesn't work either, because the > quoting happens inside the eclass function. > > Anyway, I was just explaining why I argued that "the non-array variant > is not necessarily inferior". Using DOCS="*.txt" is actually a > supported use case and a valid reason not to deprecate non-array > variables. So, you're saying that you're going to support two different variants of the variable which work two different ways? -- Best regards, Michał Górny [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 316 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass 2012-07-15 15:53 ` Michał Górny @ 2012-07-15 16:15 ` Davide Pesavento 0 siblings, 0 replies; 11+ messages in thread From: Davide Pesavento @ 2012-07-15 16:15 UTC (permalink / raw To: Michał Górny; +Cc: gentoo-dev On Sun, Jul 15, 2012 at 5:53 PM, Michał Górny <mgorny@gentoo.org> wrote: > On Sun, 15 Jul 2012 17:36:05 +0200 > Davide Pesavento <pesa@gentoo.org> wrote: > >> On Sun, Jul 15, 2012 at 3:42 PM, Michał Górny <mgorny@gentoo.org> >> wrote: >> > On Sun, 15 Jul 2012 13:00:47 +0200 >> > Davide Pesavento <pesa@gentoo.org> wrote: >> > >> >> On Sat, Jul 14, 2012 at 4:00 PM, Michał Górny <mgorny@gentoo.org> >> >> wrote: >> >> > On Sat, 14 Jul 2012 12:29:59 +0200 >> >> > Davide Pesavento <pesa@gentoo.org> wrote: >> >> > >> >> >> On Fri, Jul 13, 2012 at 3:50 PM, Alexis Ballier >> >> >> <aballier@gentoo.org> wrote: >> >> >> > On Fri, 13 Jul 2012 15:26:58 +0200 >> >> >> > Davide Pesavento <pesa@gentoo.org> wrote: >> >> >> > >> >> >> >> > [...] >> >> >> >> >> + # backward compatibility for non-array variables >> >> >> >> >> + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS >> >> >> >> >> 2>/dev/null >> >> >> >> >> 2>&1)" != "declare -a"* ]]; then >> >> >> >> >> + dodoc ${DOCS} || die "dodoc failed" >> >> >> >> >> + fi >> >> >> >> >> + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p >> >> >> >> >> HTML_DOCS >> >> >> >> >> 2>/dev/null 2>&1)" != "declare -a"* ]]; then >> >> >> >> >> + dohtml -r ${HTML_DOCS} || die "dohtml >> >> >> >> >> failed" >> >> >> >> >> + fi >> >> >> >> >> } >> >> >> >> > >> >> >> >> > maybe issue an eqawarn in that case telling people to >> >> >> >> > convert to arrays; some time later make this an ewarn >> >> >> >> > telling non-array support will be removed and again later >> >> >> >> > make this a die :) (if you take that route i would expect >> >> >> >> > you to start converting packages to use arrays) >> >> >> >> > >> >> >> >> >> >> >> >> We have no intention of deprecating non-array variables in >> >> >> >> qt4-r2 eclass. >> >> >> > >> >> >> > why ? having two codepaths for the same thing, one being >> >> >> > inferior, sounds like a good reason to deprecate the inferior >> >> >> > one :) >> >> >> > >> >> >> > A. >> >> >> > >> >> >> >> >> >> Maintaining these two codepaths has practically zero cost, while >> >> >> forcing every ebuild using qt4-r2 to switch to arrays would >> >> >> waste developers' time which is better spent elsewhere. >> >> >> >> >> >> Furthermore, the non-array variant is not necessarily inferior, >> >> >> because it allows you to use bash globbing, brace expansion, >> >> >> etc... >> >> > >> >> > And arrays stopped to allow that overnight? >> >> > >> >> >> >> I mean that the following won't work as you might expect: >> >> >> >> DOCS=("*.txt") >> > >> > I doubt anyone would expect quoted string to be evaluated as glob. >> > >> >> It depends on when the expansion is performed, although in the >> base.eclass case, DOCS=(*.txt) doesn't work either, because the >> quoting happens inside the eclass function. >> >> Anyway, I was just explaining why I argued that "the non-array variant >> is not necessarily inferior". Using DOCS="*.txt" is actually a >> supported use case and a valid reason not to deprecate non-array >> variables. > > So, you're saying that you're going to support two different variants > of the variable which work two different ways? > Basically yes. As yngwin said, we're introducing support for array variables to be more in line with other eclasses. People do expect DOCS to be an array variable, and I've already been asked a few times for this kind of support. Thanks, Pesa ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2012-07-15 16:16 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-07-13 12:02 [gentoo-dev] RFC: using array variables in qt4-r2.eclass Ben de Groot 2012-07-13 12:34 ` Alexis Ballier 2012-07-13 13:26 ` Davide Pesavento 2012-07-13 13:50 ` Alexis Ballier 2012-07-14 10:29 ` Davide Pesavento 2012-07-14 14:00 ` Michał Górny 2012-07-15 11:00 ` Davide Pesavento 2012-07-15 13:42 ` Michał Górny 2012-07-15 15:36 ` Davide Pesavento 2012-07-15 15:53 ` Michał Górny 2012-07-15 16:15 ` Davide Pesavento
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox