From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C05D31382C5 for ; Sat, 10 Mar 2018 18:44:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 17EDFE08D6; Sat, 10 Mar 2018 18:44:39 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EED85E08D6 for ; Sat, 10 Mar 2018 18:44:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D4955335C31 for ; Sat, 10 Mar 2018 18:44:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 63921240 for ; Sat, 10 Mar 2018 18:44:36 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1520707382.db77fbabf914f5165a6be32f58fe0ebbe9940531.grobian@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: scripts/bootstrap-bash.sh X-VCS-Directories: scripts/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: db77fbabf914f5165a6be32f58fe0ebbe9940531 X-VCS-Branch: master Date: Sat, 10 Mar 2018 18:44:36 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 01560fc6-a18f-41e7-9133-f32b08edccbe X-Archives-Hash: 52fa81edf62738ff7468221305ae1a7f commit: db77fbabf914f5165a6be32f58fe0ebbe9940531 Author: Fabian Groffen gentoo org> AuthorDate: Sat Mar 10 18:43:02 2018 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sat Mar 10 18:43:02 2018 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=db77fbab scripts/bootstrap-bash: copy efetch behaviour from bootstrap-prefix ftp may not be available or working, so try the fallback behaviour from bootstrap-prefix. Patch based on patch by Askar Bektassov (Аскар Бектасов) scripts/bootstrap-bash.sh | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/scripts/bootstrap-bash.sh b/scripts/bootstrap-bash.sh index be0b36d831..a3d78afea0 100755 --- a/scripts/bootstrap-bash.sh +++ b/scripts/bootstrap-bash.sh @@ -8,7 +8,10 @@ # dynamic function calling. So, we need to bootstrap bash outside the # bootstrap script, which is the purpose of this script. -[ -z "$1" ] && exit -1 +if [ -z "$1" ] ; then + echo "usage: ${0} " > /dev/stderr + exit -1 +fi mkdir -p "$1" cd "$1" @@ -17,7 +20,34 @@ cd bash-build GENTOO_MIRRORS=${GENTOO_MIRRORS:="http://distfiles.gentoo.org/distfiles"} -ftp "${GENTOO_MIRRORS}/bash-4.2.tar.gz" +if [ ! -e bash-4.2.tar.gz ] ; then + eerror() { echo "!!! $*" 1>&2; } + einfo() { echo "* $*"; } + + if [ -z ${FETCH_COMMAND} ] ; then + # Try to find a download manager, we only deal with wget, + # curl, FreeBSD's fetch and ftp. + if [ x$(type -t wget) == "xfile" ] ; then + FETCH_COMMAND="wget" + [ $(wget -h) == *"--no-check-certificate"* ] && FETCH_COMMAND+=" --no-check-certificate" + elif [ x$(type -t curl) == "xfile" ] ; then + einfo "WARNING: curl doesn't fail when downloading fails, please check its output carefully!" + FETCH_COMMAND="curl -f -L -O" + elif [ x$(type -t fetch) == "xfile" ] ; then + FETCH_COMMAND="fetch" + elif [ x$(type -t ftp) == "xfile" ] && + [ ${CHOST} != *-cygwin* || ! $(type -P ftp) -ef $(cygpath -S)/ftp ] ; then + FETCH_COMMAND="ftp" + else + eerror "no suitable download manager found (need wget, curl, fetch or ftp)" + eerror "could not download ${1##*/}" + eerror "download the file manually, and put it in ${PWD}" + exit 1 + fi + fi + ${FETCH_COMMAND} "${GENTOO_MIRRORS}/bash-4.2.tar.gz" < /dev/null +fi + gzip -d bash-4.2.tar.gz tar -xf bash-4.2.tar cd bash-4.2