use portable printf instead of echo -e, needed for MacOS X buildhost

Submitted by Waldemar Brodkorb on Sept. 20, 2012, 8:01 a.m.

Details

Message ID 20120920080117.GA4747@waldemar-brodkorb.de
State Accepted
Commit ccd7f14cfebc8dc144411cbcb08c7651759c5298
Headers show

Commit Message

Waldemar Brodkorb Sept. 20, 2012, 8:01 a.m.
Hi,

echo -e is not a portable way to do this, better use printf.
Works with MacOS X.

Signed-off-by: Waldemar Brodkorb <mail@waldemar-brodkorb.de>
---
 fs/common.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Arnout Vandecappelle Sept. 30, 2012, 4:29 p.m.
On 20/09/12 10:01, Waldemar Brodkorb wrote:
> Hi,
>
> echo -e is not a portable way to do this, better use printf.
> Works with MacOS X.
>
> Signed-off-by: Waldemar Brodkorb<mail@waldemar-brodkorb.de>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Peter Korsgaard Oct. 6, 2012, 11:05 a.m.
>>>>> "Waldemar" == Waldemar Brodkorb <mail@waldemar-brodkorb.de> writes:

 Waldemar> Hi,
 Waldemar> echo -e is not a portable way to do this, better use printf.
 Waldemar> Works with MacOS X.

Committed, thanks.

Patch hide | download patch | download mbox

diff --git a/fs/common.mk b/fs/common.mk
index debf7db..0f0eae9 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -49,9 +49,9 @@  $(BINARIES_DIR)/rootfs.$(1): $(ROOTFS_$(2)_DEPENDENCIES)
 ifneq ($(ROOTFS_DEVICE_TABLES),)
 	cat $(ROOTFS_DEVICE_TABLES) > $(FULL_DEVICE_TABLE)
 ifeq ($(BR2_ROOTFS_DEVICE_CREATION_STATIC),y)
-	echo -e '$(subst $(sep),\n,$(PACKAGES_DEVICES_TABLE))' >> $(FULL_DEVICE_TABLE)
+	printf '$(subst $(sep),\n,$(PACKAGES_DEVICES_TABLE))' >> $(FULL_DEVICE_TABLE)
 endif
-	echo -e '$(subst $(sep),\n,$(PACKAGES_PERMISSIONS_TABLE))' >> $(FULL_DEVICE_TABLE)
+	printf '$(subst $(sep),\n,$(PACKAGES_PERMISSIONS_TABLE))' >> $(FULL_DEVICE_TABLE)
 	echo "$(HOST_DIR)/usr/bin/makedevs -d $(FULL_DEVICE_TABLE) $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
 endif
 	echo "$(ROOTFS_$(2)_CMD)" >> $(FAKEROOT_SCRIPT)