On Mon, 15 Feb 2016 15:41:58 +0100 "Justin Lecher (jlec)" <j...@gentoo.org> wrote:
> On 15/02/16 15:35, Michał Górny wrote: > > On Mon, 15 Feb 2016 14:37:41 +0100 > > "Justin Lecher (jlec)" <j...@gentoo.org> wrote: > > > >> On 15/02/16 13:59, Michał Górny wrote: > >>> On Mon, 15 Feb 2016 09:16:53 +0100 > >>> "Justin Lecher (jlec)" <j...@gentoo.org> wrote: > >>> > >>>> # @ECLASS-VARIABLE: INTEL_SUBDIR > >>>> # @DEFAULT_UNSET > >>>> # @DESCRIPTION: > >>>> # The package sub-directory where it will end-up in /opt/intel > >>>> # To find out its value, you have to do a raw install from the Intel tar > >>>> ball > >>> > >>> To be honest, I find this kinda terrible. There's a huge block of docs > >>> which makes me feel small and confused. Maybe it'd useful to give some > >>> semi-complete example on top (in global doc)? > >> > >> That makes definitely make sense. We will add one. > >> > >> Although nobody other then the maintainer of this eclass will ever use it. > >> > > > > Remember that maintainers can change. It's better to have good then > > have new maintainers figure out all stuff over again. > > > >>>> # e.g. CLI_install/rpm/intel-vtune-amplifier-xe-cli > >>>> : ${INTEL_BIN_RPMS:=()} > >>> > >>> $ : ${foo:=()} > >>> $ declare -p foo > >>> declare -- foo="()" > >>> > >>> In other words, it doesn't work the way you expect it to. > >> > >> I already wondered about this. Is there any way to force a variable to > >> be an array in bash? Or define it as an empty array? > > > > Look at e.g. python-utils-r1. > > > > To check for array: > > > > if [[ $(declare -p foo) != "declare -a"* ]]; then > > ... > > fi > > > > To default to empty, simple (yet a bit imperfect) way: > > > > [[ ${foo[@]} }] || foo=() > > And what about the default assignment for the man page? Have no clue. I think someone mentioned some hack somewhere. Or maybe we could finally fix eclass-manpages script to handle this. > >>> Err, this is not code, you know. > >> > >> This is needed for nice formatting. Otherwise there is no line break > > > > Add an empty line between the two. That should do it correctly, without > > code blocks in devmanual. > > That will introduce an empty line between the two points. Which is quite correct. And in any case, it's definitely not worse than what you're causing now: https://devmanual.gentoo.org/eclass-reference/intel-sdp.eclass/index.html > >>> Wouldn't you be able to collapse that into one loop? > >> > >> no, because the first has ${INTEL_X86}.rpm as suffeix and the later has > >> ${INTEL_X86}.rpm. > > > > Errrrr... am I reading wrong, or did you just type the same thing twice? > > right, it should be ${INTEL_X86}.rpm vs noarch.rpm Well, I think you still could handle this with some extra code and conditionals, at least reduced code duplication. -- Best regards, Michał Górny <http://dev.gentoo.org/~mgorny/>
pgpGHuwi5LopO.pgp
Description: OpenPGP digital signature