diff options
Diffstat (limited to 'mesonbuild/wrap/wraptool.py')
-rw-r--r-- | mesonbuild/wrap/wraptool.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/mesonbuild/wrap/wraptool.py b/mesonbuild/wrap/wraptool.py index 096ab4d..00115cb 100644 --- a/mesonbuild/wrap/wraptool.py +++ b/mesonbuild/wrap/wraptool.py @@ -145,11 +145,15 @@ def info(name): print(' ', v['branch'], v['revision']) def do_promotion(from_path, spdir_name): - sproj_name = os.path.split(from_path)[1] - outputdir = os.path.join(spdir_name, sproj_name) - if os.path.exists(outputdir): - sys.exit('Output dir %s already exists. Will not overwrite.' % outputdir) - shutil.copytree(from_path, outputdir, ignore=shutil.ignore_patterns('subprojects')) + if os.path.isfile(from_path): + assert(from_path.endswith('.wrap')) + shutil.copy(from_path, spdir_name) + elif os.path.isdir(from_path): + sproj_name = os.path.split(from_path)[1] + outputdir = os.path.join(spdir_name, sproj_name) + if os.path.exists(outputdir): + sys.exit('Output dir %s already exists. Will not overwrite.' % outputdir) + shutil.copytree(from_path, outputdir, ignore=shutil.ignore_patterns('subprojects')) def promote(argument): path_segment, subproject_name = os.path.split(argument) |