]> Git Repo - u-boot.git/blame - tools/patman/project.py
buildman: Retry the build for current source
[u-boot.git] / tools / patman / project.py
CommitLineData
83d290c5 1# SPDX-License-Identifier: GPL-2.0+
a1dcee84
DA
2# Copyright (c) 2012 The Chromium OS Authors.
3#
a1dcee84
DA
4
5import os.path
6
bf776679 7from patman import gitutil
a1dcee84 8
642df431 9def detect_project():
a1dcee84
DA
10 """Autodetect the name of the current project.
11
12 This looks for signature files/directories that are unlikely to exist except
13 in the given project.
14
15 Returns:
16 The name of the project, like "linux" or "u-boot". Returns "unknown"
17 if we can't detect the project.
18 """
0157b187 19 top_level = gitutil.get_top_level()
a1dcee84
DA
20
21 if os.path.exists(os.path.join(top_level, "include", "u-boot")):
22 return "u-boot"
23 elif os.path.exists(os.path.join(top_level, "kernel")):
24 return "linux"
25
26 return "unknown"
This page took 0.244409 seconds and 4 git commands to generate.