diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-09-25 23:30:40 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-12-17 21:19:22 +0200 |
commit | 5b9d79b9029f1a9be897188c6ffbdce65d4e510b (patch) | |
tree | a29678231ff1dd9f56ac8c149593c18f469b6917 /mesonbuild/wrap/wraptool.py | |
parent | 46c071ea5c36b153fdf7d388c580bfa1a26cf226 (diff) | |
download | meson-5b9d79b9029f1a9be897188c6ffbdce65d4e510b.zip meson-5b9d79b9029f1a9be897188c6ffbdce65d4e510b.tar.gz meson-5b9d79b9029f1a9be897188c6ffbdce65d4e510b.tar.bz2 |
Print instructions on how to promote subsubprojects.
Diffstat (limited to 'mesonbuild/wrap/wraptool.py')
-rw-r--r-- | mesonbuild/wrap/wraptool.py | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/mesonbuild/wrap/wraptool.py b/mesonbuild/wrap/wraptool.py index 42f0bb6..096ab4d 100644 --- a/mesonbuild/wrap/wraptool.py +++ b/mesonbuild/wrap/wraptool.py @@ -21,6 +21,8 @@ from glob import glob from .wrap import API_ROOT, open_wrapdburl +from .. import mesonlib + help_templ = '''This program allows you to manage your Wrap dependencies using the online wrap database http://wrapdb.mesonbuild.com. @@ -149,29 +151,10 @@ def do_promotion(from_path, spdir_name): sys.exit('Output dir %s already exists. Will not overwrite.' % outputdir) shutil.copytree(from_path, outputdir, ignore=shutil.ignore_patterns('subprojects')) -def detect_subprojects(spdir_name, current_dir='', result=None): - if result is None: - result = {} - spdir = os.path.join(current_dir, spdir_name) - if not os.path.exists(spdir): - return result - for trial in glob(os.path.join(spdir, '*')): - basename = os.path.split(trial)[1] - if trial == 'packagecache': - continue - if not os.path.isdir(trial): - continue - if basename in result: - result[basename].append(trial) - else: - result[basename] = [trial] - detect_subprojects(spdir_name, trial, result) - return result - def promote(argument): path_segment, subproject_name = os.path.split(argument) spdir_name = 'subprojects' - sprojs = detect_subprojects(spdir_name) + sprojs = mesonlib.detect_subprojects(spdir_name) if subproject_name not in sprojs: sys.exit('Subproject %s not found in directory tree.' % subproject_name) matches = sprojs[subproject_name] |