Skip to contentSkip to conversation

Avoid non-portable sed construct

PATCH In review Mark Kettenis 2 participants 2 messages Jan 8, 2017 – Jan 15, 2017 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Avoid non-portable sed construct

Using \n in a substitution is a GNU extension. Use the 'G" command instead to insert the desired line.

---
 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.lib +1 -1
index 13c975b8a4..4413e9f98b 100644
@@ -311,7 +311,7 @@ quiet_cmd_dtc = DTC     $@
 # Bring in any U-Boot-specific include after the '/dts-v1/;' header
 cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
 	cat $< $(if $(u_boot_dtsi),\
-		| sed 's%^/ {$$%\#include \"$(u_boot_dtsi)\"\n&%')  | \
+		| sed '/^\/ {$$/{x;s%$$%\#include \"$(u_boot_dtsi)\"%;G;}') | \
 		$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \
 	$(DTC) -O dtb -o $@ -b 0 \
 		-i $(dir $<) $(DTC_FLAGS) \
Signature · 1 line
2.11.0
#1 lore raw
Quoted 4 lines · Mark Kettenis

Using \n in a substitution is a GNU extension. Use the 'G" command instead to insert the desired line.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170115/d18dcf90/attachment.sig>