MT#17219 Use $@ instead of $* when we need to preserve argument grouping

Using $* in some of these places implies losing data about what
constituted a single argument.

Change-Id: Ic072e68320d65ac86392c31d7665529b913232fd
changes/42/4042/4
Guillem Jover 11 years ago
parent 04e4d45fb2
commit b789568b73

@ -183,7 +183,7 @@ generate_template_list() {
echo "$file" >> "${filelist_prepared}"
else
# arguments (file list/pattern) provided via cmdline
for arg in $* ; do
for arg in "$@"; do
if echo $file | grep -q -- "${arg}" ; then
echo "$file" >> "${filelist_prepared}"
fi

@ -114,10 +114,10 @@ case ${1:-} in
status|\
values)
action "$@" ;;
--debug) export DEBUG=1 ; shift ; $0 $* ;;
--no-db-sync) export NO_DB_SYNC=1 ; shift ; $0 $* ;;
--no-validate) export NO_VALIDATE=1; shift ; $0 $* ;;
--no-action-failure) export NO_ACTION_FAILURE=1; shift ; $0 $* ;;
--debug) export DEBUG=1 ; shift ; "$0" "$@" ;;
--no-db-sync) export NO_DB_SYNC=1 ; shift ; "$0" "$@" ;;
--no-validate) export NO_VALIDATE=1; shift ; "$0" "$@" ;;
--no-action-failure) export NO_ACTION_FAILURE=1; shift ; "$0" "$@" ;;
-h|--help|help) usage ; exit 0;;
-v|--version|version) version ; exit 0;;
*) usage 1; exit 1;;

@ -40,7 +40,7 @@ fi
"${SCRIPTS}"/build
"${SCRIPTS}"/services
"${SCRIPTS}"/commit "$*"
"${SCRIPTS}"/commit "$@"
# We "commit" AFTER we "build", therefore the state information is out of date
# and would be marked as "dirty". As we have full control over this during the

@ -47,7 +47,7 @@ for f in ${NGCPCTL_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${NETWORK_CONFIG
done
build_config_files() {
for file in $(generate_template_list $*) ; do
for file in $(generate_template_list "$@") ; do
log_debug "${HELPER}/build_config $file"
"${HELPER}/build_config" "${file}"
RC=$(($RC + $?))
@ -60,7 +60,7 @@ build_config_files() {
RC=0
if ! $MODIFIED_ONLY ; then
build_config_files "$*"
build_config_files "$@"
else
log_info "Considering modified files only due to --modified-only option."
@ -94,7 +94,7 @@ else
if $trigger_rebuild ; then
log_info "Main configuation file(s) has been changed, running full rebuild."
log_debug "Executing: build_config_files $*"
build_config_files "$*"
build_config_files "$@"
fi
if git diff-index --name-only HEAD | grep -q templates/ || \

@ -18,7 +18,7 @@ log_debug "cd $NGCPCTL_MAIN"
cd "$NGCPCTL_MAIN"
log_debug "git diff $*"
git diff $*
git diff "$@"
# added files
log_debug "git status --porcelain | awk '/^\?\? / {print \$2}'"

@ -25,11 +25,11 @@ if [ -f "${FUNCTIONS}/ha_features" ] ; then
exit 1
fi
git log $* --oneline --date-order --graph --date=rfc --format=format:"%h (%ar) %s %d" master origin/master
git log "$@" --oneline --date-order --graph --date=rfc --format=format:"%h (%ar) %s %d" master origin/master
else
git log $* --oneline --date-order --graph --date=rfc --format=format:"%h (%ar) %s %d" master
git log "$@" --oneline --date-order --graph --date=rfc --format=format:"%h (%ar) %s %d" master
fi

Loading…
Cancel
Save