Skip to content

Commit

Permalink
Merge pull request #77 from scikit-build/more-robust-travis-cmake-ins…
Browse files Browse the repository at this point in the history
…tall

travis/install_cmake: Attempt to use curl if it failed with wget
  • Loading branch information
jcfr committed Aug 25, 2018
2 parents e3b4754 + d112e3f commit fd33d5f
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions travis/install_cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,20 @@ def install(cmake_version=DEFAULT_CMAKE_VERSION, is_darwin=False):
_log(" ->", "done")

_log("Downloading", cmake_package)
check_output([
"wget", "--no-check-certificate", "--progress=dot",
"https://cmake.org/files/v{}.{}/{}".format(
cmake_version_major, cmake_version_minor, cmake_package),
"-P", download_dir
], stderr=subprocess.STDOUT)
try:
check_output([
"wget", "--no-check-certificate", "--progress=dot",
"https://cmake.org/files/v{}.{}/{}".format(
cmake_version_major, cmake_version_minor, cmake_package),
"-P", download_dir
], stderr=subprocess.STDOUT)
except (OSError, CalledProcessError):
check_output([
"curl", "--progress-bar", "-L",
"https://cmake.org/files/v{}.{}/{}".format(
cmake_version_major, cmake_version_minor, cmake_package),
"-o", downloaded_package
], stderr=subprocess.STDOUT)
_log(" ->", "done")

else:
Expand Down

0 comments on commit fd33d5f

Please sign in to comment.