Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Vaeth <vaeth@...>
Subject: Re: Re: Default src_install for EAPI-2 or following EAPI
Date: Sun, 21 Sep 2008 08:18:05 +0200 (CEST)
Steve Long wrote:

> Thomas Sachau wrote: [...]
>
> > [[ -n ${DOCS} ]] && dodoc ${DOCS}
[...]
> 
> It might be wise to use an array for DOCS there

Since I have now seen suggestions for using arrays unnecessarily
at least twice (see also
  [RFC] Ability to pass arguments to src_configure/src_compile
but I am only speaking about the usage of _arrays_ here),
let me remark that the more clever way to this is

  [ -n "${DOCS}" ] && eval "dodoc ${DOCS}"

This way, people can simply quote as they like:

DOCS="'filename with spaces' filename_without_space doc/*"

or also

DOCS="just_one_filename_without_special_characters"

or also - when Push from /usr/bin/functions-eix.sh is used
(which might be implemented simpler without using other functions):

Push DOCS 'filename with spaces' filename_without_space "${S}"/doc/*


Not only has this the advantage that it is POSIX (and thus does not
force ebuilds to use the particular shell "bash" - a policy which perhaps
some day might be changed: It is dangerous to depend on a particular
implementation), the array-less solution is also much simpler to
implement, easy to understand from the source, and clearer in usage.
Case distinctions like

> isArr() [[ $(declare -p "$1" 2>/dev/null) = 'declare -a'* ]]
> if isArr DOCS; then
>    ((${#DOCS[@]})) && dodoc "${DOCS[@]}"
> else [[ $DOCS ]] && dodoc $DOCS
> fi

are just awful.


Replies:
Re: Re: Default src_install for EAPI-2 or following EAPI
-- Alec Warner
Re: Re: Default src_install for EAPI-2 or following EAPI
-- Steve Long
Re: Re: Default src_install for EAPI-2 or following EAPI
-- Thomas Anderson
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Last rites: app-office/ooqstart-gnome and app-office/oooqs
Next by thread:
Re: Re: Default src_install for EAPI-2 or following EAPI
Previous by date:
Re: Making built_with_use die by default with EAPI 2
Next by date:
Re: Default src_install for EAPI-2 or following EAPI


Updated Jun 17, 2009

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.