Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass
Date: Fri, 13 Jul 2012 12:37:10
Message-Id: 20120713083456.61c78c04@gentoo.org
In Reply to: [gentoo-dev] RFC: using array variables in qt4-r2.eclass by Ben de Groot
1 On Fri, 13 Jul 2012 20:02:19 +0800
2 Ben de Groot <yngwin@g.o> wrote:
3
4 > --- /usr/portage/eclass/qt4-r2.eclass 2012-04-20
5 > 07:01:13.000000000 +0800 +++ qt4-r2.eclass.new 2012-07-13
6 > 19:45:59.259773917 +0800 @@ -19,6 +19,22 @@
7 >
8 > export XDG_CONFIG_HOME="${T}"
9 >
10 > +# @ECLASS-VARIABLE: DOCS
11 > +# @DEFAULT_UNSET
12 > +# @DESCRIPTION:
13 > +# Array containing documents passed to dodoc command.
14 > +# Paths can be absolute or relative to ${S}.
15 > +#
16 > +# Example: DOCS=( ChangeLog README "${WORKDIR}/doc_folder/" )
17 > +
18 > +# @ECLASS-VARIABLE: HTML_DOCS
19 > +# @DEFAULT_UNSET
20 > +# @DESCRIPTION:
21 > +# Array containing documents passed to dohtml command.
22 > +# Paths can be absolute or relative to ${S}.
23 > +#
24 > +# Example: HTML_DOCS=( "doc/document.html" "${WORKDIR}/html_folder/"
25 > ) +
26 > # @ECLASS-VARIABLE: LANGS
27 > # @DEFAULT_UNSET
28 > # @DESCRIPTION:
29 > @@ -44,6 +60,21 @@
30 > done
31 > unset x
32 >
33 > +# @ECLASS-VARIABLE: PATCHES
34 > +# @DEFAULT_UNSET
35 > +# @DESCRIPTION:
36 > +# Array variable containing all the patches to be applied. This
37 > variable +# is expected to be defined in the global scope of ebuilds.
38 > Make sure to +# specify the full path. This variable is used in
39 > src_prepare phase. +#
40 > +# Example:
41 > +# @CODE
42 > +# PATCHES=(
43 > +# "${FILESDIR}/mypatch.patch"
44 > +# "${FILESDIR}/mypatch2.patch"
45 > +# )
46 > +# @CODE
47 > +
48
49 this sounds like re-ordering and improving comments, no functional
50 change, right ?
51
52 [...]
53 > + # backward compatibility for non-array variables
54 > + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS 2>/dev/null
55 > 2>&1)" != "declare -a"* ]]; then
56 > + dodoc ${DOCS} || die "dodoc failed"
57 > + fi
58 > + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS
59 > 2>/dev/null 2>&1)" != "declare -a"* ]]; then
60 > + dohtml -r ${HTML_DOCS} || die "dohtml failed"
61 > + fi
62 > }
63
64 maybe issue an eqawarn in that case telling people to convert to
65 arrays; some time later make this an ewarn telling non-array support
66 will be removed and again later make this a die :)
67 (if you take that route i would expect you to start converting packages
68 to use arrays)
69
70
71 +1 for the whole thing btw
72
73 A.

Replies

Subject Author
Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass Davide Pesavento <pesa@g.o>