Rollup 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.
This commit is contained in:
Manish Goregaokar 2015-03-06 16:25:43 +05:30
commit 7ed4660a51

8
configure vendored
View File

@ -697,15 +697,17 @@ probe CFG_ADB adb
if [ ! -z "$CFG_PANDOC" ] if [ ! -z "$CFG_PANDOC" ]
then then
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc\(.exe\)\? ' | PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc' |
# extract the first 2 version fields, ignore everything else # Extract "MAJOR MINOR" from Pandoc's version number
sed 's/pandoc\(.exe\)\? \([0-9]*\)\.\([0-9]*\).*/\2 \3/') sed -E 's/pandoc(.exe)? ([0-9]+)\.([0-9]+).*/\2 \3/')
MIN_PV_MAJOR="1" MIN_PV_MAJOR="1"
MIN_PV_MINOR="9" MIN_PV_MINOR="9"
# these patterns are shell globs, *not* regexps # these patterns are shell globs, *not* regexps
PV_MAJOR=${PV_MAJOR_MINOR% *} PV_MAJOR=${PV_MAJOR_MINOR% *}
PV_MINOR=${PV_MAJOR_MINOR#* } PV_MINOR=${PV_MAJOR_MINOR#* }
if [ "$PV_MAJOR" -lt "$MIN_PV_MAJOR" ] || [ "$PV_MINOR" -lt "$MIN_PV_MINOR" ] if [ "$PV_MAJOR" -lt "$MIN_PV_MAJOR" ] || [ "$PV_MINOR" -lt "$MIN_PV_MINOR" ]
then then
step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. Need at least $MIN_PV_MAJOR.$MIN_PV_MINOR. Disabling" step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. Need at least $MIN_PV_MAJOR.$MIN_PV_MINOR. Disabling"