Skip to content

Commit

Permalink
Merge pull request JuliaLang#10302 from JuliaLang/sf/jldownload_cache
Browse files Browse the repository at this point in the history
Update `jldownload` to use the caching server
  • Loading branch information
staticfloat committed Feb 26, 2015
2 parents 93af265 + 1263d39 commit 8b75161
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ before_install:
brew tap staticfloat/julia;
brew rm --force $(brew deps --HEAD julia);
brew update;
sed -i '' -e "s@https://downloads.sf.net/project/machomebrew/Bottles@http:https://cache.e.ip.saba.us/https://downloads.sf.net/project/machomebrew/Bottles@" /usr/local/Library/Homebrew/software_spec.rb;
sed -i '' -e "s@https://homebrew.bintray.com@http:https://cache.e.ip.saba.us/https://homebrew.bintray.com@" /usr/local/Library/Homebrew/software_spec.rb;
sed -i '' -e "s@https://downloads.sf.net/project/machomebrew/Bottles@https:https://cache.e.ip.saba.us/https://downloads.sf.net/project/machomebrew/Bottles@" /usr/local/Library/Homebrew/software_spec.rb;
sed -i '' -e "s@https://homebrew.bintray.com@https:https://cache.e.ip.saba.us/https://homebrew.bintray.com@" /usr/local/Library/Homebrew/software_spec.rb;
brew install -v --only-dependencies --HEAD julia;
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";
BUILDOPTS="$BUILDOPTS LIBBLAS=-lopenblas LIBBLASNAME=libopenblas LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas";
Expand Down
2 changes: 1 addition & 1 deletion deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ compile-patchelf: install-patchelf
install-patchelf: $(PATCHELF_TARGET)

patchelf-$(PATCHELF_VER).tar.gz:
$(JLDOWNLOAD) $@ https:https://ia601003.us.archive.org/29/items/julialang/mirror/patchelf-$(PATCHELF_VER).tar.gz
$(JLDOWNLOAD) $@ http:https://nixos.org/releases/patchelf/patchelf-$(PATCHELF_VER)/patchelf-$(PATCHELF_VER).tar.gz
patchelf-$(PATCHELF_VER)/configure: patchelf-$(PATCHELF_VER).tar.gz
$(JLCHECKSUM) $<
$(TAR) zxf $<
Expand Down
19 changes: 7 additions & 12 deletions deps/jldownload
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# usage: jldownload [<output-filename>] <url>
#

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

WGET=$(which wget 2>/dev/null)
CURL=$(which curl 2>/dev/null)
Expand All @@ -26,8 +26,7 @@ else
exit 1
fi

MIRROR_BASENAME=`basename $1`
MIRROR_URL="$MIRROR_HOST/$MIRROR_BASENAME"
CACHE_URL="$CACHE_HOST/$2"

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

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

0 comments on commit 8b75161

Please sign in to comment.