Skip to content

Commit 218093d

Browse files
committed
configure: simplify pandoc version recognition.
The version recognition was failing for version 1.11, thinking the minor version was 1 rather than 11.
1 parent a56ec8c commit 218093d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Diff for: configure

+7-6
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,13 @@ fi
406406

407407
if [ ! -z "$CFG_PANDOC" ]
408408
then
409-
PANDOC_VER_LINE=$(pandoc --version | grep '^pandoc ')
410-
PANDOC_VER=${PANDOC_VER_LINE#pandoc }
411-
PV_MAJOR_MINOR=${PANDOC_VER%.[0-9]*}
412-
PV_MAJOR=${PV_MAJOR_MINOR%%[.][0-9]*}
413-
PV_MINOR=${PV_MAJOR_MINOR#[0-9]*[.]}
414-
PV_MINOR=${PV_MINOR%%[.][0-9]*}
409+
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc ' |
410+
# extract the first 2 version fields, ignore everything else
411+
sed 's/pandoc \([0-9]*\)\.\([0-9]*\).*/\1 \2/')
412+
413+
# these patterns are shell globs, *not* regexps
414+
PV_MAJOR=${PV_MAJOR_MINOR% *}
415+
PV_MINOR=${PV_MAJOR_MINOR#* }
415416
if [ "$PV_MAJOR" -lt "1" ] || [ "$PV_MINOR" -lt "8" ]
416417
then
417418
step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. disabling"

0 commit comments

Comments
 (0)