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/mesonlib.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/mesonlib.py')
-rw-r--r-- | mesonbuild/mesonlib.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index 9ad0668..8da08d3 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -881,6 +881,35 @@ def windows_proof_rmtree(f): # Try one last time and throw if it fails. shutil.rmtree(f) +def unholder_array(entries): + result = [] + entries = flatten(entries) + for e in entries: + if hasattr(e, 'held_object'): + e = e.held_object + result.append(e) + return result + + +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 + class OrderedSet(collections.MutableSet): """A set that preserves the order in which items are added, by first insertion. |