summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Scogland <scogland1@llnl.gov>2015-12-30 12:26:55 -0800
committerTom Scogland <scogland1@llnl.gov>2015-12-30 16:59:39 -0800
commitfcdf08e4d7da824afe95445496d8b14f7bc08724 (patch)
tree74e958d414cc4d020a2e3738052fddcf4896f46f /lib
parentcc8c783bb29e037e3343698e7a958bce4c17add5 (diff)
downloadspack-fcdf08e4d7da824afe95445496d8b14f7bc08724.tar.gz
spack-fcdf08e4d7da824afe95445496d8b14f7bc08724.tar.bz2
spack-fcdf08e4d7da824afe95445496d8b14f7bc08724.tar.xz
spack-fcdf08e4d7da824afe95445496d8b14f7bc08724.zip
allow nested resources
This solution doesn't really make me happy, but does seem to work. It sorts the resources by the length of the string representing their destination. Since any nested resource must contain another resource's name in its path, it seems that should work, but there should be a better way to do this.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 999b5e125e..118069a0a7 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -697,7 +697,9 @@ class Package(object):
##########
# Stage resources in appropriate path
resources = self._get_resources()
- for resource in resources:
+ # TODO: this is to allow nested resources, a better solution would be
+ # good
+ for resource in sorted(resources, key=lambda res: len(res.destination)):
stage = resource.fetcher.stage
_expand_archive(stage, resource.name)
# Turn placement into a dict with relative paths