#
# usage: jldownload [<output-filename>] <url>
#
+set -x
CACHE_HOST=https://cache.julialang.org
# 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
+#$GETURL $CACHE_URL || $GETURL $URL
+DEST_URL=$(echo "$GETURL"|awk '{print $NF}'|sed 's#^.*file://##')
+ORIG_URL=$(echo "$URL"|awk '{print $NF}'|sed 's#^.*file://##')
+CP=$(which cp)
+$CP "$ORIG_URL" "$DEST_URL"