From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US4yA-0006Ik-8A for qemu-devel@nongnu.org; Tue, 16 Apr 2013 08:26:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1US4y8-0001MX-Ov for qemu-devel@nongnu.org; Tue, 16 Apr 2013 08:26:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US4y8-0001MP-FX for qemu-devel@nongnu.org; Tue, 16 Apr 2013 08:26:40 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3GCQdE9003729 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Apr 2013 08:26:39 -0400 Message-ID: <516D437E.7000907@redhat.com> Date: Tue, 16 Apr 2013 06:26:38 -0600 From: Eric Blake MIME-Version: 1.0 References: <1366105701-7968-1-git-send-email-kwolf@redhat.com> In-Reply-To: <1366105701-7968-1-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2ESAKNBBXPNICJNJOGHJD" Subject: Re: [Qemu-devel] [PATCH] qemu-iotests: Fix _filter_qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2ESAKNBBXPNICJNJOGHJD Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/common.filter | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/comm= on.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. The following is identical, with less typing: _filter_qemu() { sed "s#^${QEMU_PROG##*/}:#QEMU_PROG#" } That said, your more verbose version is still functionally correct, so you can add: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2ESAKNBBXPNICJNJOGHJD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRbUN+AAoJEKeha0olJ0NqPHwH/39xUsTVkw/SOLIsd5WQ5EMD p0M/m3i27ud7W3hLVAovZeKf4A74Z4s+8OeZGwwZA9E2Npmqy24gBNnsBOKKgvbr 52GsM3JVJQZ1Eg0iUv0MtR2tVFwWM0yI2BFnzbwaI66oaznATsv3YsljQjH0YcwN S18doFjLbRWGKgm+7Gn7qSS1tXcYFbnmrG7zrJUrcYQadojn2f2xEAMBX3qKjGjk OhXK3lck3s+lE2vRtdE/svumNYW//1xzWhnP71ipEd++2EFn8VpAk+EeXv+ImKOb VH5IgghmhANrg4tmWN3kjnElBZZJGAcDy4pP3rTWahEDCbaysST2v74A/PtgR4c= =jHCs -----END PGP SIGNATURE----- ------enig2ESAKNBBXPNICJNJOGHJD--