summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-07-01 21:14:00 +0200
committerGitHub <noreply@github.com>2024-07-01 12:14:00 -0700
commitfff126204ceee5cc8474ad9c21859009cba241a1 (patch)
treefc8dca9e8a0ef232915245bd9990057caf0779d9 /lib
parent98e626cf67c10b2649d322c8283350afffc6a727 (diff)
downloadspack-fff126204ceee5cc8474ad9c21859009cba241a1.tar.gz
spack-fff126204ceee5cc8474ad9c21859009cba241a1.tar.bz2
spack-fff126204ceee5cc8474ad9c21859009cba241a1.tar.xz
spack-fff126204ceee5cc8474ad9c21859009cba241a1.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/develop.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/spack/spack/cmd/develop.py b/lib/spack/spack/cmd/develop.py
index 9562737c44..e226c16766 100644
--- a/lib/spack/spack/cmd/develop.py
+++ b/lib/spack/spack/cmd/develop.py
@@ -9,6 +9,8 @@ import llnl.util.tty as tty
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)