d-dont-download-stage0
authorRust Maintainers <pkg-rust-maintainers@lists.alioth.debian.org>
Mon, 6 Nov 2017 09:03:32 +0000 (09:03 +0000)
committerXimin Luo <infinity0@debian.org>
Mon, 6 Nov 2017 09:03:32 +0000 (09:03 +0000)
Gbp-Pq: Name d-dont-download-stage0.patch

configure
src/bootstrap/bootstrap.py

index 664b473b2c9d00e9452fe55b55bab6ccc9b15037..d68f27bc8f2786e1808d2af5451618f87e3ffdff 100755 (executable)
--- a/configure
+++ b/configure
@@ -614,7 +614,6 @@ if [ -n "$CFG_ENABLE_DEBUG_JEMALLOC" ]; then putvar CFG_ENABLE_DEBUG_JEMALLOC; f
 
 step_msg "looking for build programs"
 
-probe_need CFG_CURL curl
 if [ -z "$CFG_PYTHON_PROVIDED" ]; then
     probe_need CFG_PYTHON      python2.7 python2 python
 fi
index ef8d55c6b2ff9f76fb57ee8e1dd6deeea98d7024..e9cff5357a22a31d90f6208fede0af0fd99f4b2c 100644 (file)
@@ -24,16 +24,18 @@ import tempfile
 from time import time
 
 
-def get(url, path, verbose=False):
+def get(url, path, verbose=False, use_local_hash_if_present=True):
     suffix = '.sha256'
     sha_url = url + suffix
     with tempfile.NamedTemporaryFile(delete=False) as temp_file:
         temp_path = temp_file.name
-    with tempfile.NamedTemporaryFile(suffix=suffix, delete=False) as sha_file:
-        sha_path = sha_file.name
+    sha_path = path + suffix
 
     try:
-        download(sha_path, sha_url, False, verbose)
+        if use_local_hash_if_present and os.path.exists(sha_path):
+            print("using already-download file " + sha_path)
+        else:
+            download(sha_path, sha_url, False, verbose)
         if os.path.exists(path):
             if verify(path, sha_path, False):
                 if verbose:
@@ -51,7 +53,6 @@ def get(url, path, verbose=False):
             print("moving {} to {}".format(temp_path, path))
         shutil.move(temp_path, path)
     finally:
-        delete_if_present(sha_path, verbose)
         delete_if_present(temp_path, verbose)
 
 
@@ -239,7 +240,7 @@ class RustBuild(object):
 
         url = "{}/dist/{}".format(self._download_url, self.date)
         tarball = os.path.join(rustc_cache, filename)
-        if not os.path.exists(tarball):
+        if True:
             get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
         unpack(tarball, self.bin_root(), match=pattern, verbose=self.verbose)