From 0aacf2f73e3b05fe64c822050ee55df7767a25d4 Mon Sep 17 00:00:00 2001 From: malc Date: Thu, 2 Feb 2017 11:11:41 +0300 Subject: [PATCH] Harden version check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Thanks to Vladimir Múrzin. --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 8d0e6be..aa58eac 100644 --- a/build.sh +++ b/build.sh @@ -6,7 +6,8 @@ if test x"$1" = x; then else builddir="$1" fi -test $(ocamlc --version | awk -F. '{print $1 $2}') -lt 404 && { +test $((ocamlc 2>/dev/null --mersion || echo 0.0) \ + | awk -F. '{print $1 $2}') -lt 404 && { echo "OCaml version 4.04.0 or higher required" exit 1 } || true -- 2.11.4.GIT