From d7c54f1fe35ba901d2e82ec566bd475f58d8b85a Mon Sep 17 00:00:00 2001 From: Roland Illig Date: Thu, 10 Mar 2005 09:59:27 +0000 Subject: [PATCH] * autogen.sh: Made the gettext version check more portable. The actual sed command is unchanged. --- ChangeLog | 5 +++++ autogen.sh | 28 ++++++++++++++++++---------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 24e94efb6..dc7ff7ad2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-03-10 Roland Illig + + * autogen.sh: Made the gettext version check more portable. The + actual sed command is unchanged. + 2005-02-26 Miguel de Icaza * doc/mc.1.in: Replace M-char with Alt-char everywhere, which is diff --git a/autogen.sh b/autogen.sh index 8f009f8c9..1d70cb8ca 100755 --- a/autogen.sh +++ b/autogen.sh @@ -30,17 +30,25 @@ if test ! -d config; then fi # Ensure that gettext is reasonably new. -gettext_ver=`$GETTEXTIZE --version | \ - sed '2,$d; # remove all but the first line - s/.* //; # take text after the last space - s/-.*//; # strip "-pre" or "-rc" at the end - s/\([^.][^.]*\)/0\1/g; # prepend 0 to every token - s/0\([^.][^.]\)/\1/g; # strip leading 0 from long tokens - s/$/.00.00/; # add .00.00 for short version strings - s/\.//g; # remove dots - s/\(......\).*/\1/; # leave only 6 leading digits - '` +# remove all but the first line +sed_cmd="sed -e '2,\$d'" +# take text after the last space +sed_cmd="${sed_cmd} -e 's/.* //'" +# strip "-pre" or "-rc" at the end +sed_cmd="${sed_cmd} -e 's/-.*//'" +# prepend 0 to every token +sed_cmd="${sed_cmd} -e 's/\\([^.][^.]*\\)/0\\1/g'" +# strip leading 0 from long tokens +sed_cmd="${sed_cmd} -e 's/0\\([^.][^.]\\)/\\1/g'" +# add .00.00 for short version strings +sed_cmd="${sed_cmd} -e 's/\$/.00.00/'" +# remove dots +sed_cmd="${sed_cmd} -e 's/\\.//g'" +# leave only 6 leading digits +sed_cmd="${sed_cmd} -e 's/\\(......\\).*/\\1/'" + +gettext_ver=`$GETTEXTIZE --version | eval ${sed_cmd}` if test -z "$gettext_ver"; then echo "Cannot determine version of gettext" 2>&1 exit 1