From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYdpH-0007dI-2x for qemu-devel@nongnu.org; Fri, 11 Apr 2014 11:57:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYdpC-0001KR-Hp for qemu-devel@nongnu.org; Fri, 11 Apr 2014 11:57:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYdpC-0001KN-99 for qemu-devel@nongnu.org; Fri, 11 Apr 2014 11:57:06 -0400 Message-ID: <534810CD.1030103@redhat.com> Date: Fri, 11 Apr 2014 09:57:01 -0600 From: Eric Blake MIME-Version: 1.0 References: <20140402151558.8123.58942.stgit@fimbulvetr.bsc.es> <20140402151617.8123.47924.stgit@fimbulvetr.bsc.es> In-Reply-To: <20140402151617.8123.47924.stgit@fimbulvetr.bsc.es> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="t4uA5QVfheXwXDDbHaMl71pbg0TuOtWQk" Subject: Re: [Qemu-devel] [PATCH v8 3/4] qapi: Use an explicit input file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TGx1w61zIFZpbGFub3Zh?= , qemu-devel@nongnu.org Cc: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= , Markus Armbruster , Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --t4uA5QVfheXwXDDbHaMl71pbg0TuOtWQk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/02/2014 09:16 AM, Llu=C3=ADs Vilanova wrote: > Use an explicit input file on the command-line instead of reading from = standard input >=20 > Signed-off-by: Llu=C3=ADs Vilanova > --- > +input_file =3D "" > output_dir =3D "" > prefix =3D "" > dispatch_type =3D "sync" > @@ -389,6 +391,8 @@ do_h =3D False > for o, a in opts: > if o in ("-p", "--prefix"): > prefix =3D a > + elif o in ("-i", "--input-file"): > + input_file =3D a > elif o in ("-o", "--output-dir"): > output_dir =3D a + "/" > elif o in ("-t", "--type"): > @@ -420,7 +424,7 @@ except os.error, e: > if e.errno !=3D errno.EEXIST: > raise > =20 > -exprs =3D parse_schema(sys.stdin) > +exprs =3D parse_schema(input_file) I'm assuming this gives a sane error message if the user forgot -i and you end up trying parse_schema("")? But that's a fringe case (after all, most people are ONLY using the makefile to call this script, which calls it correctly - the only way to notice the problem is calling this script by hand), so it shouldn't hold up this patch. > +++ b/tests/Makefile > @diff -q $(SRC_PATH)/$*.out $*.test.out > + @# Replace in disk to show file in in diff (in case of differences) s/in in/in/ ? Or maybe just rewrite the entire comment to something simpler: # Sanitize error messages: > + @sed -e "s|$(SRC_PATH)/||g" $*.test.err > $*.test.err.sub > + @mv $*.test.err.sub $*.test.err > @diff -q $(SRC_PATH)/$*.err $*.test.err Or for that matter, skip the mv and .sub file altogether: @sed 's|$(SRC_PATH)/||g' $*.test.err | diff -q $(SRC_PATH/$*.err - If you decide to just tweak the comment, instead of optimizing the 3 lines into one, I could still live with you adding: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --t4uA5QVfheXwXDDbHaMl71pbg0TuOtWQk 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTSBDNAAoJEKeha0olJ0NqcTAH/1lPCe7UECRO0YoTyv0EOkFT wPM2tJoox88gFMovLRL4+UYU1ebK7LMH3qZj6xJuMowyk/h+UK7VK4hH1aFRwP+1 ogyk++56efGQRlZNSq5qS29Mbjx0ELaSdcpKjiQ9268Ph7kxHskstYPpl+gF0eK+ xRDaPpSCun2PWEAIFdGJlwS1ukvudFipnYZAyJl84CGKnP4zJv64NviigQaPPOK7 wf3iH2BlQqvI9TQACKsmxp1PZDzIt3x3UdNH3s6iIeGjKB01ydbdf5hU7EbsGowE ubFkdDBuz7TYvjUHkoJzznyooEk8nxUMXilHUEsPBsO+ZDTsBJR/HY7vmE+ZdQI= =X5lH -----END PGP SIGNATURE----- --t4uA5QVfheXwXDDbHaMl71pbg0TuOtWQk--