]> git.lizzy.rs Git - rust.git/commitdiff
configure: Require one of wget or curl.
authorLuqman Aden <laden@csclub.uwaterloo.ca>
Sun, 30 Jun 2013 02:22:20 +0000 (22:22 -0400)
committerLuqman Aden <laden@csclub.uwaterloo.ca>
Sun, 30 Jun 2013 06:08:02 +0000 (02:08 -0400)
configure
src/etc/snapshot.py

index d0a98fbfa75c4e623fb30f466df5ce9dcbdaeacf..12782fa9fdb626a23115e0d15c0ab88c1865c8b3 100755 (executable)
--- a/configure
+++ b/configure
@@ -402,7 +402,7 @@ fi
 step_msg "looking for build programs"
 
 probe_need CFG_PERL        perl
-probe_need CFG_CURL        curl
+probe_need CFG_CURLORWGET  curl wget
 probe_need CFG_PYTHON      python2.7 python2.6 python2 python
 
 python_version=$($CFG_PYTHON -V 2>&1)
index 608dbdcca5d2c7f59c272ece03c902bf4fc7c55a..36b00a3dedf2cdd7579d8bd206e62328778da3ab 100644 (file)
@@ -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