Abacn commented on code in PR #37270:
URL: https://github.com/apache/beam/pull/37270#discussion_r2677186260


##########
sdks/java/container/license_scripts/pull_licenses_java.py:
##########
@@ -58,86 +58,90 @@ def pull_from_url(file_name, url, dep, no_list, 
use_cache=False):
     if url == 'skip':
         return
 
-    # Replace file path with absolute path to manual licenses
-    if url.startswith('file://{}'):
-        url = url.format(manual_license_path)
-        logging.info('Replaced local file URL with {url} for 
{dep}'.format(url=url, dep=dep))
-
-    # Take into account opensource.org changes that cause 404 on licenses
-    if 'opensource.org' in url and url.endswith('-license.php'):
-        url = url.replace('-license.php', '')
-
-    if use_cache:
-        md5sum = hashlib.md5(url.encode()).hexdigest()
-        if md5sum not in CACHED_LICENSES:
-            pulled_file_name = cached_license_path + "/" + md5sum
-            logging.info(f"Requested license {url} not in cache. Pulling it 
into {pulled_file_name}")
+    # Split the url string by commas in case of multiple/dual licenses
+    urls_to_try = [u.strip() for u in url.split(',')]

Review Comment:
   I see, "moduleLicense" field indeed has "OR". This could potentially break 
SOURCE_CODE_REQUIRED_LICENSES logic here:
   
   
https://github.com/apache/beam/blob/58c2b331948be340b305df8c6cdb631839627b5b/sdks/java/container/license_scripts/pull_licenses_java.py#L256
   
   saying it's dual licensed with both `SOURCE_CODE_REQUIRED_LICENSES`, we no 
longer detect it as source code required.
   
   If his happens, we probably treat dual license case-by-case, that is to 
maintain a list of dual licensed dependency and prefer one license.
   
   cc: @damccorm 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to