summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenda Xu <heroxbd@gentoo.org>2018-01-13 20:00:18 +0900
committerBenda Xu <heroxbd@gentoo.org>2018-01-13 20:36:28 +0900
commit7f2ceb06ae9a0a8688fabfd4f41f3f3c2b1fe893 (patch)
treec9130be6d401b3dfac2f8b77f72cb06d0e0e2e63
parentsys-libs/ncurses: fix build during bootstrap (diff)
downloadprefix-7f2ceb06ae9a0a8688fabfd4f41f3f3c2b1fe893.zip
prefix-7f2ceb06ae9a0a8688fabfd4f41f3f3c2b1fe893.tar.gz
prefix-7f2ceb06ae9a0a8688fabfd4f41f3f3c2b1fe893.tar.bz2
bootstrap-prefix.sh: require bash 4.2.
Direct the users to bootstrap bash 4.2 first.
-rwxr-xr-xscripts/bootstrap-bash.sh22
-rwxr-xr-xscripts/bootstrap-prefix.sh11
2 files changed, 19 insertions, 14 deletions
diff --git a/scripts/bootstrap-bash.sh b/scripts/bootstrap-bash.sh
index a891cc1..be0b36d 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 d5cad4d..89210ce 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; }