envsetup.sh: don't assume 'cd' is builtin

Some parts of envsetup.sh aren't very happy with things like
this:
function cd() {
    builtin cd "$@" && pwd && ls -l
}

here, I have s/cd/builtin cd/ one such case where envsetup
is trying to execute the output of cd.

Test: manual
Change-Id: I2774481dfbd958410682a4f773f1b8f12a0080aa
This commit is contained in:
Steven Moreland
2018-01-05 12:13:11 -08:00
parent b0f4677748
commit 0540296e9f

View File

@@ -51,7 +51,7 @@ function build_build_var_cache()
cached_vars=`cat $T/build/envsetup.sh | tr '()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/get_build_var/) print $(i+1)}' | sort -u | tr '\n' ' '`
cached_abs_vars=`cat $T/build/envsetup.sh | tr '()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/get_abs_build_var/) print $(i+1)}' | sort -u | tr '\n' ' '`
# Call the build system to dump the "<val>=<value>" pairs as a shell script.
build_dicts_script=`\cd $T; build/soong/soong_ui.bash --dumpvars-mode \
build_dicts_script=`\builtin cd $T; build/soong/soong_ui.bash --dumpvars-mode \
--vars="$cached_vars" \
--abs-vars="$cached_abs_vars" \
--var-prefix=var_cache_ \