From fcdf08e4d7da824afe95445496d8b14f7bc08724 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Wed, 30 Dec 2015 12:26:55 -0800 Subject: 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. --- lib/spack/spack/package.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-70-g09d2