summaryrefslogtreecommitdiff
path: root/src/hydrilla/builder/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/hydrilla/builder/build.py')
-rw-r--r--src/hydrilla/builder/build.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/hydrilla/builder/build.py b/src/hydrilla/builder/build.py
index 33838f3..a3c55a7 100644
--- a/src/hydrilla/builder/build.py
+++ b/src/hydrilla/builder/build.py
@@ -51,15 +51,6 @@ here = Path(__file__).resolve().parent
_ = util.translation(here / 'locales').gettext
-def index_validator(major_schema_version):
- """
- Create an index.json schema validator specific to the requested schema
- version series.
- """
- exact_version = {1: '1.0.1', 2: '2'}[major_schema_version]
-
- return util.validator_for(f'package_source-{exact_version}.schema.json')
-
schemas_root = 'https://hydrilla.koszko.org/schemas'
generated_by = {
@@ -365,7 +356,9 @@ class Build:
files and computed definitions of the source package and items defined
in it.
"""
- index_validator(major_schema_version).validate(index_obj)
+ schema_name = f'package_source-{major_schema_version}.schema.json';
+
+ util.validator_for(schema_name).validate(index_obj)
match = re.match(r'.*-((([1-9][0-9]*|0)\.)+)schema\.json$',
index_obj['$schema'])