Skip to contentSkip to conversation

acpid: replace "echo -e" with printf

PATCH New Maxime Hadjinlian 2 participants 4 messages May 21, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 acpid: replace "echo -e" with printf

printf is POSIX-compliant, echo -e is not.

Cc Thomas De Schampheleire <[email protected]>

---
Changes v1 -> v2:
- Added trailing \n (Peter Korsgaard)

---
 package/acpid/acpid.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/acpid/acpid.mk +1 -1
index 1f4ec31..7a6a478 100644
@@ -17,7 +17,7 @@ endef
 
 define ACPID_SET_EVENTS
 	mkdir -p $(TARGET_DIR)/etc/acpi/events
-	/bin/echo -e "event=button[ /]power\naction=/sbin/poweroff" \
+	printf "event=button[ /]power\naction=/sbin/poweroff\n" \
 		>$(TARGET_DIR)/etc/acpi/events/powerbtn
 endef
 
Signature · 1 line
2.0.0.rc0
#1 lore raw

PATCH v2 2/2 infra: pkg-utils.mk replace "echo -en" with printf

printf is POSIX-compliant, echo -e/n is not.

Cc Thomas De Schampheleire <[email protected]>

---
Changes v1 -> v2:
- Add a trailing \n while retaining splitted lines (Peter Korsgaard, Thomas De Schampheleire)

---
 package/pkg-utils.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/pkg-utils.mk +2 -2
index da3f0fc..c627a64 100644
@@ -110,8 +110,8 @@ define legal-manifest # pkg, version, license, license-files, source, {HOST|TARG
 endef
 
 define legal-license-header # pkg, license-file, {HOST|TARGET}
-	echo -e "$(LEGAL_INFO_SEPARATOR)\n\t$(1):" \
-		"$(2)\n$(LEGAL_INFO_SEPARATOR)\n\n" >>$(LEGAL_LICENSES_TXT_$(3))
+	printf "$(LEGAL_INFO_SEPARATOR)\n\t$(1):\
+		$(2)\n$(LEGAL_INFO_SEPARATOR)\n\n\n" >>$(LEGAL_LICENSES_TXT_$(3))
 endef
 
 define legal-license-nofiles # pkg, {HOST|TARGET}
Signature · 1 line
2.0.0.rc0
#2 lore raw

PATCH v2 2/2 infra: pkg-utils.mk replace "echo -en" with printf

Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Maxime" == Maxime Hadjinlian <[email protected]> writes:

printf is POSIX-compliant, echo -e/n is not.

This place didn't actually use 'echo -n', so I've adjusted the commit message and committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH v2 1/2 acpid: replace "echo -e" with printf

In reply to Maxime Hadjinlian
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Maxime" == Maxime Hadjinlian <[email protected]> writes:

printf is POSIX-compliant, echo -e is not.

Cc Thomas De Schampheleire <[email protected]>

---
Changes v1 -> v2:
- Added trailing \n (Peter Korsgaard)

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard