* [Qemu-devel] patch: configure: nonstandard use of `expr'
@ 2006-04-27 19:01 Juergen Lock
2006-04-27 21:57 ` Jamie Lokier
0 siblings, 1 reply; 3+ messages in thread
From: Juergen Lock @ 2006-04-27 19:01 UTC (permalink / raw)
To: qemu-devel
At least FreeBSD's expr(1) doesnt understand the syntax now used in
configure:
Index: qemu/configure
@@ -157,7 +157,7 @@
fi
for opt do
- optarg=`expr "$opt" : '[^=]*=\(.*\)'`
+ optarg=`echo "$opt" |sed 's/^[^=]*=//'`
case "$opt" in
--help|-h) show_help=yes
;;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] patch: configure: nonstandard use of `expr'
2006-04-27 19:01 [Qemu-devel] patch: configure: nonstandard use of `expr' Juergen Lock
@ 2006-04-27 21:57 ` Jamie Lokier
2006-04-27 22:50 ` Juergen Lock
0 siblings, 1 reply; 3+ messages in thread
From: Jamie Lokier @ 2006-04-27 21:57 UTC (permalink / raw)
To: qemu-devel
Juergen Lock wrote:
> At least FreeBSD's expr(1) doesnt understand the syntax now used in
> configure:
>
> Index: qemu/configure
> @@ -157,7 +157,7 @@
> fi
>
> for opt do
> - optarg=`expr "$opt" : '[^=]*=\(.*\)'`
> + optarg=`echo "$opt" |sed 's/^[^=]*=//'`
> case "$opt" in
> --help|-h) show_help=yes
> ;;
The GNU Autoconf manual, and its code, recommends something like this
(note the "x" prefix):
optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
Your echo version suffers from non-portable results when opt matches "-n*",
"-e*", "-E*", or something with a backslash in.
-- Jamie
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] patch: configure: nonstandard use of `expr'
2006-04-27 21:57 ` Jamie Lokier
@ 2006-04-27 22:50 ` Juergen Lock
0 siblings, 0 replies; 3+ messages in thread
From: Juergen Lock @ 2006-04-27 22:50 UTC (permalink / raw)
To: jamie; +Cc: qemu-devel
In article <20060427215722.GA21384@mail.shareable.org> you write:
>Juergen Lock wrote:
>> At least FreeBSD's expr(1) doesnt understand the syntax now used in
>> configure:
>>
>> Index: qemu/configure
>> @@ -157,7 +157,7 @@
>> fi
>>
>> for opt do
>> - optarg=`expr "$opt" : '[^=]*=\(.*\)'`
>> + optarg=`echo "$opt" |sed 's/^[^=]*=//'`
>> case "$opt" in
>> --help|-h) show_help=yes
>> ;;
>
>The GNU Autoconf manual, and its code, recommends something like this
>(note the "x" prefix):
>
> optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
>
>Your echo version suffers from non-portable results when opt matches "-n*",
>"-e*", "-E*", or something with a backslash in.
Oh, indeed. Better version:
Index: qemu/configure
@@ -157,7 +157,7 @@
fi
for opt do
- optarg=`expr "$opt" : '[^=]*=\(.*\)'`
+ optarg=`echo "x$opt" |sed 's/^[^=]*=//'`
case "$opt" in
--help|-h) show_help=yes
;;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-04-27 22:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-27 19:01 [Qemu-devel] patch: configure: nonstandard use of `expr' Juergen Lock
2006-04-27 21:57 ` Jamie Lokier
2006-04-27 22:50 ` Juergen Lock
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.