Blame SOURCES/0005-accept-positional-arguments-for-i18n.merge_file.patch

5515ae
From 1e50e285732925c417377cb78e53d075f134ca70 Mon Sep 17 00:00:00 2001
5515ae
From: Paolo Bonzini <pbonzini@redhat.com>
5515ae
Date: Wed, 2 Nov 2022 10:06:40 +0100
5515ae
Subject: [PATCH 5/9] accept positional arguments for i18n.merge_file
5515ae
Content-Type: text/plain
5515ae
5515ae
Partial revert of upstream commit 61f2866a9f with a warning added.
5515ae
5515ae
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5515ae
---
5515ae
 mesonbuild/modules/i18n.py | 5 ++++-
5515ae
 1 file changed, 4 insertions(+), 1 deletion(-)
5515ae
5515ae
diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py
5515ae
index 524a33110..f8d92d211 100644
5515ae
--- a/mesonbuild/modules/i18n.py
5515ae
+++ b/mesonbuild/modules/i18n.py
5515ae
@@ -146,7 +146,6 @@ class I18nModule(ExtensionModule):
5515ae
         return [path.join(src_dir, d) for d in dirs]
5515ae
 
5515ae
     @FeatureNew('i18n.merge_file', '0.37.0')
5515ae
-    @noPosargs
5515ae
     @typed_kwargs(
5515ae
         'i18n.merge_file',
5515ae
         CT_BUILD_BY_DEFAULT,
5515ae
@@ -161,6 +160,10 @@ class I18nModule(ExtensionModule):
5515ae
         KwargInfo('type', str, default='xml', validator=in_set_validator({'xml', 'desktop'})),
5515ae
     )
5515ae
     def merge_file(self, state: 'ModuleState', args: T.List['TYPE_var'], kwargs: 'MergeFile') -> ModuleReturnValue:
5515ae
+        if args:
5515ae
+            mlog.warning('i18n.merge_file() does not take any '
5515ae
+                         'positional arguments. This will become an error in the future.',
5515ae
+                         location=self.interpreter.current_node)
5515ae
         if self.tools['msgfmt'] is None or not self.tools['msgfmt'].found():
5515ae
             self.tools['msgfmt'] = state.find_program('msgfmt', for_machine=mesonlib.MachineChoice.BUILD)
5515ae
         podir = path.join(state.build_to_src, state.subdir, kwargs['po_dir'])
5515ae
-- 
5515ae
2.38.1
5515ae