qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] allow to build with older sed
@ 2018-01-19  7:52 Jan Beulich
  2018-01-19  9:28 ` Daniel P. Berrange
  2018-01-19 14:37 ` Eric Blake
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Beulich @ 2018-01-19  7:52 UTC (permalink / raw)
  To: qemu-devel

sed's -E option may not be supported by older distros. As there's no
point using sed here at all, use just shell mechanisms to establish the
variable values, starting from the stem instead of the full target.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/Makefile
+++ b/Makefile
@@ -242,8 +242,7 @@ GENERATED_FILES += $(KEYCODEMAP_FILES)
 
 ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs
 	$(call quiet-command,\
-	    src=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\1,") && \
-	    dst=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\2,") && \
+	    stem=$* && src=$${stem%-to-*} dst=$${stem#*-to-} && \
 	    test -e $(KEYCODEMAP_GEN) && \
 	    $(PYTHON) $(KEYCODEMAP_GEN) \
 	          --lang glib2 \

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] allow to build with older sed
  2018-01-19  7:52 [Qemu-devel] [PATCH] allow to build with older sed Jan Beulich
@ 2018-01-19  9:28 ` Daniel P. Berrange
  2018-01-19 12:13   ` Philippe Mathieu-Daudé
  2018-01-19 14:37 ` Eric Blake
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel P. Berrange @ 2018-01-19  9:28 UTC (permalink / raw)
  To: Jan Beulich; +Cc: qemu-devel

On Fri, Jan 19, 2018 at 12:52:27AM -0700, Jan Beulich wrote:
> sed's -E option may not be supported by older distros. As there's no
> point using sed here at all, use just shell mechanisms to establish the
> variable values, starting from the stem instead of the full target.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

> --- a/Makefile
> +++ b/Makefile
> @@ -242,8 +242,7 @@ GENERATED_FILES += $(KEYCODEMAP_FILES)
>  
>  ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs
>  	$(call quiet-command,\
> -	    src=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\1,") && \
> -	    dst=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\2,") && \
> +	    stem=$* && src=$${stem%-to-*} dst=$${stem#*-to-} && \
>  	    test -e $(KEYCODEMAP_GEN) && \
>  	    $(PYTHON) $(KEYCODEMAP_GEN) \
>  	          --lang glib2 \

Clever ! I was hoping someone might suggest a cleaner approach one day

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] allow to build with older sed
  2018-01-19  9:28 ` Daniel P. Berrange
@ 2018-01-19 12:13   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-01-19 12:13 UTC (permalink / raw)
  To: Daniel P. Berrange, Jan Beulich; +Cc: qemu-devel

On 01/19/2018 06:28 AM, Daniel P. Berrange wrote:
> On Fri, Jan 19, 2018 at 12:52:27AM -0700, Jan Beulich wrote:
>> sed's -E option may not be supported by older distros. As there's no
>> point using sed here at all, use just shell mechanisms to establish the
>> variable values, starting from the stem instead of the full target.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> 
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -242,8 +242,7 @@ GENERATED_FILES += $(KEYCODEMAP_FILES)
>>  
>>  ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs
>>  	$(call quiet-command,\
>> -	    src=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\1,") && \
>> -	    dst=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\2,") && \
>> +	    stem=$* && src=$${stem%-to-*} dst=$${stem#*-to-} && \
>>  	    test -e $(KEYCODEMAP_GEN) && \
>>  	    $(PYTHON) $(KEYCODEMAP_GEN) \
>>  	          --lang glib2 \
> 
> Clever ! I was hoping someone might suggest a cleaner approach one day
> 
> Regards,
> Daniel
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] allow to build with older sed
  2018-01-19  7:52 [Qemu-devel] [PATCH] allow to build with older sed Jan Beulich
  2018-01-19  9:28 ` Daniel P. Berrange
@ 2018-01-19 14:37 ` Eric Blake
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Blake @ 2018-01-19 14:37 UTC (permalink / raw)
  To: Jan Beulich, qemu-devel

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

On 01/19/2018 01:52 AM, Jan Beulich wrote:
> sed's -E option may not be supported by older distros. As there's no
> point using sed here at all, use just shell mechanisms to establish the
> variable values, starting from the stem instead of the full target.

Grammar in the subject ("allow to ${verb}" is not idiomatic, better is
"allow ${subject} to ${verb}" or "allow ${verb}ing"):

s/to build/building/

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/Makefile
> +++ b/Makefile
> @@ -242,8 +242,7 @@ GENERATED_FILES += $(KEYCODEMAP_FILES)
>  
>  ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs
>  	$(call quiet-command,\
> -	    src=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\1,") && \
> -	    dst=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\2,") && \
> +	    stem=$* && src=$${stem%-to-*} dst=$${stem#*-to-} && \
>  	    test -e $(KEYCODEMAP_GEN) && \
>  	    $(PYTHON) $(KEYCODEMAP_GEN) \
>  	          --lang glib2 \
> 
> 
> 
> 
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-19 14:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-19  7:52 [Qemu-devel] [PATCH] allow to build with older sed Jan Beulich
2018-01-19  9:28 ` Daniel P. Berrange
2018-01-19 12:13   ` Philippe Mathieu-Daudé
2018-01-19 14:37 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).