diff options
author | Akim Demaille <akim@epita.fr> | 2007-11-04 20:40:50 +0000 |
---|---|---|
committer | Akim Demaille <akim@epita.fr> | 2007-11-04 20:40:50 +0000 |
commit | d7be40857659eb85f3e9926cc94c08bf1d94929e (patch) | |
tree | 8a5109415b3d9d5357c3d122124dc4a00d3f5409 /bootstrap | |
parent | 730739e41d3b031a89ea24e267a59eec4ec4f936 (diff) | |
download | bison-d7be40857659eb85f3e9926cc94c08bf1d94929e.tar.gz |
Find sha1sum when named gsha1sum.
* bootstrap (find_tool): New.
($SHA1SUM): New.
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 51 |
1 files changed, 41 insertions, 10 deletions
@@ -41,16 +41,16 @@ Bootstrap this package from the checked-out sources. Options: --gnulib-srcdir=DIRNAME Specify the local directory where gnulib - sources reside. Use this if you already - have gnulib sources on your machine, and - do not want to waste your bandwidth downloading - them again. + sources reside. Use this if you already + have gnulib sources on your machine, and + do not want to waste your bandwidth downloading + them again. --copy Copy files instead of creating symbolic links. --force Attempt to bootstrap even if the sources seem - not to have been checked out. + not to have been checked out. --skip-po Do not download po files. --cvs-user=USERNAME Set the username to use when checking out - sources from the gnulib repository. + sources from the gnulib repository. If the file bootstrap.conf exists in the current working directory, its contents are read as shell variables to configure the bootstrap. @@ -139,6 +139,37 @@ copy=false # on which version control system (if any) is used in the source directory. vc_ignore=auto +# find_tool ENVVAR NAMES... +# ------------------------- +find_tool () +{ + # Find sha1sum, named gsha1sum on MacPorts. + find_tool_envvar=$1 + shift + if eval test x"\$$find_tool_envvar" = x; then + for i + do + if ($i --version </dev/null) >/dev/null 2>&1; then + find_tool_res=$i + break + fi + done + fi + if test x"$find_tool_res" = x; then + echo >&2 "$0: $find_tool_name is required" + exit 1 + fi + ($find_tool_res --version </dev/null) >/dev/null 2>&1 || { + echo >&2 "$0: cannot run $find_tool_res --version" + exit 1 + } + eval "$find_tool_envvar=\"$find_tool_res\"" + eval "export $find_tool_envvar" +} + +# Find sha1sum, named gsha1sum on MacPorts. +find_tool SHA1SUM sha1sum gsha1sum + # Override the default configuration, if necessary. test -r bootstrap.conf && . ./bootstrap.conf @@ -284,9 +315,9 @@ update_po_files() { for po in `cd $ref_po_dir && echo *.po|sed 's/\.po//g'`; do new_po="$ref_po_dir/$po.po" cksum_file="$ref_po_dir/$po.s1" - if ! sha1sum -c --status "$cksum_file" < "$new_po" > /dev/null; then + if ! "$SHA1SUM" -c --status "$cksum_file" < "$new_po" > /dev/null; then echo "updated $po_dir/$po.po..." - cp "$new_po" "$po_dir/$po.po" && sha1sum < "$new_po" > "$cksum_file" + cp "$new_po" "$po_dir/$po.po" && "$SHA1SUM" < "$new_po" > "$cksum_file" fi done } @@ -435,9 +466,9 @@ slurp() { test "$dir/$file" = "$excluded_file" && continue 2 done if test $file = Makefile.am; then - copied=$copied${sep}$gnulib_mk; sep=$nl + copied=$copied${sep}$gnulib_mk; sep=$nl remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g" - sed "$remove_intl" $1/$dir/$file | cmp -s - $dir/$gnulib_mk || { + sed "$remove_intl" $1/$dir/$file | cmp -s - $dir/$gnulib_mk || { echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." && rm -f $dir/$gnulib_mk && sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk |