X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=scripts%2F.aglsetup_genconfig.bash;h=d4f3ba813107cc897f123c899ab6a5676fac78f5;hb=7c0e34bad099e08c42bc9045db4c7e34d62ab402;hp=31520a7cc184d6988768b2203777d4b50fdf7611;hpb=ead1bded123556f3aa7d716c4e009d342b891a20;p=AGL%2Fmeta-agl.git diff --git a/scripts/.aglsetup_genconfig.bash b/scripts/.aglsetup_genconfig.bash index 31520a7cc..d4f3ba813 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 @@ -123,24 +130,6 @@ function find_feature_dir() { return 1 } -function process-feature-shortcuts() { - TOCHECK=$1 - debug "processing feature shortcut $TOCHECK" - if $(echo "$FEATURES" | grep -q "$TOCHECK" 2>&1 ) ; then - featuredir=$(find_feature_dir $TOCHECK) - if test -d $featuredir; then - tmpfeatures="$FEATURES $(cat $featuredir/included.inc)" - tmpfeatures_uniq=$(echo $tmpfeatures | sed -e "s/$TOCHECK//g" -e 's/ / /g' | tr "[:blank:]" "\n" | sort -u ) - export FEATURES=$tmpfeatures_uniq - debug "Features used: $FEATURES" - else - error "No feature directory with this name: $TOCHECK" - exit 1 - fi - fi -} - - function usage() { cat <&2 Usage: . $SCRIPT [options] [feature [feature [... ]]] @@ -224,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,9 +313,6 @@ verbose "Command line arguments: ${GLOBAL_ARGS[@]}" # the remaining args are the features FEATURES="$@" -process-feature-shortcuts agl-all-features -process-feature-shortcuts agl-ci-change-features -process-feature-shortcuts agl-ci-snapshot-features # validate the machine list debug "validating machines list" @@ -345,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 @@ -356,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() {