created elf virtual package and updated dependent packages (#3317)
* created elf virtual package and updated dependent packages * added `hide_files` context manager to handle moving files.
This commit is contained in:

committed by
Todd Gamblin

parent
2ac343e92e
commit
604b75c1f9
@@ -50,6 +50,7 @@
|
||||
'fix_darwin_install_name',
|
||||
'force_remove',
|
||||
'force_symlink',
|
||||
'hide_files',
|
||||
'install',
|
||||
'install_tree',
|
||||
'is_exe',
|
||||
@@ -257,6 +258,18 @@ def working_dir(dirname, **kwargs):
|
||||
os.chdir(orig_dir)
|
||||
|
||||
|
||||
@contextmanager
|
||||
def hide_files(*file_list):
|
||||
try:
|
||||
baks = ['%s.bak' % f for f in file_list]
|
||||
for f, bak in zip(file_list, baks):
|
||||
shutil.move(f, bak)
|
||||
yield
|
||||
finally:
|
||||
for f, bak in zip(file_list, baks):
|
||||
shutil.move(bak, f)
|
||||
|
||||
|
||||
def touch(path):
|
||||
"""Creates an empty file at the specified path."""
|
||||
with open(path, 'a'):
|
||||
|
Reference in New Issue
Block a user