Skip to contentSkip to conversation

tools/build: remove usage of sed -i

PATCH In review Roger Pau Monne 3 participants 3 messages Mar 24, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 tools/include/xen-foreign/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/include/xen-foreign/Makefile +3 -2
index bb09c93..270a975 100644
@@ -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) $< $* [email protected] $(filter %.h,$^)
 	#Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
-	sed 's/(__align8__ \(u\?int64_t\))/(\1)/g' -i [email protected]
-	$(call move-if-changed,[email protected],$@)
+	sed 's/(__align8__ \(u\?int64_t\))/(\1)/g' < [email protected] > [email protected]
+	rm [email protected]
+	$(call move-if-changed,[email protected],$@)
 
 checker.c: mkchecker.py structs.py
 	$(PYTHON) $< $@ $(architectures)
Signature · 7 lines
2.6.4 (Apple Git-63)


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · 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

Sorry for breaking this.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw

Andrew Cooper writes ("Re: [Xen-devel] [PATCH] tools/build: remove usage of sed -i"):

Quoted 6 lines · Roger Pau Monne
Quoted 5 lines

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

Quoted 7 lines
Quoted 3 lines

Sorry for breaking this.

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel