summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2019-01-31 13:23:44 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2019-01-31 13:23:44 +0530
commit88ce16854107786aa3bd8a8a018d67f40a2621c1 (patch)
treec4ce329504a8124d1b01e9f629ec71f8253c512a
parentd28b75a500e0478deea0a4089c2d4bd334f197c8 (diff)
downloadmeson-nirbheek/deprecation-notice-install_dir-type.tar.gz
configure_file: Allow setting install_dir: false with deprecationnirbheek/deprecation-notice-install_dir-type
Also add location node for two more deprecations See: https://github.com/mesonbuild/meson/pull/4489#issuecomment-459246879
-rw-r--r--mesonbuild/interpreter.py9
-rw-r--r--test cases/common/14 configure file/meson.build6
2 files changed, 13 insertions, 2 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index c940f40db..0b9ce7153 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -276,7 +276,8 @@ class ConfigurationDataHolder(MutableInterpreterObject, ObjectHolder):
if len(args) == 1 and isinstance(args[0], list) and len(args[0]) == 2:
mlog.deprecation('Passing a list as the single argument to '
'configuration_data.set is deprecated. This will '
- 'become a hard error in the future.')
+ 'become a hard error in the future.',
+ location=self.current_node)
args = args[0]
if len(args) != 2:
@@ -289,7 +290,7 @@ class ConfigurationDataHolder(MutableInterpreterObject, ObjectHolder):
msg = 'Setting a configuration data value to {!r} is invalid, ' \
'and will fail at configure_file(). If you are using it ' \
'just to store some values, please use a dict instead.'
- mlog.deprecation(msg.format(val))
+ mlog.deprecation(msg.format(val), location=self.current_node)
desc = kwargs.get('description', None)
if not isinstance(name, str):
raise InterpreterException("First argument to set must be a string.")
@@ -3594,6 +3595,10 @@ This will become a hard error in the future.''' % kwargs['input'], location=self
# for backwards compatibility. That was the behaviour before
# 0.45.0 so preserve it.
idir = kwargs.get('install_dir', '')
+ if idir is False:
+ idir = ''
+ mlog.deprecation('Please use the new `install:` kwarg instead of passing '
+ '`false` to `install_dir:`', location=node)
if not isinstance(idir, str):
raise InterpreterException('"install_dir" must be a string')
install = kwargs.get('install', idir != '')
diff --git a/test cases/common/14 configure file/meson.build b/test cases/common/14 configure file/meson.build
index 982ae2a4e..50393e9f0 100644
--- a/test cases/common/14 configure file/meson.build
+++ b/test cases/common/14 configure file/meson.build
@@ -141,6 +141,12 @@ cfile = configure_file(input : 'config.h.in',
install_dir : '',
configuration : conf)
+# test install_dir : false (deprecated)
+cfile = configure_file(input : 'config.h.in',
+ output : 'do_not_get_installed_please.h',
+ install_dir : false,
+ configuration : conf)
+
# test intsall_dir with install: false
cfile = configure_file(input : 'config.h.in',
output : 'do_not_get_installed_in_install_dir.h',