diff options
author | David Allsopp <david.allsopp@metastack.com> | 2019-09-25 15:44:00 +0100 |
---|---|---|
committer | Gabriel Scherer <gabriel.scherer@gmail.com> | 2019-09-26 08:26:02 +0200 |
commit | 7b078dedd8b8337f5d5f2f0e55bac98395465abf (patch) | |
tree | 55820ac182473645966aa04cf83812b3624b6081 /tools | |
parent | 9490f7a89aa2dcbdc3fe6e678588c08b0e8e504d (diff) | |
download | ocaml-7b078dedd8b8337f5d5f2f0e55bac98395465abf.tar.gz |
check-parser-uptodate-or-warn.sh: improve shell script
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/check-parser-uptodate-or-warn.sh | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/check-parser-uptodate-or-warn.sh b/tools/check-parser-uptodate-or-warn.sh index 09a4d857c0..9e0dad6900 100755 --- a/tools/check-parser-uptodate-or-warn.sh +++ b/tools/check-parser-uptodate-or-warn.sh @@ -16,10 +16,7 @@ #************************************************************************** # stop early if we are not on a development version -if test -z "$(cat VERSION | grep '+dev')" -then - exit 0 -fi +grep -Fq '+dev' VERSION || exit 0 # We try to warn if the user edits parsing/parser.mly but forgets to # rebuild the generated parser. Our heuristic is to use the file @@ -39,9 +36,9 @@ fi stat . 2>/dev/null 1>/dev/null if test $? != 0 then MTIME="" -elif test -n "$(stat --version 2>/dev/null | grep coreutils)" +elif stat --version 2>/dev/null | grep -Fq 'coreutils' then MTIME="stat --format %Y" -elif test -n "$(stat 2>&1 | grep busybox)" +elif stat 2>&1 | grep -Fq 'busybox' then MTIME="stat -c %Y" else MTIME="stat -f %m" # BSD stat? fi |