core changes to allow setting git/url attribute on packages

This commit is contained in:
Peter Josef Scheibel
2022-10-12 16:14:40 -06:00
committed by Gregory Becker
parent d7cb790f88
commit a8fa5f6ca1
2 changed files with 22 additions and 0 deletions

View File

@@ -1362,6 +1362,11 @@ def get_pkg_class(self, pkg_name):
if not inspect.isclass(cls):
tty.die("%s.%s is not a class" % (pkg_name, class_name))
# packages.yaml config can override package attributes
settings = spack.config.get("packages").get(pkg_name, {}).get("set", {})
for key, val in settings.items():
setattr(cls, key, val)
return cls
def __str__(self):

View File

@@ -82,6 +82,23 @@
},
},
},
# If 'get_full_repo' is promoted to a Package-level
# attribute, it could be useful to set it here
"set": {
"type": "object",
"additionalProperties": False,
"properties": {
"git": {
"type": "string",
},
"url": {
"type": "string",
},
"submodules": {
"type": "boolean",
},
},
},
"providers": {
"type": "object",
"default": {},