summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/wrap/wraptool.py5
-rwxr-xr-xrun_unittests.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/wrap/wraptool.py b/mesonbuild/wrap/wraptool.py
index 09a0289bf..3d046a0d3 100644
--- a/mesonbuild/wrap/wraptool.py
+++ b/mesonbuild/wrap/wraptool.py
@@ -160,8 +160,11 @@ def promote(argument):
path_segment, subproject_name = os.path.split(argument)
spdir_name = 'subprojects'
sprojs = mesonlib.detect_subprojects(spdir_name)
+ # The command we suggest ends with .wrap, so allow that too
+ if subproject_name.endswith('.wrap'):
+ subproject_name = subproject_name[:-5]
if subproject_name not in sprojs:
- sys.exit('Subproject %s not found in directory tree.' % subproject_name)
+ sys.exit('Subproject {!r} not found in directory tree'.format(subproject_name))
matches = sprojs[subproject_name]
if len(matches) == 1:
do_promotion(matches[0], spdir_name)
diff --git a/run_unittests.py b/run_unittests.py
index 4f688cd91..c8576ea60 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1777,7 +1777,7 @@ int main(int argc, char **argv) {
self.assertTrue(os.path.isdir(scommondir))
promoted_wrap = os.path.join(spdir, 'athing.wrap')
self.assertFalse(os.path.isfile(promoted_wrap))
- subprocess.check_call(self.wrap_command + ['promote', 'athing'], cwd=workdir)
+ subprocess.check_call(self.wrap_command + ['promote', 'athing.wrap'], cwd=workdir)
self.assertTrue(os.path.isfile(promoted_wrap))
self.init(workdir)
self.build()