From acdecdedb86c7635ff4c37b86c35747cceb337e6 Mon Sep 17 00:00:00 2001 From: Phil Longstaff Date: Sun, 18 Oct 2009 21:57:19 +0000 Subject: [PATCH] Allow m4 1.4.11 and 1.4.13 as well as 1.4.7. Should really parse the version number to ensure it is higher than some minimum value. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18385 57a11ea4-9604-0410-9ed3-97b8803252fd --- packaging/win32/install.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packaging/win32/install.sh b/packaging/win32/install.sh index a04396bdc3..2942133db2 100755 --- a/packaging/win32/install.sh +++ b/packaging/win32/install.sh @@ -90,6 +90,16 @@ function prepare() { fi } +function check_m4_version_ok() { + v=`m4 --version | grep -e '[0-9]*\.[0-9]*\.[0-9]*' | sed -e 's/[mM]4//g' -e 's/[^\.0-9]//g'` + if [ "$v" = "1.4.7" -o "$v" = "1.4.11" -o "$v" = "1.4.13" ]; + then + return 1 + else + return 0 + fi +} + function inst_wget() { setup Wget _WGET_UDIR=`unix_path $WGET_DIR` @@ -108,8 +118,7 @@ function inst_wget() { function inst_dtk() { setup MSYS DTK _MSYS_UDIR=`unix_path $MSYS_DIR` - if quiet ${_MSYS_UDIR}/bin/perl --help && - [ "`m4 --version | sed '1!d;s,.* [Mm]4 ,,'`" = "1.4.7" ] + if quiet ${_MSYS_UDIR}/bin/perl --help && [ check_m4_version_ok ] then echo "msys dtk already installed. skipping." else @@ -128,7 +137,7 @@ function inst_dtk() { wget_unpacked $M4_URL $DOWNLOAD_DIR $TMP_DIR mv $TMP_UDIR/usr/bin/m4.exe /bin quiet ${_MSYS_UDIR}/bin/perl --help && - [ "`m4 --version | sed '1!d;s,.* [Mm]4 ,,'`" = "1.4.7" ] || die "msys dtk not installed correctly" + [ check_m4_version_ok ] || die "msys dtk not installed correctly" fi }