public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Ulrich Mueller <ulm@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev]  Re: [RFC] base.eclass
Date: Sun, 3 Jan 2010 11:28:51 +0100	[thread overview]
Message-ID: <19264.29027.852829.477540@a1i15.kph.uni-mainz.de> (raw)
In-Reply-To: <20100103062307.GA13558@boostbox>

>>>>> On Sun, 3 Jan 2010, Harald van Dijk wrote:

>> > 65                 base_src_util $@
>> This is not problem

> Only because you can be sure there will be exactly one word in the
> result, which will not be split. In general, $@ should be quoted, and it
> would be a good idea to either do it here too even though it's not
> strictly necessary, or make the intent clearer and just write

>   base_src_util $1

I think this would not be correct. Note the while loop over parameters
in base_src_util. So it should be "$@" (with quotes).

>> > 90                 case $1 in
>> Yarp this is problem and fixed

> That's not a problem. A case expression is another example where
> quoting is unnecessary; there won't be any word splitting on $1
> anyway.

Right, so you should remove these quotes again.

>> > 95                                 [[ ! -z "${A}" ]] && unpack ${A}
>> ${A} is not used quoted :]

> Right, that doesn't need quoting, and it would even be okay to drop
> the unnecessary quotes in [[.

s/it would even be okay to/you should/

Only cases where you need quotes inside [[ ]] are:
1. whitespace or special characters that must be quoted,
2. suppress pattern matching for the right hand side of an == or !=
   expression.

Ulrich



  reply	other threads:[~2010-01-03 10:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-02 15:52 [gentoo-dev] [RFC] base.eclass Tomáš Chvátal
2010-01-02 16:12 ` Ben de Groot
2010-01-02 16:31   ` Tomáš Chvátal
2010-01-03  0:56 ` [gentoo-dev] " Mark Bateman
2010-01-03  1:56   ` Tomáš Chvátal
2010-01-03  6:23     ` Harald van Dijk
2010-01-03 10:28       ` Ulrich Mueller [this message]
2010-01-03 11:00         ` Harald van Dijk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19264.29027.852829.477540@a1i15.kph.uni-mainz.de \
    --to=ulm@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox