xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/build: remove usage of sed -i
@ 2016-03-24 17:05 Roger Pau Monne
  2016-03-24 17:08 ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Roger Pau Monne @ 2016-03-24 17:05 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu, Ian Jackson, Roger Pau Monne

The "-i" sed option is not POSIX compatible [0], remove it's usage and
instead create yet another temporary intermediate file.

[0] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 tools/include/xen-foreign/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/include/xen-foreign/Makefile b/tools/include/xen-foreign/Makefile
index bb09c93..270a975 100644
--- a/tools/include/xen-foreign/Makefile
+++ b/tools/include/xen-foreign/Makefile
@@ -36,8 +36,9 @@ x86_32.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_32.h $(ROOT)/arch-x86/
 x86_64.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_64.h $(ROOT)/arch-x86/xen.h $(ROOT)/xen.h
 	$(PYTHON) $< $* $@.tmp $(filter %.h,$^)
 	#Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
-	sed 's/(__align8__ \(u\?int64_t\))/(\1)/g' -i $@.tmp
-	$(call move-if-changed,$@.tmp,$@)
+	sed 's/(__align8__ \(u\?int64_t\))/(\1)/g' < $@.tmp > $@.tmp2
+	rm $@.tmp
+	$(call move-if-changed,$@.tmp2,$@)
 
 checker.c: mkchecker.py structs.py
 	$(PYTHON) $< $@ $(architectures)
-- 
2.6.4 (Apple Git-63)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH] tools/build: remove usage of sed -i
  2016-03-24 17:05 [PATCH] tools/build: remove usage of sed -i Roger Pau Monne
@ 2016-03-24 17:08 ` Andrew Cooper
  2016-03-24 17:10   ` Ian Jackson
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2016-03-24 17:08 UTC (permalink / raw)
  To: Roger Pau Monne, xen-devel; +Cc: Ian Jackson, Wei Liu

On 24/03/16 17:05, Roger Pau Monne wrote:
> The "-i" sed option is not POSIX compatible [0], remove it's usage and
> instead create yet another temporary intermediate file.
>
> [0] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>

Sorry for breaking this.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH] tools/build: remove usage of sed -i
  2016-03-24 17:08 ` Andrew Cooper
@ 2016-03-24 17:10   ` Ian Jackson
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Jackson @ 2016-03-24 17:10 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel, Wei Liu, Roger Pau Monne

Andrew Cooper writes ("Re: [Xen-devel] [PATCH] tools/build: remove usage of sed -i"):
> On 24/03/16 17:05, Roger Pau Monne wrote:
> > The "-i" sed option is not POSIX compatible [0], remove it's usage and
> > instead create yet another temporary intermediate file.
> >
> > [0] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
> >
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: Wei Liu <wei.liu2@citrix.com>
> 
> Sorry for breaking this.
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-03-24 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-24 17:05 [PATCH] tools/build: remove usage of sed -i Roger Pau Monne
2016-03-24 17:08 ` Andrew Cooper
2016-03-24 17:10   ` Ian Jackson

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).