>From ad454d54bb631c2ce5db560e1283364f43461cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Thu, 8 Aug 2013 11:08:49 +0100 Subject: [PATCH] bootstrap: support checksum utils having -c but not --status * build-aux/bootstrap: Only look for sha1sum if updating po files. (update_po_files): Remove the use of --status in a way that will suppress all error messages, but since this is only used to minimize updates, it shouldn't cause an issue. Also exit early if there is a problem updating the po file checksums. (find_tool): Remove the check for --version support as this is optional as per commit 86186b17 Prompt when a tool isn't found, that one can define an environment variable to add to the hardcoded search list. --- build-aux/bootstrap | 35 +++++++++++++++++------------------ 1 files changed, 17 insertions(+), 18 deletions(-) diff --git a/build-aux/bootstrap b/build-aux/bootstrap index 9c52204..8d2487a 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -1,6 +1,6 @@ #! /bin/sh # Print a version string. -scriptversion=2013-07-03.20; # UTC +scriptversion=2013-08-09.15; # UTC # Bootstrap this package from checked-out sources. @@ -224,27 +224,21 @@ find_tool () find_tool_names=$@ eval "find_tool_res=\$$find_tool_envvar" if test x"$find_tool_res" = x; then - for i - do + for i; do if ($i --version /dev/null 2>&1; then - find_tool_res=$i - break + find_tool_res=$i + break fi done - else - find_tool_error_prefix="\$$find_tool_envvar: " fi - test x"$find_tool_res" != x \ - || die "one of these is required: $find_tool_names" - ($find_tool_res --version /dev/null 2>&1 \ - || die "${find_tool_error_prefix}cannot run $find_tool_res --version" + if test x"$find_tool_res" = x; then + warn_ "one of these is required: $find_tool_names;" + die "alternatively set $find_tool_envvar to a compatible tool" + fi eval "$find_tool_envvar=\$find_tool_res" eval "export $find_tool_envvar" } -# Find sha1sum, named gsha1sum on MacPorts, and shasum on Mac OS X 10.6. -find_tool SHA1SUM sha1sum gsha1sum shasum - # Override the default configuration, if necessary. # Make sure that bootstrap.conf is sourced from the current directory # if we were invoked as "sh bootstrap". @@ -469,7 +463,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 + $app --version >/dev/null 2>&1 /dev/null; then + ! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then echo "$me: updated $po_dir/$po.po..." cp "$new_po" "$po_dir/$po.po" \ - && $SHA1SUM < "$new_po" > "$cksum_file" + && $SHA1SUM < "$new_po" > "$cksum_file" || return fi done } -- 1.7.7.6