aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter
diff options
context:
space:
mode:
authorKirill Isakov <bootctl@gmail.com>2022-04-20 11:28:21 +0600
committerEli Schwartz <eschwartz93@gmail.com>2022-04-20 20:53:19 -0400
commit39dd1ff9e83acfdc8c532604b20cb7b774727334 (patch)
tree6ba62dc2cbb2bc0ba98547b123c55352a93c8a0d /mesonbuild/interpreter
parent33aa803521b2aa62688833842ea7eddb828e0e25 (diff)
downloadmeson-39dd1ff9e83acfdc8c532604b20cb7b774727334.zip
meson-39dd1ff9e83acfdc8c532604b20cb7b774727334.tar.gz
meson-39dd1ff9e83acfdc8c532604b20cb7b774727334.tar.bz2
vcs_tag: handle non-str / non-file arguments
This makes vcs_tag behave like other commands so it accepts not only string and file arguments, but also exe, custom_tgt, and external_program.
Diffstat (limited to 'mesonbuild/interpreter')
-rw-r--r--mesonbuild/interpreter/interpreter.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 0d5dd39..d5e7dbd 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -1752,11 +1752,14 @@ external dependencies (including libraries) must go to "dependencies".''')
vcs_cmd = kwargs['command']
source_dir = os.path.normpath(os.path.join(self.environment.get_source_dir(), self.subdir))
if vcs_cmd:
- if isinstance(vcs_cmd[0], mesonlib.File):
- FeatureNew.single_use('vcs_tag with file as the first argument', '0.62.0', self.subproject, location=node)
- maincmd = self.find_program_impl(vcs_cmd[0], required=False)
- if maincmd.found():
- vcs_cmd[0] = maincmd
+ if isinstance(vcs_cmd[0], (str, mesonlib.File)):
+ if isinstance(vcs_cmd[0], mesonlib.File):
+ FeatureNew.single_use('vcs_tag with file as the first argument', '0.62.0', self.subproject, location=node)
+ maincmd = self.find_program_impl(vcs_cmd[0], required=False)
+ if maincmd.found():
+ vcs_cmd[0] = maincmd
+ else:
+ FeatureNew.single_use('vcs_tag with custom_tgt, external_program, or exe as the first argument', '0.63.0', self.subproject, location=node)
else:
vcs = mesonlib.detect_vcs(source_dir)
if vcs: