create leading directories for resources
This allows resources to be placed into subdirectory trees that may not exist in the base package, and may depend on other resources to be staged later.
This commit is contained in:
parent
01f811d546
commit
30f5ccb80d
1 changed files with 8 additions and 1 deletions
|
@ -705,10 +705,17 @@ def _expand_archive(stage, name=self.name):
|
|||
placement = {'': placement}
|
||||
# Make the paths in the dictionary absolute and link
|
||||
for key, value in placement.iteritems():
|
||||
link_path = join_path(self.stage.source_path, resource.destination, value)
|
||||
target_path = join_path(self.stage.source_path, resource.destination)
|
||||
link_path = join_path(target_path, value)
|
||||
source_path = join_path(stage.source_path, key)
|
||||
if not os.path.exists(link_path):
|
||||
# Create a symlink
|
||||
try:
|
||||
os.makedirs(target_path)
|
||||
except OSError as err:
|
||||
if err.errno == errno.EEXIST and os.path.isdir(target_path):
|
||||
pass
|
||||
else: raise
|
||||
os.symlink(source_path, link_path)
|
||||
##########
|
||||
self.stage.chdir_to_source()
|
||||
|
|
Loading…
Reference in a new issue