summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2018-08-24 11:45:35 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2018-08-25 10:20:39 -0700
commit3c292de6bdfe4c058201afe4fdb34cf9a4da8da8 (patch)
tree7609be170c8d135c78f4af314363ff71c4dff13e
parent3f0e6d04e048ff54882e9426500bd375cf590fe0 (diff)
downloadspack-3c292de6bdfe4c058201afe4fdb34cf9a4da8da8.tar.gz
spack-3c292de6bdfe4c058201afe4fdb34cf9a4da8da8.tar.bz2
spack-3c292de6bdfe4c058201afe4fdb34cf9a4da8da8.tar.xz
spack-3c292de6bdfe4c058201afe4fdb34cf9a4da8da8.zip
bugfix: 'submodules' attribute should imply git fetch
- 'submodules' wasn't properly declared as an optional attribute for git fetcher - add it and add a test.
-rw-r--r--lib/spack/spack/fetch_strategy.py2
-rw-r--r--lib/spack/spack/test/packages.py7
-rw-r--r--var/spack/repos/builtin.mock/packages/git-url-top-level/package.py1
3 files changed, 9 insertions, 1 deletions
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
index 38b837b659..f5425d6bbd 100644
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -596,7 +596,7 @@ class GitFetchStrategy(VCSFetchStrategy):
"""
enabled = True
url_attr = 'git'
- optional_attrs = ['tag', 'branch', 'commit']
+ optional_attrs = ['tag', 'branch', 'commit', 'submodules']
def __init__(self, **kwargs):
# Discards the keywords in kwargs that may conflict with the next call
diff --git a/lib/spack/spack/test/packages.py b/lib/spack/spack/test/packages.py
index 464e37a8d2..296a263479 100644
--- a/lib/spack/spack/test/packages.py
+++ b/lib/spack/spack/test/packages.py
@@ -341,6 +341,13 @@ def test_git_url_top_level_git_versions(mock_packages, config):
assert fetcher.commit == 'abc34'
assert fetcher.branch is None
+ fetcher = spack.fetch_strategy.for_package_version(pkg, 'submodules')
+ assert isinstance(fetcher, spack.fetch_strategy.GitFetchStrategy)
+ assert fetcher.url == 'https://example.com/some/git/repo'
+ assert fetcher.tag is None
+ assert fetcher.commit is None
+ assert fetcher.branch is None
+
fetcher = spack.fetch_strategy.for_package_version(pkg, 'develop')
assert isinstance(fetcher, spack.fetch_strategy.GitFetchStrategy)
assert fetcher.url == 'https://example.com/some/git/repo'
diff --git a/var/spack/repos/builtin.mock/packages/git-url-top-level/package.py b/var/spack/repos/builtin.mock/packages/git-url-top-level/package.py
index f3fe17bd0f..74f2aa69e5 100644
--- a/var/spack/repos/builtin.mock/packages/git-url-top-level/package.py
+++ b/var/spack/repos/builtin.mock/packages/git-url-top-level/package.py
@@ -39,6 +39,7 @@ class GitUrlTopLevel(Package):
# These resolve to git fetchers
version('develop', branch='develop')
+ version('submodules', submodules=True)
version('3.4', commit='abc34')
version('3.3', branch='releases/v3.3', commit='abc33')
version('3.2', branch='releases/v3.2')