diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 999b5e125ee..118069a0a7c 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -697,7 +697,9 @@ def _expand_archive(stage, name=self.name): ########## # 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