Skip to content

Commit

Permalink
allow packages to request no submodules be updated when self.submodul…
Browse files Browse the repository at this point in the history
…es is a callable function

closes spack#4048
  • Loading branch information
tjfulle committed Oct 10, 2023
1 parent 6c7b2e1 commit 8799d66
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/spack/spack/fetch_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,12 @@ def clone(self, dest=None, commit=None, branch=None, tag=None, bare=False):
git_commands = []
submodules = self.submodules
if callable(submodules):
submodules = list(submodules(self.package))
git_commands.append(["submodule", "init", "--"] + submodules)
git_commands.append(["submodule", "update", "--recursive"])
submodules = submodules(self.package)
if submodules:
if isinstance(submodules, str):
submodules = [submodules]
git_commands.append(["submodule", "init", "--"] + submodules)
git_commands.append(["submodule", "update", "--recursive"])
elif submodules:
git_commands.append(["submodule", "update", "--init", "--recursive"])

Expand Down

0 comments on commit 8799d66

Please sign in to comment.