auto merge of #7498 : luqmana/rust/cow, r=catamorphism

Either one works and wget is easier to setup on windows.
This commit is contained in:
bors 2013-07-02 20:58:57 -07:00
commit fc02d69e96
2 changed files with 9 additions and 3 deletions

2
configure vendored
View File

@ -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)

View 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