commit: fda55219e37e3fb4dcb7768802330907cc1af405 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> AuthorDate: Mon Jun 1 09:49:13 2020 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Mon Jun 1 09:55:00 2020 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=fda55219
scripts/bootstrap-prefix: rework efetch(ing) logic somewhat 1) distfiles are in transitioning to hash-based subdir layout 2) distfiles cannot be manually appended to any more To fix 1) use redirection service from distfiles.prefix.b.n to simply calculate the hash, so our existing calls will keep working. To fix 2) use same redirection service, but on /prefix url, that points to a local distfiles mirror for missing files, hopefully providing what's missing The order in efetch tries things now is a bit odd and long, but avoids using the redirection service: 1) try GENTOO_MIRRORS provided hosts, or http://distfiles.g.o when unset 2) try http://distfiles.prefix.b.n to redirect to distfiles (for when the hash approach becomes mandatory) 3) try http://distfiles.prefix.b.n/prefix to redirect to prefix-local distfiles (using the same hash approach) 4) try the original source location Bug: https://bugs.gentoo.org/726462 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> scripts/bootstrap-prefix.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index 42f66eb9bb..4ca56caef4 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -70,7 +70,7 @@ efetch() { # try for mirrors first, fall back to distfiles, then try given location local locs=( ) local loc - for loc in ${GENTOO_MIRRORS} ; do + for loc in ${GENTOO_MIRRORS} ${DISTFILES_G_O} ${DISTFILES_PFX}; do locs=( "${locs[@]}" "${loc}/distfiles/${1##*/}" @@ -579,7 +579,8 @@ do_tree() { # respect the source to get the latest if [[ -n ${LATEST_TREE_YES} ]] ; then echo "$1" - ( export GENTOO_MIRRORS= ; efetch "$1/$2" ) || return 1 + ( export GENTOO_MIRRORS= DISTFILES_G_O= DISTFILES_PFX= ; + efetch "$1/$2" ) || return 1 else efetch "$1/$2" || return 1 fi @@ -2104,8 +2105,9 @@ set_helper_vars() { PORTAGE_TMPDIR=${PORTAGE_TMPDIR:-${ROOT}/var/tmp} DISTFILES_URL=${DISTFILES_URL:-"http://dev.gentoo.org/~grobian/distfiles"} GNU_URL=${GNU_URL:="http://ftp.gnu.org/gnu"} - DISTFILES_G_O="http://distfiles.gentoo.org" - GENTOO_MIRRORS=${GENTOO_MIRRORS:=${DISTFILES_G_O}} + DISTFILES_G_O="http://distfiles.prefix.gentoo.org" + DISTFILES_PFX="http://distfiles.prefix.gentoo.org/prefix" + GENTOO_MIRRORS=${GENTOO_MIRRORS:="http://distfiles.gentoo.org"} 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"
