From: Stephane Desneux Date: Tue, 21 Feb 2017 17:58:20 +0000 (+0100) Subject: aglsetup: check build dir integrity (no spaces) X-Git-Tag: 3.99.1~154 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=3d1a59fd5f95b5a300cd8bfbf31b255559cd6ed5;p=AGL%2Fmeta-agl.git aglsetup: check build dir integrity (no spaces) The absolute build path shouldn't contain any space. Discussion: https://lists.linuxfoundation.org/pipermail/automotive-discussions/2017-February/003522.html Change-Id: If3de580a2a8fd0f944c40f669a9fcd2de7e1f04b Signed-off-by: Stephane Desneux --- diff --git a/scripts/.aglsetup_genconfig.bash b/scripts/.aglsetup_genconfig.bash index af2b7473b..48af0fbe6 100755 --- a/scripts/.aglsetup_genconfig.bash +++ b/scripts/.aglsetup_genconfig.bash @@ -67,6 +67,13 @@ function list_all_machines() { done } +function validate_builddir() { + if [[ "$BUILDDIR" =~ [[:space:]] ]]; then + error "Build dir '$BUILDDIR' shouldn't contain any space" + fi + debug "Build dir is valid" +} + function validate_machines() { list_all_machines | sort | uniq -c | while read cnt machine; do [[ $cnt == 1 ]] && continue @@ -335,7 +342,8 @@ done # validate build dir debug "validating builddir $BUILDDIR" -BUILDDIR=$(mkdir -p $BUILDDIR && cd $BUILDDIR && pwd -P) +BUILDDIR=$(mkdir -p "$BUILDDIR" && cd "$BUILDDIR" && pwd -P) +validate_builddir ########################################################################################### function dump_log() {