|
Lines 518-523
autotools_run_tool() {
Link Here
|
| 518 |
set -- "${1}" $(autotools_m4dir_include) "${@:2}" $(autotools_m4sysdir_include) |
518 |
set -- "${1}" $(autotools_m4dir_include) "${@:2}" $(autotools_m4sysdir_include) |
| 519 |
fi |
519 |
fi |
| 520 |
|
520 |
|
|
|
521 |
# re-order arguments, bug #680210 |
| 522 |
local _old_args=( ${@} ) |
| 523 |
local _at_command= |
| 524 |
local _at_file= |
| 525 |
local -a _at_args=() |
| 526 |
local _argument= |
| 527 |
|
| 528 |
for _argument in ${_old_args[*]}; do |
| 529 |
if [[ -z "${_at_command}" ]]; then |
| 530 |
_at_command=${_argument} |
| 531 |
continue |
| 532 |
fi |
| 533 |
|
| 534 |
if [[ -z "${_at_file}" && "${_argument}" =~ \.(in|ac)$ ]]; then |
| 535 |
_at_file=${_argument} |
| 536 |
continue |
| 537 |
fi |
| 538 |
|
| 539 |
_at_args+=( ${_argument} ) |
| 540 |
done |
| 541 |
|
| 542 |
# make sure file is last argument |
| 543 |
if [[ -n "${_at_file}" ]]; then |
| 544 |
_at_args+=( ${_at_file} ) |
| 545 |
fi |
| 546 |
|
| 547 |
debug-print "\$@ before reordering of arguments: ${@}" |
| 548 |
set -- "${_at_command}" "${_at_args[@]}" |
| 549 |
debug-print "\$@ after reordering of arguments: ${@}" |
| 550 |
|
| 521 |
# If the caller wants to probe something, then let them do it directly. |
551 |
# If the caller wants to probe something, then let them do it directly. |
| 522 |
if ${return_output} ; then |
552 |
if ${return_output} ; then |
| 523 |
"$@" |
553 |
"$@" |
|
Lines 527-534
autotools_run_tool() {
Link Here
|
| 527 |
printf "***** $1 *****\n***** PWD: ${PWD}\n***** $*\n\n" > "${STDERR_TARGET}" |
557 |
printf "***** $1 *****\n***** PWD: ${PWD}\n***** $*\n\n" > "${STDERR_TARGET}" |
| 528 |
|
558 |
|
| 529 |
ebegin "Running $@" |
559 |
ebegin "Running $@" |
| 530 |
"$@" >> "${STDERR_TARGET}" 2>&1 |
560 |
|
| 531 |
if ! eend $? && ${autofail} ; then |
561 |
local _retVal=1 |
|
|
562 |
if [[ ${WANT_AUTOCONF} = 2.1 && -n "${_at_file}" ]] ; then |
| 563 |
local _output_file=${_at_file%.*} |
| 564 |
debug-print "Creating ${PWD}/${_output_file} ..." |
| 565 |
"$@" > "${_output_file}" 2> "${STDERR_TARGET}" |
| 566 |
_retVal=$? |
| 567 |
else |
| 568 |
"$@" >> "${STDERR_TARGET}" 2>&1 |
| 569 |
_retVal=$? |
| 570 |
fi |
| 571 |
|
| 572 |
if ! eend ${_retVal} && ${autofail} ; then |
| 532 |
echo |
573 |
echo |
| 533 |
eerror "Failed Running $1 !" |
574 |
eerror "Failed Running $1 !" |
| 534 |
eerror |
575 |
eerror |