commit:     7f2ceb06ae9a0a8688fabfd4f41f3f3c2b1fe893
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 13 11:00:18 2018 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sat Jan 13 11:36:28 2018 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=7f2ceb06

bootstrap-prefix.sh: require bash 4.2.

  Direct the users to bootstrap bash 4.2 first.

 scripts/bootstrap-bash.sh   | 22 ++++++++++------------
 scripts/bootstrap-prefix.sh | 11 +++++++++--
 2 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/scripts/bootstrap-bash.sh b/scripts/bootstrap-bash.sh
index a891cc16ae..be0b36d831 100755
--- a/scripts/bootstrap-bash.sh
+++ b/scripts/bootstrap-bash.sh
@@ -1,14 +1,12 @@
 #!/bin/sh
-# Copyright 2006-2014 Gentoo Foundation; Distributed under the GPL v2
+# Copyright 2006-2018 Gentoo Foundation; Distributed under the GPL v2
 
-# *BSD bash installer
+# bash installer
 #
-# FreeBSD and OpenBSD come with some POSIX (?) /bin/sh which doesn't eat
-# most of the stuff in the bootstrap-prefix script, among which the most
-# important part: dynamic function calling.  So, we need to bootstrap
-# bash outside the bootstrap script, which is the purpose of this
-# script.
-# This script also runs on Interix
+#  POSIX (?) /bin/sh which doesn't eat most of the stuff in the
+# bootstrap-prefix script, among which the most important part:
+# dynamic function calling.  So, we need to bootstrap bash outside the
+# bootstrap script, which is the purpose of this script.
 
 [ -z "$1" ] && exit -1
 
@@ -19,10 +17,10 @@ cd bash-build
 
 GENTOO_MIRRORS=${GENTOO_MIRRORS:="http://distfiles.gentoo.org/distfiles"}
 
-ftp "${GENTOO_MIRRORS}/bash-4.1.tar.gz"
-gzip -d bash-4.1.tar.gz
-tar -xf bash-4.1.tar
-cd bash-4.1
+ftp "${GENTOO_MIRRORS}/bash-4.2.tar.gz"
+gzip -d bash-4.2.tar.gz
+tar -xf bash-4.2.tar
+cd bash-4.2
 
 ./configure --prefix="${1}"/usr --disable-nls
 make

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index d5cad4d148..89210cea0c 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1,12 +1,19 @@
 #!/usr/bin/env bash
-# Copyright 2006-2017 Gentoo Foundation; Distributed under the GPL v2
-# $Id$
+# Copyright 2006-2018 Gentoo Foundation; Distributed under the GPL v2
 
 trap 'exit 1' TERM KILL INT QUIT ABRT
 
 # some basic output functions
 eerror() { echo "!!! $*" 1>&2; }
 einfo() { echo "* $*"; }
+
+if [[ ! ${BASH_VERSION:-0} == 4.[23456789]* ]]; then
+       eerror "This script requires GNU bash 4.2 or newer to run."
+       eerror "If you don't have one, please bootstrap bash 4.2 first:"
+       eerror "https://wiki.gentoo.org/wiki/Project:Prefix/Bootstrap";
+       exit 1
+fi
+
 # RAP (libc) mode is triggered on Linux kernel and glibc.
 is-rap() { [[ ${PREFIX_DISABLE_RAP} != "yes" && ${CHOST} = *linux-gnu* ]]; }
 rapx() { is-rap && echo $1 || echo $2; }

Reply via email to