about summary refs log tree commit diff
path: root/src/etc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-07-02 20:58:57 -0700
committerbors <bors@rust-lang.org>2013-07-02 20:58:57 -0700
commitfc02d69e9616c2aa119c223b01a19b7d8fd8063d (patch)
treed0191951ad5eedbdee3029a974864840d19c66c7 /src/etc
parentab34864a304fa364dc91bf16988e272e93de8d62 (diff)
parent9c3ef892f90289b6af77cbfe6c50dfb56eeb4c17 (diff)
auto merge of #7498 : luqmana/rust/cow, r=catamorphism
Either one works and wget is easier to setup on windows.
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/snapshot.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/etc/snapshot.py b/src/etc/snapshot.py
index 608dbdcca5d..36b00a3dedf 100644
--- a/src/etc/snapshot.py
+++ b/src/etc/snapshot.py
@@ -1,6 +1,6 @@
 # xfail-license
 
-import re, os, sys, glob, tarfile, shutil, subprocess, tempfile
+import re, os, sys, glob, tarfile, shutil, subprocess, tempfile, distutils.spawn
 
 try:
   import hashlib
@@ -132,7 +132,13 @@ def local_rev_committer_date():
 def get_url_to_file(u,f):
     # no security issue, just to stop partial download leaving a stale file
     tmpf = f + '.tmp'
-    returncode = subprocess.call(["curl", "-o", tmpf, u])
+
+    returncode = -1
+    if distutils.spawn.find_executable("curl"):
+        returncode = subprocess.call(["curl", "-o", tmpf, u])
+    elif distutils.spawn.find_executable("wget"):
+        returncode = subprocess.call(["wget", "-O", tmpf, u])
+
     if returncode != 0:
         os.unlink(tmpf)
         raise