From: Pádraig Brady Date: Thu, 8 Aug 2013 10:08:49 +0000 (+0100) Subject: bootstrap: support checksum utils without a --status option X-Git-Tag: v0.1~77 X-Git-Url: http://erislabs.net/gitweb/?p=gnulib.git;a=commitdiff_plain;h=c50edd6462eaaae00f8549f9bad99d4e68b94376 bootstrap: support checksum utils without a --status option * build-aux/bootstrap: Only look for sha1sum if updating po files. Add sha1 to the list of supported checksum utils since it's now supported through adjustments below. (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. 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. Don't even check for the presence of the command as if that is needed, it's supported through configuring prerequisites in bootstrap.conf. Prompt that when a tool isn't found, one can define an environment variable to add to the hardcoded search list. --- diff --git a/ChangeLog b/ChangeLog index 39eb46567..3363d6fbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2013-08-09 Pádraig Brady + + bootstrap: support checksum utils having -c but not --status + * build-aux/bootstrap: Only look for sha1sum if updating po files. + Add sha1 to the list of supported checksum utils since it's now + supported through adjustments below. + (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. + 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. Don't even check for the + presence of the command as if that is needed, it's supported + through configuring prerequisites in bootstrap.conf. + Prompt that when a tool isn't found, one can define an environment + variable to add to the hardcoded search list. + 2013-08-05 Jim Meyering regex: port to non-glibc/lock-using systems diff --git a/build-aux/bootstrap b/build-aux/bootstrap index a37fb8a03..df763de8f 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 }