X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=scripts%2F.aglsetup_genconfig.bash;h=b2471a71c2907d123c6c3f54b28a6eb972e37ad8;hb=70ba12df0113bee98bd6c45e3c64f0e1b0a93b73;hp=285ecee501c6fd107385ef8d6e6a6ab963b59fea;hpb=08cb4c01450c77e8eecdfacb63c5c9a8bad256f9;p=AGL%2Fmeta-agl.git diff --git a/scripts/.aglsetup_genconfig.bash b/scripts/.aglsetup_genconfig.bash index 285ecee50..b2471a71c 100755 --- a/scripts/.aglsetup_genconfig.bash +++ b/scripts/.aglsetup_genconfig.bash @@ -39,8 +39,8 @@ DEBUG=0 #SCRIPT=$(basename $BASH_SOURCE) SCRIPT=aglsetup.sh -SCRIPTDIR=$(cd $(dirname $BASH_SOURCE) && pwd -P) -METADIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) +SCRIPTDIR=$(cd $(dirname $BASH_SOURCE) > /dev/null && pwd -P) +METADIR=$(cd $(dirname $BASH_SOURCE)/../.. > /dev/null && pwd -P) function info() { echo "$@" >&2; } function infon() { echo -n "$@" >&2; } @@ -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 @@ -206,7 +213,7 @@ function append_fragment() { function execute_setup() { script=$1 debug "Executing script $script" - opts= + opts="-e" [[ $DEBUG == 1 ]] && opts="$opts -x" pushd $BUILDDIR &>/dev/null $BASH $opts $script \ @@ -324,8 +331,8 @@ for FEATURE in $FEATURES;do TMP_FEATURES="$TMP_FEATURES $FEATURE" TMP_FEATURES="$TMP_FEATURES $(find_feature_dependency $FEATURE $TMP_FEATURES)" done -FEATURES=$TMP_FEATURES -echo "Features used: $FEATURES" +# remove duplicate features if any +FEATURES=$(for x in $TMP_FEATURES; do echo $x; done | sort -u | awk '{printf("%s ",$1);}') # validate the features for f in $FEATURES; do @@ -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" > /dev/null && pwd -P) +validate_builddir ########################################################################################### function dump_log() { @@ -351,7 +359,7 @@ function genconfig() { info " Features: $FEATURES" # step 1: run usual OE setup to generate conf dir - export TEMPLATECONF=$(cd $SCRIPTDIR/../templates/base && pwd -P) + export TEMPLATECONF=$(cd $SCRIPTDIR/../templates/base > /dev/null && pwd -P) debug "running oe-init-build-env with TEMPLATECONF=$TEMPLATECONF" info " Running $METADIR/poky/oe-init-build-env" info " Templates dir: $TEMPLATECONF"