Skip to content

Commit

Permalink
explain why we need to obtain the extension and improve cond expr
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed Oct 3, 2024
1 parent 044e168 commit f983fed
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,13 @@ def replace_non_distributable_files_with_symlinks(log, install_dir, package, all
if not os.path.islink(full_path):
# check if the current file name stub is part of the allowlist
basename = filename.split('.')[0]
if extension_based[package]:
if '.' in filename:
extension = '.' + filename.split('.')[1]
if extension_based[package] and '.' in filename:
# if the allowlist only contains extensions, we have to
# determine that from filename. we assume the extension is
# the second element when splitting the filename at dots
# (e.g., for 'libcudnn_adv_infer.so.8.9.2' the extension
# would be '.so')
extension = '.' + filename.split('.')[1]
if basename in allowlist:
log.debug("%s is found in allowlist, so keeping it: %s", basename, full_path)
elif extension_based[package] and '.' in filename and extension in allowlist:
Expand Down

0 comments on commit f983fed

Please sign in to comment.