aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/gnome.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-10-05 12:40:22 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-10-07 09:26:35 -0700
commitbcfbfbb343cc8ebe415fce042f5d0b1a1c488f69 (patch)
treeb23e076a4a67cb97b4a83b44a8826e77cd6a6468 /mesonbuild/modules/gnome.py
parentdfec4385a74fb0530733d008bd2afce278bc486e (diff)
downloadmeson-bcfbfbb343cc8ebe415fce042f5d0b1a1c488f69.zip
meson-bcfbfbb343cc8ebe415fce042f5d0b1a1c488f69.tar.gz
meson-bcfbfbb343cc8ebe415fce042f5d0b1a1c488f69.tar.bz2
modules/gnome: deprecate yelp variadic sources
Yelp currently can take sources two different ways, the first is via variadic arguments, the second is by a keyword argument. If the keyword is passed then the variadic arguments are silently ignored, which is obviously not ideal. Fortunately the variadic form was never documented, and is likely not in wide use. This patch fixes it by deprecating the variadic form, and warning if both are passed. It does not change behavior as someone may be relying on it.
Diffstat (limited to 'mesonbuild/modules/gnome.py')
-rw-r--r--mesonbuild/modules/gnome.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index a6c0e1b..739faec 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -33,7 +33,7 @@ from ..mesonlib import (
join_args, HoldableObject
)
from ..dependencies import Dependency, PkgConfigDependency, InternalDependency
-from ..interpreterbase import noPosargs, noKwargs, permittedKwargs, FeatureNew, FeatureNewKwargs, FeatureDeprecatedKwargs
+from ..interpreterbase import noPosargs, noKwargs, permittedKwargs, FeatureNew, FeatureNewKwargs, FeatureDeprecatedKwargs, FeatureDeprecated
from ..interpreterbase import typed_kwargs, KwargInfo, ContainerTypeInfo
from ..programs import ExternalProgram, OverrideProgram
from ..build import CustomTarget, CustomTargetIndex, GeneratedList
@@ -969,12 +969,18 @@ class GnomeModule(ExtensionModule):
raise MesonException('Yelp requires a project id')
project_id = args[0]
+ if len(args) > 1:
+ FeatureDeprecated.single_use('gnome.yelp more than one positional argument', '0.60.0', 'use the "sources" keyword argument instead.')
+
sources = mesonlib.stringlistify(kwargs.pop('sources', []))
if not sources:
if len(args) > 1:
sources = mesonlib.stringlistify(args[1:])
if not sources:
raise MesonException('Yelp requires a list of sources')
+ else:
+ if len(args) > 1:
+ mlog.warning('"gnome.yelp" ignores positional sources arguments when the "sources" keyword argument is set')
source_str = '@@'.join(sources)
langs = mesonlib.stringlistify(kwargs.pop('languages', []))