[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] tools/build: remove usage of sed -i



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@xxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 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@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.