aboutsummaryrefslogtreecommitdiffstats
path: root/ez_setup.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-08-10 12:35:20 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-08-10 12:35:20 -0400
commit87a0b2190cb40c18f5dd98e7842c197e17a452e2 (patch)
treef14cfff3feac1026d6c7f7baf50a4818b925ac9a /ez_setup.py
parente29ad44c0a1e8025c154c9afb4418f143019379f (diff)
downloadexternal_python_setuptools-87a0b2190cb40c18f5dd98e7842c197e17a452e2.tar.gz
external_python_setuptools-87a0b2190cb40c18f5dd98e7842c197e17a452e2.tar.bz2
external_python_setuptools-87a0b2190cb40c18f5dd98e7842c197e17a452e2.zip
Implemented curl support for bootstrapping.
Diffstat (limited to 'ez_setup.py')
-rw-r--r--ez_setup.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/ez_setup.py b/ez_setup.py
index 98d15f22..3b086260 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -159,6 +159,20 @@ download_file_powershell.viable = (
lambda: platform.name() == 'Windows' and platform.win32_ver()[1] >= '6'
)
+def download_file_curl(url, target):
+ cmd = ['curl %(url)r -o %(target)s']
+ subprocess.check_call(cmd)
+
+def has_curl():
+ cmd = ['curl --version']
+ try:
+ subprocess.check_call(cmd)
+ except:
+ return False
+ return True
+
+download_file_curl.viable = has_curl
+
def download_file_insecure(url, target):
"""
Use Python to download the file, even though it cannot authenticate the
@@ -187,7 +201,7 @@ download_file_insecure.viable = lambda: True
def get_best_downloader():
downloaders = [
download_file_powershell,
- #download_file_curl,
+ download_file_curl,
#download_file_wget,
download_file_insecure,
]