diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2023-04-18 14:49:05 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2023-04-18 19:42:29 -0400 |
commit | 7bdb4a6926db5d89e930a64fe8206b0d575a74f9 (patch) | |
tree | 50a8412f4332e217801909a7bef007a017e211fd /mesonbuild | |
parent | 4cd4f987708d5444a1cf59be14f2774b9f35f940 (diff) | |
download | meson-7bdb4a6926db5d89e930a64fe8206b0d575a74f9.zip meson-7bdb4a6926db5d89e930a64fe8206b0d575a74f9.tar.gz meson-7bdb4a6926db5d89e930a64fe8206b0d575a74f9.tar.bz2 |
pkgconfig module: fix traceback on invalid missing description
If the optional first "mainlib" argument is there, then we infer several
values. Otherwise, some of those values fall back to a generic default,
and two of them -- name and description -- fall back to being mandatory.
In commit e84f293f672a372d2434d0ce4fa39d3f902b6ce8, we removed
validation for description as part of refactoring that never actually
validated anything.
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/modules/pkgconfig.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index f26ba77..dcd1ea8 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -424,8 +424,8 @@ class PkgConfigModule(NewExtensionModule): return ('${prefix}' / libdir).as_posix() def _generate_pkgconfig_file(self, state: ModuleState, deps: DependenciesHelper, - subdirs: T.List[str], name: T.Optional[str], - description: T.Optional[str], url: str, version: str, + subdirs: T.List[str], name: str, + description: str, url: str, version: str, pcfile: str, conflicts: T.List[str], variables: T.List[T.Tuple[str, str]], unescaped_variables: T.List[T.Tuple[str, str]], @@ -638,11 +638,13 @@ class PkgConfigModule(NewExtensionModule): else: if kwargs['version'] is None: FeatureNew.single_use('pkgconfig.generate implicit version keyword', '0.46.0', state.subproject) + msg = ('pkgconfig.generate: if a library is not passed as a ' + 'positional argument, the {!r} keyword argument is ' + 'required.') if kwargs['name'] is None: - raise build.InvalidArguments( - 'pkgconfig.generate: if a library is not passed as a ' - 'positional argument, the name keyword argument is ' - 'required.') + raise build.InvalidArguments(msg.format('name')) + if kwargs['description'] is None: + raise build.InvalidArguments(msg.format('description')) dataonly = kwargs['dataonly'] if dataonly: |