diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2016-03-06 16:51:09 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2016-03-06 16:51:09 -0800 |
commit | 240ada5775c7857932279d86e4305ef001d33717 (patch) | |
tree | e33bd2a1d2ed1a602273c259e7db855c03f69614 /lib/spack/llnl | |
parent | e515042a36e7aa21e52943dab1e8b5594f3f0e94 (diff) | |
download | spack-240ada5775c7857932279d86e4305ef001d33717.tar.gz spack-240ada5775c7857932279d86e4305ef001d33717.tar.bz2 spack-240ada5775c7857932279d86e4305ef001d33717.tar.xz spack-240ada5775c7857932279d86e4305ef001d33717.zip |
Add `expand=False` option for URL downloads.
- Allows skipping the expand step for downloads.
- Fixed stage so that it knows expansion didn't fail when there is a
no-expand URLFetchStrategy.
- Updated docs to reflect new option, and provided an example.
Diffstat (limited to 'lib/spack/llnl')
-rw-r--r-- | lib/spack/llnl/util/filesystem.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index a92cb0706d..f218b7c424 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -25,7 +25,8 @@ __all__ = ['set_install_permissions', 'install', 'install_tree', 'traverse_tree', 'expand_user', 'working_dir', 'touch', 'touchp', 'mkdirp', 'force_remove', 'join_path', 'ancestor', 'can_access', 'filter_file', - 'FileFilter', 'change_sed_delimiter', 'is_exe', 'force_symlink', 'remove_dead_links', 'remove_linked_tree'] + 'FileFilter', 'change_sed_delimiter', 'is_exe', 'force_symlink', + 'set_executable', 'remove_dead_links', 'remove_linked_tree'] import os import sys @@ -345,6 +346,12 @@ def traverse_tree(source_root, dest_root, rel_path='', **kwargs): if order == 'post': yield (source_path, dest_path) + +def set_executable(path): + st = os.stat(path) + os.chmod(path, st.st_mode | stat.S_IEXEC) + + def remove_dead_links(root): """ Removes any dead link that is present in root |