Skip to content

Commit 4d716de

Browse files
committed
Auto merge of #22474 - iKevinY:pandoc-version-check, r=brson
Executing `configure` seems to create the following error due to how the script [parses Pandoc's version](https://github.com/rust-lang/rust/blob/master/configure#L705): ```text ./configure: line 705: [: pandoc: integer expression expected ./configure: line 705: [: 1.12.4.2: integer expression expected ``` This issue seems to stem from a discrepancy between BSD and GNU versions of sed. This patch changes the sed command to use an extended regex, which works with both flavours of sed.
2 parents 1fe8f22 + 4349fa4 commit 4d716de

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
@@ -697,15 +697,17 @@ probe CFG_ADB adb
697697

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

704704
MIN_PV_MAJOR="1"
705705
MIN_PV_MINOR="9"
706+
706707
# these patterns are shell globs, *not* regexps
707708
PV_MAJOR=${PV_MAJOR_MINOR% *}
708709
PV_MINOR=${PV_MAJOR_MINOR#* }
710+
709711
if [ "$PV_MAJOR" -lt "$MIN_PV_MAJOR" ] || [ "$PV_MINOR" -lt "$MIN_PV_MINOR" ]
710712
then
711713
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)