On 01/03/11 06:09, Bruce Korb wrote: > Please notice that before "cat" runs, the file is tested for existence. > When "cat" does run, any error message goes to stderr and is thus > separated from the ``echo "$0: WARNING:..." stuff. I put them together > into a single well-ordered output. Also, "is missing" is not possible.
So, beit bad data or bad media, the data are damaged: diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen index c337673..9d09b4b 100755 --- a/build-aux/git-version-gen +++ b/build-aux/git-version-gen @@ -85,14 +85,17 @@ v= # then try "git describe", then default. if test -f $tarball_version_file then - v=`cat $tarball_version_file` || v= + v=`cat $tarball_version_file 2>&1` || { + echo "$0: error: $tarball_version_file is unreadable" >&2 + exit 1 + } case $v in *$nl*) v= ;; # reject multi-line output [0-9]*) ;; *) v= ;; esac test -z "$v" \ - && echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2 + && echo "$0: WARNING: $tarball_version_file is damaged" 1>&2 fi if test -n "$v"