From 84c8a1abda3a9c2590813e9d8a6bbb410d4a5301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Thu, 18 Mar 2021 14:16:52 +0000 Subject: [PATCH] Try the next level. --- ognibuild/buildsystem.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ognibuild/buildsystem.py b/ognibuild/buildsystem.py index 7c0e90c..b1a9320 100644 --- a/ognibuild/buildsystem.py +++ b/ognibuild/buildsystem.py @@ -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: