travis: fix for EXTRA arguments with spaces/quotes

- feed EXTRA variables into an array to be properly expanded
This commit is contained in:
Ralph Lange
2020-04-23 17:41:42 +02:00
parent 27f823139a
commit d0f93f1920
2 changed files with 12 additions and 2 deletions

View File

@@ -53,6 +53,8 @@ script:
# SET source setup file
# ADD_MODULES extra modules (for a specific job)
# EXTRA content will be added to make command line
# EXTRA1..5 additional arguments for the make command
# (one argument per variable)
# STATIC set to YES for static build (default: NO)
# TEST set to NO to skip running the tests (default: YES)
# VV set to make build scripts verbose (default: unset)

View File

@@ -13,7 +13,15 @@ export EPICS_BASE
[ -z "$EPICS_HOST_ARCH" -a -f $EPICS_BASE/startup/EpicsHostArch.pl ] && EPICS_HOST_ARCH=$(perl $EPICS_BASE/startup/EpicsHostArch.pl)
export EPICS_HOST_ARCH
make -j2 $EXTRA
# use array variable to get the quoting right while using separate words for arguments
[ -n "$EXTRA0" ] && EXTRA[0]="$EXTRA0"
[ -n "$EXTRA1" ] && EXTRA[1]="$EXTRA1"
[ -n "$EXTRA2" ] && EXTRA[2]="$EXTRA2"
[ -n "$EXTRA3" ] && EXTRA[3]="$EXTRA3"
[ -n "$EXTRA4" ] && EXTRA[4]="$EXTRA4"
[ -n "$EXTRA5" ] && EXTRA[5]="$EXTRA5"
make -j2 "${EXTRA[@]}"
ret=0
@@ -21,7 +29,7 @@ if [ "$TEST" != "NO" ]
then
make tapfiles || ret=$?
make -s test-results
make -sk test-results
fi
exit $ret