aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-06-09 23:30:49 -0400
committerEli Schwartz <eschwartz@archlinux.org>2022-06-10 17:56:02 -0400
commitf380862284c9187f8c4496068f11bcc3ca245fec (patch)
tree7bb4d96bf5118d3f660afe71af805e34e9bab973 /mesonbuild/interpreter
parent4ad869cd849313f88497b1124a23c8188561a554 (diff)
downloadmeson-f380862284c9187f8c4496068f11bcc3ca245fec.zip
meson-f380862284c9187f8c4496068f11bcc3ca245fec.tar.gz
meson-f380862284c9187f8c4496068f11bcc3ca245fec.tar.bz2
add Feature checks for install_subdir creating an empty directory
Most importantly, tell people it's broken and to stop using it for 0.62.0
Diffstat (limited to 'mesonbuild/interpreter')
-rw-r--r--mesonbuild/interpreter/interpreter.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index ef7cb03..ee7260a 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -2353,6 +2353,13 @@ class Interpreter(InterpreterBase, HoldableObject):
def func_install_subdir(self, node: mparser.BaseNode, args: T.Tuple[str],
kwargs: 'kwargs.FuncInstallSubdir') -> build.InstallDir:
exclude = (set(kwargs['exclude_files']), set(kwargs['exclude_directories']))
+
+ srcdir = os.path.join(self.environment.source_dir, self.subdir, args[0])
+ if not os.path.isdir(srcdir) or not any(os.scandir(srcdir)):
+ FeatureNew.single_use('install_subdir with empty directory', '0.47.0', self.subproject, location=node)
+ FeatureDeprecated.single_use('install_subdir with empty directory', '0.60.0', self.subproject,
+ 'It worked by accident and is buggy. Use install_emptydir instead.', node)
+
idir = build.InstallDir(
self.subdir,
args[0],