From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US6vP-0001P7-MS for qemu-devel@nongnu.org; Tue, 16 Apr 2013 10:32:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1US6gx-0003A9-4H for qemu-devel@nongnu.org; Tue, 16 Apr 2013 10:17:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US6NI-0005Ic-Uo for qemu-devel@nongnu.org; Tue, 16 Apr 2013 09:56:45 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3GDuiMo014443 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Apr 2013 09:56:44 -0400 Date: Tue, 16 Apr 2013 15:56:42 +0200 From: Kevin Wolf Message-ID: <20130416135642.GC19758@dhcp-200-207.str.redhat.com> References: <1366105701-7968-1-git-send-email-kwolf@redhat.com> <516D437E.7000907@redhat.com> <20130416131611.GA25650@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130416131611.GA25650@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH] qemu-iotests: Fix _filter_qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Am 16.04.2013 um 15:16 hat Stefan Hajnoczi geschrieben: > On Tue, Apr 16, 2013 at 06:26:38AM -0600, Eric Blake wrote: > > On 04/16/2013 03:48 AM, Kevin Wolf wrote: > > > $QEMU_PROG happens to be 'qemu' in my setup, so this sed command > > > replaces a bit too much. Restrict it to the start of the line and to > > > when it's followed by a colon, i.e. the form used by error messages. > > > > > > Signed-off-by: Kevin Wolf > > > --- > > > tests/qemu-iotests/common.filter | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter > > > index bc5f250..a7f889a 100644 > > > --- a/tests/qemu-iotests/common.filter > > > +++ b/tests/qemu-iotests/common.filter > > > @@ -155,7 +155,7 @@ _filter_qemu_io() > > > # replace occurrences of QEMU_PROG with "qemu" > > > _filter_qemu() > > > { > > > - sed -e "s#$(basename $QEMU_PROG)#QEMU_PROG#g" > > > + sed -e "s#^$(basename $QEMU_PROG):#QEMU_PROG:#g" > > > > Why spawn a basename process, when you can use shell to do the same? > > Also, the g modifier is worthless once you have a ^ anchor, since sed > > can only replace one ^ per line. And you don't need sed's -e option for > > a single script. > > sed -e is the convention in qemu-iotests. > > Dropping the 'g' would be nice. Okay, I just updated the commit to drop the 'g'. > The problem with the POSIX shell string replacement is that the syntax > is horrible. I can never remember what ${%}, ${%%}, ${#} and > %{##} do. $(basename $QEMU_PROG) is clear (although it doesn't handle > spaces in the filename!). That's exactly my problem as well. Kevin