diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2022-03-23 10:31:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-23 10:31:23 +0100 |
commit | 773da7ceba116154e999187e0d9bcef5d58bebd4 (patch) | |
tree | e749f12fd66fb9b0279863455a97c1e17434588b /var | |
parent | 487b1c369098c050aa04f8fd99bf3a6e578847c1 (diff) | |
download | spack-773da7ceba116154e999187e0d9bcef5d58bebd4.tar.gz spack-773da7ceba116154e999187e0d9bcef5d58bebd4.tar.bz2 spack-773da7ceba116154e999187e0d9bcef5d58bebd4.tar.xz spack-773da7ceba116154e999187e0d9bcef5d58bebd4.zip |
python: drop dependency on `file` for script check (#29513)
`file` was used to detect Python scripts with shebangs, so that the interpreter could be changed from <python prefix> to <view path>. With this change, we detect shebangs using Python instead, so that `file` is no longer required.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/python/package.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index be21af5e16..c97407d9fc 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -13,7 +13,11 @@ import sys from shutil import copy import llnl.util.tty as tty -from llnl.util.filesystem import copy_tree, get_filetype, path_contains_subdirectory +from llnl.util.filesystem import ( + copy_tree, + is_nonsymlink_exe_with_shebang, + path_contains_subdirectory, +) from llnl.util.lang import match_predicate from spack import * @@ -1369,7 +1373,7 @@ config.update(get_paths()) view.link(src, dst, spec=self.spec) elif not os.path.islink(src): copy(src, dst) - if 'script' in get_filetype(src): + if is_nonsymlink_exe_with_shebang(src): filter_file( self.spec.prefix, os.path.abspath( |