From 83d52fd6d2039c048f731133bec0ae8a1bf9382d Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Sun, 16 Sep 2012 11:47:22 +0700 Subject: bootstrap: update bootstrap script to latest upstream. * bootstrap, build-aux/options-parser: apply upstream fixes and enhancements. Signed-off-by: Gary V. Vaughan --- bootstrap | 20 +++++++++++++------- build-aux/options-parser | 45 ++++++++++++++++++++++++++++++++++----------- 2 files changed, 47 insertions(+), 18 deletions(-) diff --git a/bootstrap b/bootstrap index 8e36780c..19b29370 100755 --- a/bootstrap +++ b/bootstrap @@ -134,7 +134,6 @@ gnulib_modules= gnulib_non_module_files=" build-aux/compile build-aux/install-sh - build-aux/missing build-aux/mdate-sh build-aux/texinfo.tex build-aux/depcomp @@ -428,10 +427,10 @@ func_gnulib_tool () gnulib_cmd=`echo $gnulib_tool $gnulib_tool_options` func_show_eval "$gnulib_cmd" 'exit $?' - } - # Use `gnulib-tool --copy-file' to install non-module files. - func_install_gnulib_non_module_files + # Use `gnulib-tool --copy-file' to install non-module files. + func_install_gnulib_non_module_files + } func_run_hooks func_gnulib_tool } @@ -601,12 +600,18 @@ func_install_gnulib_non_module_files () case $file in */COPYING*) dest=COPYING;; */INSTALL) dest=INSTALL;; + build-aux/missing) dest= + func_warning settings "\ +Please remove build-aux/missing from gnulib_module_files in +\`bootstrap.conf', as it may clash with Automake's version." + ;; build-aux/*) dest=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;; *) dest=$file;; esac # Be sure to show all copying errors before bailing out - func_gnulib_tool_copy_file "$file" "$dest" \ + test -z "$dest" \ + || func_gnulib_tool_copy_file "$file" "$dest" \ || maybe_exit_cmd="exit $EXIT_FAILURE" done @@ -1257,7 +1262,7 @@ func_require_gnulib_merge_changelog () test -f ChangeLog && { $require_git - test true = "$GIT" || { + func_grep_q '^\(/\|\)ChangeLog$' .gitignore || test true = "$GIT" || { if $GIT config merge.merge-changelog.driver >/dev/null ; then : elif (git-merge-changelog --version) >/dev/null 2>&1 ; then @@ -2380,7 +2385,7 @@ bootstrap_options_prep () { $debug_cmd - warning_func=func_error + warning_func=func_warn # Option defaults: opt_copy=${copy-'false'} @@ -2495,6 +2500,7 @@ bootstrap_validate_options () func_quote_for_eval ${1+"$@"} bootstrap_validate_options_result=$func_quote_for_eval_result } +func_add_hook func_validate_options bootstrap_validate_options ## -------------------------------------------------- ## diff --git a/build-aux/options-parser b/build-aux/options-parser index 9d42418d..f7f27a25 100644 --- a/build-aux/options-parser +++ b/build-aux/options-parser @@ -462,6 +462,9 @@ func_parse_options () # Adjust func_parse_options positional parameters to match eval set dummy $func_run_hooks_result; shift + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + _G_opt=$1 shift case $_G_opt in @@ -476,7 +479,7 @@ func_parse_options () --help) func_help ;; # Separate optargs to long options (plugins may need this): - --*=*) func_split_equals "$opt" + --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift @@ -587,27 +590,47 @@ func_echo () } -# func_error ARG... -# ----------------- -# Echo program name prefixed message to standard error. -func_error () +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () { $require_term_colors + _G_infix=$1; shift + _G_prefix="$progname: $tc_standout$tc_red$_G_infix$tc_reset: " _G_message=$* - _G_prefix="$progname: $tc_standout${tc_red}error$tc_reset: " save_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$save_IFS $bs_echo "$_G_prefix$tc_bold$_G_line$tc_reset" 1>&2 - _G_prefix="$progname: " + _G_prefix="$progname: `echo $_G_infix | sed 's|.| |g'` " done IFS=$save_IFS } +# func_warn ARG... +# ---------------- +# Echo program name (and 'warning') prefixed message to standard error. +func_warn () +{ + func_echo_infix_1 warning "$*" +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + func_echo_infix_1 error "$*" +} + + # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. @@ -626,8 +649,8 @@ func_fatal_help () { $debug_cmd - eval $bs_echo \""Usage: $usage"\" - eval $bs_echo \""$fatal_help"\" + eval \$bs_echo \""Usage: $usage"\" + eval \$bs_echo \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } @@ -777,11 +800,11 @@ func_usage_message () { $debug_cmd - eval $bs_echo \""$usage"\" + eval \$bs_echo \""$usage"\" echo $SED -n 's|^# ||;/^Written by/{x;p;x;};h' < "$progpath" echo - eval $bs_echo \""$usage_message"\" + eval \$bs_echo \""$usage_message"\" } -- cgit v1.2.1