From 114573d37141d67fbfe8dec85169142cbc14a1e1 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Sun, 16 Feb 2003 15:11:47 +0000 Subject: Merge James's bash version check (again after minor changes by me): Autoconf is there to make configuration and testing of the environment easier for the user and the designer, hence configure check for bash version in configure.ac It also removes the test from the constantly sourced patchfns too, which has to be a step in the right direction. --- configure.ac | 18 ++++++++++++++++-- scripts/patchfns.in | 6 ------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 71e0242..f4bbe4d 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT([quilt],[0.22],[quilt-dev@nongnu.org]) AC_CONFIG_AUX_DIR(config) AC_PREREQ(2.53) -AC_REVISION ($Revision: 1.8 $) +AC_REVISION ($Revision: 1.9 $) PACKAGE_RELEASE=1 AC_SUBST(PACKAGE_RELEASE) @@ -42,6 +42,20 @@ if test -z "$BASH" ; then AC_MSG_ERROR([Please specify the location of bash with the option '--with-bash']) fi +# It would be nice not to have to use backticks, but too many retarded sh +# implementations still don't support $( ) +# BEWARE: There is a distinct possibility that we are currently running under +# bash in this configure script (/bin/sh being a symlink to /bin/bash). Even +# though the result /could/ be available to us directly as $BASH_VERSION we +# don't want to use, or trust it, incase the user is specifying a different +# bash executable. +if `$BASH -c '[[ "$BASH_VERSION" \< "2.04" ]]'` ; then + AC_MSG_ERROR([ +$PACKAGE_NAME requires at least version 2.04 of bash, you can download a current +version of bash from ftp.gnu.org +]) +fi + dnl Check for Perl AC_ARG_WITH(perl, AC_HELP_STRING( [--with-perl], [name of the Perl executable to use]), @@ -142,7 +156,7 @@ if test "$enableval" = "yes" -a -z "$MSGFMT" ; then AC_MSG_ERROR([ You do not appear to have msgfmt, which is part of the GNU Gettext package. It is a required package as you chose the '--enable-nls' option to configure. -You can download GNU Gettext from ftp.gnu.org. +You can download GNU Gettext from ftp.gnu.org ]) fi if test -z "$MSGFMT" ; then diff --git a/scripts/patchfns.in b/scripts/patchfns.in index b155903..28f58de 100644 --- a/scripts/patchfns.in +++ b/scripts/patchfns.in @@ -7,12 +7,6 @@ # # See the COPYING and AUTHORS files for more details. -# Compat tests -if [ "$BASH_VERSION" \< "2.04" ] ; then - echo "$0: Needs Bash >= 2.04" >&2 - exit 1 -fi - export TEXTDOMAIN=quilt -- cgit