Skip to content

Commit

Permalink
Fix Pandoc version check in configure
Browse files Browse the repository at this point in the history
Using an extended regex fixes pattern matching on BSD sed.
  • Loading branch information
iKevinY committed Mar 3, 2015
1 parent c5db290 commit 4349fa4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions configure
Expand Up @@ -693,15 +693,17 @@ probe CFG_ADB adb

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

MIN_PV_MAJOR="1"
MIN_PV_MINOR="9"

# these patterns are shell globs, *not* regexps
PV_MAJOR=${PV_MAJOR_MINOR% *}
PV_MINOR=${PV_MAJOR_MINOR#* }

if [ "$PV_MAJOR" -lt "$MIN_PV_MAJOR" ] || [ "$PV_MINOR" -lt "$MIN_PV_MINOR" ]
then
step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. Need at least $MIN_PV_MAJOR.$MIN_PV_MINOR. Disabling"
Expand Down

0 comments on commit 4349fa4

Please sign in to comment.