Changeset 244513 in webkit


Ignore:
Timestamp:
Apr 22, 2019 3:07:47 PM (5 years ago)
Author:
dean_johnson@apple.com
Message:

Use curl to download packages for webkitpy autoinstaller
https://bugs.webkit.org/show_bug.cgi?id=197164

Reviewed by Darin Adler.

  • Scripts/webkitpy/common/system/autoinstall.py:

(AutoInstaller._download): Use curl(1) to download packages necessary for
webkitpy/thirdparty/autoinstalled since Python2's urllib2 module can result in unnecessary
errors which are not present when using curl(1).

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r244510 r244513  
     12019-04-22  Dean Johnson  <dean_johnson@apple.com>
     2
     3        Use curl to download packages for webkitpy autoinstaller
     4        https://bugs.webkit.org/show_bug.cgi?id=197164
     5
     6        Reviewed by Darin Adler.
     7
     8        * Scripts/webkitpy/common/system/autoinstall.py:
     9        (AutoInstaller._download): Use curl(1) to download packages necessary for
     10        webkitpy/thirdparty/autoinstalled since Python2's urllib2 module can result in unnecessary
     11        errors which are not present when using curl(1).
     12
    1132019-04-22  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/Tools/Scripts/webkitpy/common/system/autoinstall.py

    r244310 r244513  
    4747from glob import glob
    4848import urlparse
     49import subprocess
    4950
    5051
     
    419420
    420421        target_path = os.path.join(scratch_dir, target_filename)
    421         with open(target_path, "wb") as stream:
    422             self._download_to_stream(url, stream)
     422
     423        if os.name == 'posix':
     424            try:
     425                command = ['curl', url, '-L', '--output', target_path]
     426                with open(os.devnull, 'w') as devnull:
     427                    subprocess.check_call(command, stdout=devnull, stderr=devnull)
     428            except subprocess.CalledProcessError as e:
     429                _log.info('Error: Failed to download {} to {}. Command: {}'.format(url, target_path, command))
     430                raise
     431        else:  # Windows
     432            with open(target_path, "wb") as stream:
     433                self._download_to_stream(url, stream)
    423434
    424435        if _CACHE_ENV_VAR in os.environ:
Note: See TracChangeset for help on using the changeset viewer.