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.
This commit is contained in:
@@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
import spack.cmd
|
import spack.cmd
|
||||||
import spack.config
|
import spack.config
|
||||||
|
import spack.fetch_strategy
|
||||||
|
import spack.repo
|
||||||
import spack.spec
|
import spack.spec
|
||||||
import spack.util.path
|
import spack.util.path
|
||||||
import spack.version
|
import spack.version
|
||||||
@@ -69,14 +71,15 @@ def _retrieve_develop_source(spec, abspath):
|
|||||||
# We construct a package class ourselves, rather than asking for
|
# We construct a package class ourselves, rather than asking for
|
||||||
# Spec.package, since Spec only allows this when it is concrete
|
# Spec.package, since Spec only allows this when it is concrete
|
||||||
package = pkg_cls(spec)
|
package = pkg_cls(spec)
|
||||||
if isinstance(package.stage[0].fetcher, spack.fetch_strategy.GitFetchStrategy):
|
source_stage = package.stage[0]
|
||||||
package.stage[0].fetcher.get_full_repo = True
|
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
|
# If we retrieved this version before and cached it, we may have
|
||||||
# done so without cloning the full git repo; likewise, any
|
# done so without cloning the full git repo; likewise, any
|
||||||
# mirror might store an instance with truncated history.
|
# 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)
|
package.stage.steal_source(abspath)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user