From 32188211aaac3ae5a4857e9cee57f349db9bfd3a Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Wed, 7 Sep 2022 19:18:33 +0000 Subject: [PATCH] Bug 1789687: Fix the replace-regex action for moz.yaml r=jewilde We accidently passed True when we want a non-regex replacement. This works for those, but not for the regex ones. Differential Revision: https://phabricator.services.mozilla.com/D156715 --- python/mozbuild/mozbuild/vendor/vendor_manifest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/mozbuild/mozbuild/vendor/vendor_manifest.py b/python/mozbuild/mozbuild/vendor/vendor_manifest.py index a029780b5de7..f89c92016cc3 100644 --- a/python/mozbuild/mozbuild/vendor/vendor_manifest.py +++ b/python/mozbuild/mozbuild/vendor/vendor_manifest.py @@ -45,7 +45,7 @@ def _replace_in_file(file, pattern, replacement, regex=False): if newcontents == contents: raise Exception( - "Could not find %s in %s to replace with %s" % (pattern, file, replacement) + "Could not find '%s' in %s to %sreplace with '%s'" % (pattern, file, "regex-" if regex else "", replacement) ) with open(file, "w") as f: @@ -512,7 +512,7 @@ class VendorManifest(MozbuildObject): file, update["pattern"], replacement, - regex=update["action"] == "replace-in-file", + regex=update["action"] == "replace-in-file-regex", ) elif update["action"] == "delete-path": path = self.get_full_path(update["path"])