From fff126204ceee5cc8474ad9c21859009cba241a1 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Mon, 1 Jul 2024 21:14:00 +0200 Subject: [PATCH] cmd/develop.py: fix readability (#44980) stage[0] is assumed to be for sources, 1: and onwards is patches/resources, make that a bit more clear. --- lib/spack/spack/cmd/develop.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/spack/spack/cmd/develop.py b/lib/spack/spack/cmd/develop.py index 9562737c442571..e226c16766553e 100644 --- a/lib/spack/spack/cmd/develop.py +++ b/lib/spack/spack/cmd/develop.py @@ -9,6 +9,8 @@ import spack.cmd import spack.config +import spack.fetch_strategy +import spack.repo import spack.spec import spack.util.path import spack.version @@ -69,14 +71,15 @@ def _retrieve_develop_source(spec, abspath): # We construct a package class ourselves, rather than asking for # Spec.package, since Spec only allows this when it is concrete package = pkg_cls(spec) - if isinstance(package.stage[0].fetcher, spack.fetch_strategy.GitFetchStrategy): - package.stage[0].fetcher.get_full_repo = True + source_stage = package.stage[0] + if isinstance(source_stage.fetcher, spack.fetch_strategy.GitFetchStrategy): + source_stage.fetcher.get_full_repo = True # If we retrieved this version before and cached it, we may have # done so without cloning the full git repo; likewise, any # mirror might store an instance with truncated history. - package.stage[0].disable_mirrors() + source_stage.disable_mirrors() - package.stage[0].fetcher.set_package(package) + source_stage.fetcher.set_package(package) package.stage.steal_source(abspath)