Skip to content

Commit 58c2b33

Browse files
committed
Update to upstream caller
1 parent 139724d commit 58c2b33

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

sdks/java/container/license_scripts/pull_licenses_java.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def pull_from_url(file_name, url, dep, no_list, use_cache=False):
137137
if use_cache:
138138
CACHED_LICENSES.add(os.path.basename(pulled_file_name))
139139
logging.info(f"Copying {pulled_file_name} -> {file_name}")
140-
shutil.copy(pull_file_name, file_name)
140+
shutil.copy(pulled_file_name, file_name)
141141

142142
def pull_source_code(base_url, dir_name, dep):
143143
# base_url example: https://repo1.maven.org/maven2/org/mortbay/jetty/jsp-2.1/6.1.14/
@@ -189,7 +189,7 @@ def execute(dep):
189189
"moduleLicenseUrl": "http://www.antlr.org/license.html"
190190
}
191191
'''
192-
192+
logging.debug("Dep: %s", dep)
193193
name = dep['moduleName'].split(':')[1]
194194
version = dep['moduleVersion']
195195
name_version = name + '-' + version
@@ -218,8 +218,14 @@ def execute(dep):
218218
with thread_lock:
219219
no_licenses.append(name_version)
220220
license_url = 'skip'
221-
pull_from_url(dir_name + '/LICENSE', license_url, name_version,
222-
no_licenses, use_cache=use_license_cache)
221+
222+
# Split the url string by commas in case of multiple/dual licenses
223+
# NOTE: If license doesn't have a ',', this is a no-op.
224+
# TODO: Do we only download our preferred one?
225+
license_urls = [u.strip() for u in license_url.split(',')]
226+
for license_url in license_urls:
227+
pull_from_url(dir_name + '/LICENSE', license_url, name_version,
228+
no_licenses, use_cache=use_license_cache)
223229
# pull notice
224230
try:
225231
notice_url = dep_config[name][version]['notice']

0 commit comments

Comments
 (0)