Skip to content

Commit 3210dd2

Browse files
author
Benedikt Hegner
committed
use mirrors for downloading binary tarballs
1 parent 8324fcf commit 3210dd2

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

lib/spack/spack/binary_distribution.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,16 @@ def download_tarball(package):
6666
Download binary tarball for given package into stage area
6767
Return True if successful
6868
"""
69-
try:
70-
download_url = os.environ["SPACK_DOWNLOAD_URL"]
71-
except KeyError:
72-
tty.die("Please set the SPACK_DOWNLOAD_URL environment variable for downloading pre-compiled packages.")
73-
74-
tarball = tarball_name(package.spec)
75-
remote_tarball = os.path.join(download_url, tarball)
76-
69+
if len(spack.config.get_config('mirrors')) == 0:
70+
tty.die("Please add a spack mirror to allow download of pre-compiled packages.")
71+
7772
# stage the tarball into standard place
78-
# TODO: may make this a part of the package class
79-
stage = Stage(remote_tarball,name=package.stage.path)
73+
tarball = tarball_name(package.spec)
74+
stage = Stage(tarball,name=package.stage.path,mirror_path=tarball)
8075
try:
81-
stage.fetch()
76+
stage.fetch(mirror_only = True)
8277
return True
8378
except fs.FetchError:
84-
tty.warn("No binary package for %s found." %package.name)
8579
return False
8680

8781
def extract_tarball(package):

lib/spack/spack/package.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,8 +889,8 @@ def do_install(self,
889889
elif install_policy == "download":
890890
tty.die("Download of binary package for %s failed." %self.name)
891891
else:
892-
pass
893-
892+
tty.warn("No binary package for %s found." %self.name)
893+
894894
if not fake and not install_binary:
895895
if not skip_patch:
896896
self.do_patch()

0 commit comments

Comments
 (0)