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.
This commit is contained in:
Todd Gamblin
2016-03-06 16:51:09 -08:00
parent e515042a36
commit 240ada5775
5 changed files with 86 additions and 20 deletions

View File

@@ -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