commit:     01c51c1f3c8868e6b8c6a59c84304d971cd4aea7
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 25 08:01:44 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Mar 25 08:01:44 2019 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=01c51c1f

scripts/bootstrap-prefix: ensure we don't use mirrors for latest tree

In do_tree, ensure that we don't end up using mirrors to fetch a daily
snapshot.  The purpose of those is to be fresh, so we don't want a stale
copy.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 7cb83cf84d..c91f6393e4 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -554,10 +554,18 @@ do_tree() {
 
        mkdir -p "${PORTDIR}"
        if [[ ! -e ${PORTDIR}/.unpacked ]]; then
-               efetch "$1/$2" || return 1
+               # latest tree cannot be fetched from mirrors, always have to
+               # respect the source to get the latest
+               if [[ -n ${LATEST_TREE_YES} ]] ; then
+                       echo "$1"
+                       ( export GENTOO_MIRRORS= ; efetch "$1/$2" ) || return 1
+               else
+                       efetch "$1/$2" || return 1
+               fi
                [[ -e ${PORTDIR} ]] || mkdir -p ${PORTDIR}
                einfo "Unpacking, this may take a while"
-               bzip2 -dc ${DISTDIR}/$2 | tar -xf - -C ${PORTDIR} 
--strip-components=1 || return 1
+               bzip2 -dc ${DISTDIR}/$2 | \
+                       tar -xf - -C ${PORTDIR} --strip-components=1 || return 1
                touch ${PORTDIR}/.unpacked
        fi
 }
@@ -2036,7 +2044,7 @@ set_helper_vars() {
        GNU_URL=${GNU_URL:="http://ftp.gnu.org/gnu"}
        DISTFILES_G_O="http://distfiles.gentoo.org";
        GENTOO_MIRRORS=${GENTOO_MIRRORS:=${DISTFILES_G_O}}
-       SNAPSHOT_HOST=$(rapx ${GENTOO_MIRRORS} http://rsync.prefix.bitzolder.nl)
+       SNAPSHOT_HOST=$(rapx ${DISTFILES_G_O} http://rsync.prefix.bitzolder.nl)
        SNAPSHOT_URL=${SNAPSHOT_URL:-"${SNAPSHOT_HOST}/snapshots"}
        
GCC_APPLE_URL="http://www.opensource.apple.com/darwinsource/tarballs/other";
 

Reply via email to