Skip to content

Commit

Permalink
build: make icu download path customizable
Browse files Browse the repository at this point in the history
This makes it easier to store icu tarballs outside of the node.js
directory which is useful in our CI where git directories are
scrubbed between runs.

PR-URL: #3200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
  • Loading branch information
jbergstroem committed Oct 8, 2015
1 parent 35cdded commit a214905
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion configure
Expand Up @@ -296,6 +296,12 @@ intl_optgroup.add_option('--download',
dest='download_list',
help=nodedownload.help())

intl_optgroup.add_option('--download-path',
action='store',
dest='download_path',
default=os.path.join(root_dir, 'deps'),
help='Download directory [default: %default]')

parser.add_option_group(intl_optgroup)

parser.add_option('--with-perfctr',
Expand Down Expand Up @@ -844,11 +850,15 @@ def configure_intl(o):
]
def icu_download(path):
# download ICU, if needed
if not os.access(options.download_path, os.W_OK):
print 'Error: cannot write to desired download path. ' \
'Either create it or verify permissions.'
sys.exit(1)
for icu in icus:
url = icu['url']
md5 = icu['md5']
local = url.split('/')[-1]
targetfile = os.path.join(root_dir, 'deps', local)
targetfile = os.path.join(options.download_path, local)
if not os.path.isfile(targetfile):
if nodedownload.candownload(auto_downloads, "icu"):
nodedownload.retrievefile(url, targetfile)
Expand Down

0 comments on commit a214905

Please sign in to comment.