summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Scogland <scogland1@llnl.gov>2015-12-29 12:14:52 -0800
committerTom Scogland <scogland1@llnl.gov>2015-12-30 16:59:39 -0800
commit30f5ccb80d62608b3006c0f2521c37d3bff6ec32 (patch)
treece90b0b0bbc41ea335199f058f0a83f928049ee2 /lib
parent01f811d5469c8cc059dae7846aa660aa0c5a4ab7 (diff)
downloadspack-30f5ccb80d62608b3006c0f2521c37d3bff6ec32.tar.gz
spack-30f5ccb80d62608b3006c0f2521c37d3bff6ec32.tar.bz2
spack-30f5ccb80d62608b3006c0f2521c37d3bff6ec32.tar.xz
spack-30f5ccb80d62608b3006c0f2521c37d3bff6ec32.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 84bcb15f7f..69b263db0c 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -705,10 +705,17 @@ class Package(object):
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()