Fix Travis failures due to redirects when downloading PhantomJS.

This commit is contained in:
Vladislav Manchev 2016-03-23 02:17:32 +02:00 committed by Tim Abbott
parent 965f923ac3
commit 294030ca04
1 changed files with 2 additions and 1 deletions

View File

@ -40,6 +40,7 @@ APT_DEPENDENCIES = {
"ca-certificates", # Explicit dependency in case e.g. wget is already installed
"puppet", # Used by lint-all
"gettext", # Used by makemessages i18n
"curl", # Used for fetching PhantomJS as wget occasionally fails on redirects
]
}
@ -124,7 +125,7 @@ def main():
PHANTOMJS_URL = "https://bitbucket.org/ariya/phantomjs/downloads/%s" % (PHANTOMJS_TARBALL_BASENAME,)
sh.mkdir("-p", PHANTOMJS_PATH, **LOUD)
if not os.path.exists(PHANTOMJS_TARBALL):
sh.wget(PHANTOMJS_URL, output_document=PHANTOMJS_TARBALL, **LOUD)
sh.curl('-J', '-L', PHANTOMJS_URL, o=PHANTOMJS_TARBALL, **LOUD)
sh.tar("xj", directory=PHANTOMJS_PATH, file=PHANTOMJS_TARBALL, **LOUD)
sh.ln("-sf", os.path.join(PHANTOMJS_PATH, PHANTOMJS_BASENAME, "bin", "phantomjs"),
"/usr/local/bin/phantomjs", **LOUD)