diff options
author | 2023-12-19 08:20:51 +0100 | |
---|---|---|
committer | 2023-12-19 08:20:51 +0100 | |
commit | 0a0ea26c60ba3ff8c55cce1b3cd52ce9fb21126a (patch) | |
tree | e9efa3056dd8363547e0aa257e108578cf86cf0c /aconfig/init.go | |
parent | 4c27146e4c78a524df996d84e8105c12f8fe2e11 (diff) |
Fix broken sdk build (/bin/sh: 1: [[: not found)
The CL aosp/2878135 introduced a new shell command to be executed as
part of `m sdk dist` builds. The new command incorrectly used bash
syntax for conditionals, i.e. `if [[ ... ]]` (double [[]]) instead of
the POSIX compliant `if [ ... ]` (single []).
This broke the sdk build on systems where /bin/sh is not a symlink to
/bin/bash:
/bin/sh: 1: [[: not found
error: lstat out/soong/.intermediates/exported_java_aconfig_library.jar.tmp: file does not exist
Fix the breakage by using POSIX shell syntax instead.
Bug: 316933458
Bug: 311151343
Test: m sdk dist
Change-Id: I7de53261674a8f54c4ecacf0e27aecbafcfa4048
Diffstat (limited to 'aconfig/init.go')
-rw-r--r-- | aconfig/init.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/aconfig/init.go b/aconfig/init.go index 52d075572..c1b923b82 100644 --- a/aconfig/init.go +++ b/aconfig/init.go @@ -78,7 +78,7 @@ var ( blueprint.RuleParams{ Command: `rm -rf ${out}.tmp` + `&& for cache in ${cache_files}; do ` + - ` if [[ -n "$$(${aconfig} dump --cache $$cache --filter=is_exported:true --format='{fully_qualified_name}')" ]]; then ` + + ` if [ -n "$$(${aconfig} dump --cache $$cache --filter=is_exported:true --format='{fully_qualified_name}')" ]; then ` + ` ${aconfig} create-java-lib --cache $$cache --mode=exported --out ${out}.tmp; ` + ` fi ` + `done` + |