From 8c11e2117e86de7baac0a29abc52af67395d7684 Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Thu, 25 Aug 2022 19:37:49 +0000 Subject: [PATCH] Bug 1786948: Remove dead code from the moz.yaml schema validation r=jewilde Differential Revision: https://phabricator.services.mozilla.com/D155596 --- python/mozbuild/mozbuild/vendor/moz_yaml.py | 40 --------------------- 1 file changed, 40 deletions(-) diff --git a/python/mozbuild/mozbuild/vendor/moz_yaml.py b/python/mozbuild/mozbuild/vendor/moz_yaml.py index 6f5019823cdc..b172b71d0e42 100644 --- a/python/mozbuild/mozbuild/vendor/moz_yaml.py +++ b/python/mozbuild/mozbuild/vendor/moz_yaml.py @@ -361,42 +361,6 @@ def load_moz_yaml(filename, verify=True, require_license_file=True): return manifest -def update_moz_yaml(filename, release, revision, verify=True, write=True): - """Update origin:release and vendoring:revision without stripping - comments or reordering fields.""" - - if verify: - load_moz_yaml(filename) - - lines = [] - with open(filename) as f: - found_release = False - found_revision = False - section = None - for line in f.readlines(): - m = RE_SECTION(line) - if m: - section = m.group(1) - else: - m = RE_FIELD(line) - if m: - (name, value) = m.groups() - if section == "origin" and name == "release": - line = " release: %s\n" % release - found_release = True - elif section == "origin" and name == "revision": - line = " revision: %s\n" % revision - found_revision = True - lines.append(line) - - if not found_release and found_revision: - raise ValueError("Failed to find origin:release and " "origin:revision") - - if write: - with open(filename, "w") as f: - f.writelines(lines) - - def _schema_1(): """Returns Voluptuous Schema object.""" return Schema( @@ -579,10 +543,6 @@ def _schema_1_additional(filename, manifest, require_license_file=True): if not has_schema: raise ValueError("Not simple YAML") - # Verify YAML can be updated. - if "vendor" in manifest: - update_moz_yaml(filename, "", "", verify=False, write=True) - # Do type conversion for the few things that need it. # Everythig is parsed as a string to (a) not cause problems with revisions that