Skip to content

Commit 8b75161

Browse files
committed
Merge pull request #10302 from JuliaLang/sf/jldownload_cache
Update `jldownload` to use the caching server
2 parents 93af265 + 1263d39 commit 8b75161

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ before_install:
2828
brew tap staticfloat/julia;
2929
brew rm --force $(brew deps --HEAD julia);
3030
brew update;
31-
sed -i '' -e "s@https://downloads.sf.net/project/machomebrew/Bottles@http://cache.e.ip.saba.us/https://downloads.sf.net/project/machomebrew/Bottles@" /usr/local/Library/Homebrew/software_spec.rb;
32-
sed -i '' -e "s@https://homebrew.bintray.com@http://cache.e.ip.saba.us/https://homebrew.bintray.com@" /usr/local/Library/Homebrew/software_spec.rb;
31+
sed -i '' -e "s@https://downloads.sf.net/project/machomebrew/Bottles@https://cache.e.ip.saba.us/https://downloads.sf.net/project/machomebrew/Bottles@" /usr/local/Library/Homebrew/software_spec.rb;
32+
sed -i '' -e "s@https://homebrew.bintray.com@https://cache.e.ip.saba.us/https://homebrew.bintray.com@" /usr/local/Library/Homebrew/software_spec.rb;
3333
brew install -v --only-dependencies --HEAD julia;
3434
BUILDOPTS="USECLANG=1 LLVM_CONFIG=$(brew --prefix llvm33-julia)/bin/llvm-config-3.3 VERBOSE=1 USE_BLAS64=0 SUITESPARSE_INC=-I$(brew --prefix suite-sparse-julia)/include";
3535
BUILDOPTS="$BUILDOPTS LIBBLAS=-lopenblas LIBBLASNAME=libopenblas LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas";

deps/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ compile-patchelf: install-patchelf
16871687
install-patchelf: $(PATCHELF_TARGET)
16881688

16891689
patchelf-$(PATCHELF_VER).tar.gz:
1690-
$(JLDOWNLOAD) $@ https://ia601003.us.archive.org/29/items/julialang/mirror/patchelf-$(PATCHELF_VER).tar.gz
1690+
$(JLDOWNLOAD) $@ http://nixos.org/releases/patchelf/patchelf-$(PATCHELF_VER)/patchelf-$(PATCHELF_VER).tar.gz
16911691
patchelf-$(PATCHELF_VER)/configure: patchelf-$(PATCHELF_VER).tar.gz
16921692
$(JLCHECKSUM) $<
16931693
$(TAR) zxf $<

deps/jldownload

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# usage: jldownload [<output-filename>] <url>
44
#
55

6-
MIRROR_HOST=http://d304tytmzqn1fl.cloudfront.net
6+
CACHE_HOST=https://cache.e.ip.saba.us
77

88
WGET=$(which wget 2>/dev/null)
99
CURL=$(which curl 2>/dev/null)
@@ -26,8 +26,7 @@ else
2626
exit 1
2727
fi
2828

29-
MIRROR_BASENAME=`basename $1`
30-
MIRROR_URL="$MIRROR_HOST/$MIRROR_BASENAME"
29+
CACHE_URL="$CACHE_HOST/$2"
3130

3231
if [ -x "$CURL" ] && $CURL -V >/dev/null; then
3332
GETURL="$CURL $CURL_OPTS"
@@ -41,12 +40,8 @@ else
4140
exit 1
4241
fi
4342

44-
if [ -z "$JLDOWNLOAD_PREFER_MIRROR" ]; then
45-
$GETURL $URL || $GETURL $MIRROR_URL
46-
else
47-
# Still try downloading from the original URL if the mirror fails.
48-
# User may want to get around a single failure, only to run into a dep
49-
# that we haven't mirrored yet, so better to be safe than sorry and try
50-
# the original URL in that case
51-
$GETURL $MIRROR_URL || $GETURL $URL
52-
fi
43+
# Try to get from the cache if it is possible. Note that the cache will
44+
# forward to the original URL if it has not cached this download yet, or
45+
# if the URL is not cacheable. We fallback to directly querying the
46+
# uncached URL to protect against cache service downtime
47+
$GETURL $CACHE_URL || $GETURL $URL

0 commit comments

Comments
 (0)