From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9513 invoked by alias); 29 Mar 2006 00:28:13 -0000 Received: (qmail 9502 invoked by uid 22791); 29 Mar 2006 00:28:12 -0000 X-Spam-Check-By: sourceware.org Received: from miranda.se.axis.com (HELO miranda.se.axis.com) (193.13.178.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 29 Mar 2006 00:28:11 +0000 Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.83.5.18]) by miranda.se.axis.com (8.12.9/8.12.9/Debian-5local0.1) with ESMTP id k2T0RUag004442; Wed, 29 Mar 2006 02:27:30 +0200 Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id k2T0RT2V032072; Wed, 29 Mar 2006 02:27:29 +0200 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id k2T0RTJd032068; Wed, 29 Mar 2006 02:27:29 +0200 Date: Wed, 29 Mar 2006 15:43:00 -0000 Message-Id: <200603290027.k2T0RTJd032068@ignucius.se.axis.com> From: Hans-Peter Nilsson To: drow@false.org CC: hans-peter.nilsson@axis.com, gdb-patches@sourceware.org In-reply-to: <20060328222721.GB11817@nevyn.them.org> (message from Daniel Jacobowitz on Tue, 28 Mar 2006 17:27:21 -0500) Subject: Re: [RFA:] sim/common/aclocal.m4: correct duplicate arg test for --enable-sim-hardware=... Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00338.txt.bz2 > Date: Tue, 28 Mar 2006 17:27:21 -0500 > From: Daniel Jacobowitz > On Sat, Mar 25, 2006 at 05:22:58PM +0100, Hans-Peter Nilsson wrote: > > - case " $f " in > > - x) ;; > > - *" $i "*) ;; > > + case " $sim_hw,$i " in > > + *",x "* | *" $i,"*) ;; > > *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";; > > I don't think that's right. Don't you want: > > for i in $hardware ; do > case " $sim_hw " in > *" $i "*) ;; > *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";; > esac > done Yeah, that would seem the obvious correction if there isn't a "x" to remove. Ha! Consider it done as such! :-) > The "in x $hardware" bit is not necessary (that's only necessary from > Makefiles), Ok then, it's just that the previous author didn't think so, and so I thought maybe there was a reason for that. > and the commas don't work like you'd think, since sim_hw is > space separated. It's moot now, but that's was the point, as I also mentioned! In other words, using a comma to join two values for a combined $i-in-$sim_hw existence and filter-out-x test, with either side wildcarded out, would be safe, as "," doesn't occur in $hardware; it's replaced by spaces just a bit higher up; I guess you saw that. brgds, H-P