Skip to content

Commit

Permalink
cmd/develop.py: fix readability (spack#44980)
Browse files Browse the repository at this point in the history
stage[0] is assumed to be for sources, 1: and onwards is
patches/resources, make that a bit more clear.
  • Loading branch information
haampie authored Jul 1, 2024
1 parent 98e626c commit fff1262
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/spack/spack/cmd/develop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)


Expand Down

0 comments on commit fff1262

Please sign in to comment.