about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-03-26 00:09:52 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2013-03-26 00:20:18 +1100
commit218093d912b3725251e7a97d44f03321ba856ce6 (patch)
treec450540e2fc18680a59831dcbf4ea7eb407e973b
parenta56ec8c1342453a88be79e192a11501844375d40 (diff)
downloadrust-218093d912b3725251e7a97d44f03321ba856ce6.tar.gz
rust-218093d912b3725251e7a97d44f03321ba856ce6.zip
configure: simplify pandoc version recognition.
The version recognition was failing for version 1.11, thinking the
minor version was 1 rather than 11.
-rwxr-xr-xconfigure13
1 files changed, 7 insertions, 6 deletions
diff --git a/configure b/configure
index 825519b5195..e38a8b90c69 100755
--- a/configure
+++ b/configure
@@ -406,12 +406,13 @@ fi
 
 if [ ! -z "$CFG_PANDOC" ]
 then
-    PANDOC_VER_LINE=$(pandoc --version | grep '^pandoc ')
-    PANDOC_VER=${PANDOC_VER_LINE#pandoc }
-    PV_MAJOR_MINOR=${PANDOC_VER%.[0-9]*}
-    PV_MAJOR=${PV_MAJOR_MINOR%%[.][0-9]*}
-    PV_MINOR=${PV_MAJOR_MINOR#[0-9]*[.]}
-    PV_MINOR=${PV_MINOR%%[.][0-9]*}
+    PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc ' |
+        # extract the first 2 version fields, ignore everything else
+        sed 's/pandoc \([0-9]*\)\.\([0-9]*\).*/\1 \2/')
+
+    # these patterns are shell globs, *not* regexps
+    PV_MAJOR=${PV_MAJOR_MINOR% *}
+    PV_MINOR=${PV_MAJOR_MINOR#* }
     if [ "$PV_MAJOR" -lt "1" ] || [ "$PV_MINOR" -lt "8" ]
     then
 		step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. disabling"