RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/db3/ configure

From: Ralf S. Engelschall <rse+rpm-devel@rpm5.org>
Date: Wed 27 Jun 2007 - 23:42:38 CEST
Message-ID: <20070627214238.GA47919@engelschall.com>
On Wed, Jun 27, 2007, Mark Hatle wrote:

> This actually points out a bug I found the other day, but haven't been
> able to figure out how to solve.
>
> Using "echo $*" in this way causes variable or argument expansions that
> include a "space" to fail.
>
> We have a few cases where we need to pass in CFLAGS w/ multiple elements
> or CC='distcc ccache foo-gcc -te500v1'.. which causes a failure to occur.
>
> I replaced the args bit with a simple "$@" in the args list to work
> around the issue.. but I don't know of a way of modifying the arguments
> in the shell and passing them properly quoted.

Well, just "$@" doesn't fully help. It quotes the stuff just for the
echo(1) call itself, but after echo(1) outputs the stuff to stdout
the quotes will be gone anyway. There is only one possibility in
Bourne-Shell: to use a "for" loop to iterate over the arguments and then
re-construct the stuff in a quoted way.

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com
Received on Wed Jun 27 23:43:09 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.