All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Lluís Vilanova" <vilanova@ac.upc.edu>, qemu-devel@nongnu.org
Cc: "Benoît Canet" <benoit.canet@irqsave.net>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Luiz Capitulino" <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v8 3/4] qapi: Use an explicit input file
Date: Fri, 11 Apr 2014 09:57:01 -0600	[thread overview]
Message-ID: <534810CD.1030103@redhat.com> (raw)
In-Reply-To: <20140402151617.8123.47924.stgit@fimbulvetr.bsc.es>

[-- Attachment #1: Type: text/plain, Size: 1924 bytes --]

On 04/02/2014 09:16 AM, Lluís Vilanova wrote:
> Use an explicit input file on the command-line instead of reading from standard input
> 
> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
> ---

> +input_file = ""
>  output_dir = ""
>  prefix = ""
>  dispatch_type = "sync"
> @@ -389,6 +391,8 @@ do_h = False
>  for o, a in opts:
>      if o in ("-p", "--prefix"):
>          prefix = a
> +    elif o in ("-i", "--input-file"):
> +        input_file = a
>      elif o in ("-o", "--output-dir"):
>          output_dir = a + "/"
>      elif o in ("-t", "--type"):
> @@ -420,7 +424,7 @@ except os.error, e:
>      if e.errno != errno.EEXIST:
>          raise
>  
> -exprs = parse_schema(sys.stdin)
> +exprs = 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 <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2014-04-11 15:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02 15:15 [Qemu-devel] [PATCH v8 0/4] qapi: Allow modularization of QAPI schema files Lluís Vilanova
2014-04-02 15:16 ` [Qemu-devel] [PATCH v8 1/4] qapi: [trivial] Break long command lines Lluís Vilanova
2014-04-11 15:42   ` Eric Blake
2014-04-02 15:16 ` [Qemu-devel] [PATCH v8 2/4] qapi: [trivial] Show full exception message in "test-qapi.py" Lluís Vilanova
2014-04-11 15:37   ` Markus Armbruster
2014-04-11 19:09     ` Lluís Vilanova
2014-04-02 15:16 ` [Qemu-devel] [PATCH v8 3/4] qapi: Use an explicit input file Lluís Vilanova
2014-04-11 15:57   ` Eric Blake [this message]
2014-04-02 15:16 ` [Qemu-devel] [PATCH v8 4/4] qapi: Add a primitive to include other files from a QAPI schema file Lluís Vilanova
2014-04-11 18:03   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=534810CD.1030103@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=benoit.canet@irqsave.net \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vilanova@ac.upc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.