X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=build-aux%2Fbootstrap;h=e31d17df58411168c8956b5b52f7ecf210316d65;hb=8e0f64e4cd12f7779113bc438afd106dad3e1f1a;hp=cc7fc1b7dca6d5ddc09f818c60fa6967913411db;hpb=0ba087759d2797c8f7d3c34bef6268ba3fd212cb;p=gnulib.git diff --git a/build-aux/bootstrap b/build-aux/bootstrap index cc7fc1b7d..e31d17df5 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -209,12 +209,16 @@ bootstrap_sync=false # Use git to update gnulib sources use_git=true +check_exists() { + ($1 --version /dev/null 2>&1 + test $? -lt 126 +} + # find_tool ENVVAR NAMES... # ------------------------- # Search for a required program. Use the value of ENVVAR, if set, -# otherwise find the first of the NAMES that can be run (i.e., -# supports --version). If found, set ENVVAR to the program name, -# die otherwise. +# otherwise find the first of the NAMES that can be run. +# If found, set ENVVAR to the program name, die otherwise. # # FIXME: code duplication, see also gnu-web-doc-update. find_tool () @@ -225,7 +229,7 @@ find_tool () eval "find_tool_res=\$$find_tool_envvar" if test x"$find_tool_res" = x; then for i; do - if ($i --version /dev/null 2>&1; then + if check_exists $i; then find_tool_res=$i break fi @@ -463,8 +467,7 @@ check_versions() { if [ "$req_ver" = "-" ]; then # Merely require app to exist; not all prereq apps are well-behaved # so we have to rely on $? rather than get_version. - $app --version >/dev/null 2>&1 /dev/null 2>/dev/null ; then +if $use_git && test -d .git && check_exists git; then if git config merge.merge-changelog.driver >/dev/null ; then : - elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then + elif check_exists git-merge-changelog; then echo "$0: initializing git-merge-changelog driver" git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver' git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'