diff options
author | Alexis Christoforides <alexis@thenull.net> | 2018-02-21 21:04:07 +0300 |
---|---|---|
committer | Alexis Christoforides <alexis@thenull.net> | 2018-02-22 15:59:50 +0300 |
commit | c61bca98dcc7490a728896b1114600968aa0d644 (patch) | |
tree | 11a5798ab7a1fc11c000753a7a4c3ec1fd17b99d /bockbuild | |
parent | dbe4185d21318a1c09d35c878b560176ac02c2b3 (diff) |
Use 'curl' tool instead of Python's library for downloading, as it does not support TLS 1.2.
Diffstat (limited to 'bockbuild')
-rw-r--r-- | bockbuild/package.py | 18 | ||||
-rw-r--r-- | bockbuild/util/util.py | 2 |
2 files changed, 5 insertions, 15 deletions
diff --git a/bockbuild/package.py b/bockbuild/package.py index f719d17..263e001 100644 --- a/bockbuild/package.py +++ b/bockbuild/package.py @@ -12,15 +12,6 @@ from util.util import * import functools -# FancyURLopener is incorrectly documented; this working handler was -# copied from -# https://mail.python.org/pipermail/python-bugs-list/2006-February/032155.html -class MyUrlOpener(urllib.FancyURLopener): - - def http_error_default(*args, **kwargs): - return urllib.URLopener.http_error_default(*args, **kwargs) - - class Package: def __init__(self, name, version=None, organization=None, configure_flags=None, sources=None, revision=None, git_branch=None, source_dir_name=None, override_properties=None, configure=None): @@ -292,11 +283,10 @@ class Package: def checkout_archive(archive, cache_dest, workspace_dir): def create_cache(): progress('Downloading: %s' % archive) - try: - filename, message = MyUrlOpener().retrieve(archive, cache_dest) - except IOError as e: - raise CommandException( - '%s error downloading %s' % (e[1], archive)) + curl_bin = which('curl') + if not curl_bin: + error('curl not found in PATH') + run (curl_bin,['-L','-o', cache_dest, archive], None) def update_cache(): pass diff --git a/bockbuild/util/util.py b/bockbuild/util/util.py index 9fe76b8..15a8cef 100644 --- a/bockbuild/util/util.py +++ b/bockbuild/util/util.py @@ -674,7 +674,7 @@ def run(cmd, args, cwd, env=None): proc = subprocess.Popen(cmd_list, shell=False, cwd=cwd, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE) except Exception as e: - error(e) + error(str(e)) stdout, stderr = proc.communicate() exit_code = proc.returncode |