RPM Community Forums

Mailing List Message of <rpm-devel>

Re: db3 configure wrapper

From: Ralf S. Engelschall <rse+rpm-devel@rpm5.org>
Date: Sat 30 Jun 2007 - 00:12:06 CEST
Message-ID: <20070629221206.GA97143@engelschall.com>
On Fri, Jun 29, 2007, Mark Hatle wrote:

> Any objections to the attached change?
> [...]
>
> -ARGS="`echo $* |\
> +# We iterate over the argument list.  Processing the arguments using
> +# echo "$*" can fail with the sed chopping out parts of unrelated
> +# arguments
> +set - "$@" eoa_marker
> +while [ "$1" != "eoa_marker" ]; do
> +   ARG="`echo "$1" | \
>         sed -e 's% [^ ]*CFLAGS=[^ ]*%%' \
>             -e 's% [^ ]*CC=[^ ]*ccache [^ ]*%%' \
>             -e 's% [^ ]*CC=[^ ]*%%' \
> @@ -24,6 +29,11 @@
>             -e 's%--with-db-mutex%%' \
>             -e 's%--without-db-mutex%%' \
>  `"
> +   shift
> +   set - "$@" "$ARG"
> +done
> +shift

I think the nested quoted make a portability trouble. But luckily they
are actually not needed as the result of backticks can be portably
assigned to a variable without extra quotes. So please just use

    ARG=`echo "$1" | sed [...]`

But beside this it looks fine. Go for it!

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com
Received on Sat Jun 30 00:12:41 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.