Skip to content

Commit dfb955c

Browse files
committed
Fix configure not working with custom grep
5e199f4 added a check to make sure configure is properly parsing the Vim version string, but it doesn't work if user has installed GNU grep instead of the system one. Fix it to use the more common `[[:digit:]]` (instead of `\d`), and also hardcode the path for grep. Fix #1017
1 parent 5e199f4 commit dfb955c

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/auto/configure

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14903,12 +14903,12 @@ $as_echo "using default" >&6; }
1490314903
fi
1490414904

1490514905

14906-
vim_major_version_string=`grep -m 1 'define.*VIM_VERSION_MAJOR' $srcdir/version.h|sed -E -e 's/^.*([0-9]+).*/\1/'`
14907-
vim_minor_version_string=`grep -m 1 'define.*VIM_VERSION_MINOR' $srcdir/version.h|sed -E -e 's/^.*([0-9]+).*/\1/'`
14908-
snapshot=`grep -C2 "Add new patch number below this line" $srcdir/version.c|tail -1|sed -E -e 's/^ *([0-9]+),.*/\1/'`
14906+
vim_major_version_string=`/usr/bin/grep -m 1 'define.*VIM_VERSION_MAJOR' $srcdir/version.h|sed -E -e 's/^.*([0-9]+).*/\1/'`
14907+
vim_minor_version_string=`/usr/bin/grep -m 1 'define.*VIM_VERSION_MINOR' $srcdir/version.h|sed -E -e 's/^.*([0-9]+).*/\1/'`
14908+
snapshot=`/usr/bin/grep -C2 "Add new patch number below this line" $srcdir/version.c|tail -1|sed -E -e 's/^ *([0-9]+),.*/\1/'`
1490914909
vim_short_version_string="$vim_major_version_string.$vim_minor_version_string.$snapshot"
1491014910

14911-
if echo "$vim_short_version_string" | grep -q "^\d\+\.\d\+\.\d\+$"; then
14911+
if echo "$vim_short_version_string" | /usr/bin/grep -q "^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+$"; then
1491214912
XCODEFLAGS="$XCODEFLAGS VIM_SHORT_VERSION_STRING=$vim_short_version_string"
1491314913
else
1491414914
as_fn_error $? "could not parse Vim version: $vim_short_version_string" "$LINENO" 5

src/configure.ac

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4543,12 +4543,12 @@ if test "x$MACOS_X" = "xyes"; then
45434543
[ AC_MSG_RESULT(using default) ])
45444544

45454545
dnl Set CFBundleShortVersionString of Info.plist
4546-
vim_major_version_string=`grep -m 1 'define.*VIM_VERSION_MAJOR' $srcdir/version.h|sed -E -e 's/^.*([[0-9]]+).*/\1/'`
4547-
vim_minor_version_string=`grep -m 1 'define.*VIM_VERSION_MINOR' $srcdir/version.h|sed -E -e 's/^.*([[0-9]]+).*/\1/'`
4548-
snapshot=`grep -C2 "Add new patch number below this line" $srcdir/version.c|tail -1|sed -E -e 's/^ *([[0-9]]+),.*/\1/'`
4546+
vim_major_version_string=`/usr/bin/grep -m 1 'define.*VIM_VERSION_MAJOR' $srcdir/version.h|sed -E -e 's/^.*([[0-9]]+).*/\1/'`
4547+
vim_minor_version_string=`/usr/bin/grep -m 1 'define.*VIM_VERSION_MINOR' $srcdir/version.h|sed -E -e 's/^.*([[0-9]]+).*/\1/'`
4548+
snapshot=`/usr/bin/grep -C2 "Add new patch number below this line" $srcdir/version.c|tail -1|sed -E -e 's/^ *([[0-9]]+),.*/\1/'`
45494549
vim_short_version_string="$vim_major_version_string.$vim_minor_version_string.$snapshot"
45504550

4551-
if echo "$vim_short_version_string" | grep -q "^\d\+\.\d\+\.\d\+$"; then
4551+
if echo "$vim_short_version_string" | /usr/bin/grep -q "^[[[:digit:]]]\+\.[[[:digit:]]]\+\.[[[:digit:]]]\+$"; then
45524552
XCODEFLAGS="$XCODEFLAGS VIM_SHORT_VERSION_STRING=$vim_short_version_string"
45534553
else
45544554
AC_MSG_ERROR(could not parse Vim version: $vim_short_version_string)

0 commit comments

Comments
 (0)