Try the next level.

This commit is contained in:
Jelmer Vernooij 2021-03-18 14:16:52 +00:00
parent 37f56f8556
commit 84c8a1abda
No known key found for this signature in database
GPG key ID: 579C160D4C9E23E8

View file

@ -873,6 +873,19 @@ BUILDSYSTEM_CLSES = [
def detect_buildsystems(path, trust_package=False):
"""Detect build systems."""
ret = []
ret.extend(_detect_buildsystems_directory(path))
if not ret:
# Nothing found. Try the next level?
for entry in os.scandir(path):
if entry.is_dir():
ret.extend(_detect_buildsystems_directory(entry.path))
return ret
def _detect_buildsystems_directory(path):
for bs_cls in BUILDSYSTEM_CLSES:
bs = bs_cls.probe(path)
if bs is not None: