diff options
author | Daniel Jacobs <daniel.jacobs@is4s.com> | 2021-09-30 09:43:08 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2021-10-10 16:12:57 -0400 |
commit | 31bea202c9dc9d288d787f0073f0e221971669ba (patch) | |
tree | 5d196d27876f2b602ff33e36b120dc2ac269e9c9 | |
parent | a5020857f31ad6d03bc7c0019551cc28b9e5aad5 (diff) | |
download | meson-31bea202c9dc9d288d787f0073f0e221971669ba.zip meson-31bea202c9dc9d288d787f0073f0e221971669ba.tar.gz meson-31bea202c9dc9d288d787f0073f0e221971669ba.tar.bz2 |
improve wraptool search
-rw-r--r-- | docs/markdown/Using-wraptool.md | 6 | ||||
-rw-r--r-- | mesonbuild/wrap/wraptool.py | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/docs/markdown/Using-wraptool.md b/docs/markdown/Using-wraptool.md index ffa8309..cabdc0e 100644 --- a/docs/markdown/Using-wraptool.md +++ b/docs/markdown/Using-wraptool.md @@ -36,6 +36,12 @@ with the `search` command: $ meson wrap search jpeg libjpeg +If a package is not found in the list of wraps, the `search` command +will look in all the wrap dependencies: + + $ meson wrap search glib-2.0 + Dependency glib-2.0 found in wrap glib + To determine which versions of libjpeg are available to install, issue the `info` command: diff --git a/mesonbuild/wrap/wraptool.py b/mesonbuild/wrap/wraptool.py index a6648a7..33af16e 100644 --- a/mesonbuild/wrap/wraptool.py +++ b/mesonbuild/wrap/wraptool.py @@ -70,9 +70,13 @@ def list_projects(options: 'argparse.Namespace') -> None: def search(options: 'argparse.Namespace') -> None: name = options.name releases = get_releases() - for p in releases.keys(): - if p.startswith(name): + for p, info in releases.items(): + if p.find(name) != -1: print(p) + else: + for dep in info.get('dependency_names', []): + if dep.find(name) != -1: + print(f'Dependency {dep} found in wrap {p}') def get_latest_version(name: str) -> tuple: releases = get_releases() |