Don't use echo -e
A rule that uses echo -e may execute in a dash shell instead of bash
when running on the build servers. The dash echo builtin is posix
compliant, and does not treat -e as an option[1]. Replace all uses
of echo -e with echo if it does not need escape sequences, or printf
if it does.
[1] https://wiki.ubuntu.com/DashAsBinSh#echo
Bug: 378931009
Test: manual
Change-Id: I2974f59ea10a613bc3bd36e3591fd81f38a1769a
diff --git a/java/java.go b/java/java.go
index 078f578..64ef782 100644
--- a/java/java.go
+++ b/java/java.go
@@ -226,9 +226,9 @@
// Rule for generating device binary default wrapper
deviceBinaryWrapper = pctx.StaticRule("deviceBinaryWrapper", blueprint.RuleParams{
- Command: `echo -e '#!/system/bin/sh\n` +
+ Command: `printf '#!/system/bin/sh\n` +
`export CLASSPATH=/system/framework/$jar_name\n` +
- `exec app_process /$partition/bin $main_class "$$@"'> ${out}`,
+ `exec app_process /$partition/bin $main_class "$$@"\n'> ${out}`,
Description: "Generating device binary wrapper ${jar_name}",
}, "jar_name", "partition", "main_class")
)