Skip to content

Commit 9136359

Browse files
jbergstroemjasnell
authored andcommitted
build: make icu download path customizable
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 <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
1 parent d4fc6d9 commit 9136359

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

configure

+11-1
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ intl_optgroup.add_option('--download',
296296
dest='download_list',
297297
help=nodedownload.help())
298298

299+
intl_optgroup.add_option('--download-path',
300+
action='store',
301+
dest='download_path',
302+
default=os.path.join(root_dir, 'deps'),
303+
help='Download directory [default: %default]')
304+
299305
parser.add_option_group(intl_optgroup)
300306

301307
parser.add_option('--with-perfctr',
@@ -844,11 +850,15 @@ def configure_intl(o):
844850
]
845851
def icu_download(path):
846852
# download ICU, if needed
853+
if not os.access(options.download_path, os.W_OK):
854+
print 'Error: cannot write to desired download path. ' \
855+
'Either create it or verify permissions.'
856+
sys.exit(1)
847857
for icu in icus:
848858
url = icu['url']
849859
md5 = icu['md5']
850860
local = url.split('/')[-1]
851-
targetfile = os.path.join(root_dir, 'deps', local)
861+
targetfile = os.path.join(options.download_path, local)
852862
if not os.path.isfile(targetfile):
853863
if nodedownload.candownload(auto_downloads, "icu"):
854864
nodedownload.retrievefile(url, targetfile)

0 commit comments

Comments
 (0)