Skip to content

Commit 4349fa4

Browse files
committed
Fix Pandoc version check in configure
Using an extended regex fixes pattern matching on BSD sed.
1 parent c5db290 commit 4349fa4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

configure

+5-3
Original file line numberDiff line numberDiff line change
@@ -693,15 +693,17 @@ probe CFG_ADB adb
693693

694694
if [ ! -z "$CFG_PANDOC" ]
695695
then
696-
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc\(.exe\)\? ' |
697-
# extract the first 2 version fields, ignore everything else
698-
sed 's/pandoc\(.exe\)\? \([0-9]*\)\.\([0-9]*\).*/\2 \3/')
696+
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc' |
697+
# Extract "MAJOR MINOR" from Pandoc's version number
698+
sed -E 's/pandoc(.exe)? ([0-9]+)\.([0-9]+).*/\2 \3/')
699699

700700
MIN_PV_MAJOR="1"
701701
MIN_PV_MINOR="9"
702+
702703
# these patterns are shell globs, *not* regexps
703704
PV_MAJOR=${PV_MAJOR_MINOR% *}
704705
PV_MINOR=${PV_MAJOR_MINOR#* }
706+
705707
if [ "$PV_MAJOR" -lt "$MIN_PV_MAJOR" ] || [ "$PV_MINOR" -lt "$MIN_PV_MINOR" ]
706708
then
707709
step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. Need at least $MIN_PV_MAJOR.$MIN_PV_MINOR. Disabling"

0 commit comments

Comments
 (0)