~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/u-boot/tools/patman/project.py

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (c) 2012 The Chromium OS Authors.
 
2
#
 
3
# SPDX-License-Identifier:      GPL-2.0+
 
4
#
 
5
 
 
6
import os.path
 
7
 
 
8
import gitutil
 
9
 
 
10
def DetectProject():
 
11
    """Autodetect the name of the current project.
 
12
 
 
13
    This looks for signature files/directories that are unlikely to exist except
 
14
    in the given project.
 
15
 
 
16
    Returns:
 
17
        The name of the project, like "linux" or "u-boot".  Returns "unknown"
 
18
        if we can't detect the project.
 
19
    """
 
20
    top_level = gitutil.GetTopLevel()
 
21
 
 
22
    if os.path.exists(os.path.join(top_level, "include", "u-boot")):
 
23
        return "u-boot"
 
24
    elif os.path.exists(os.path.join(top_level, "kernel")):
 
25
        return "linux"
 
26
 
 
27
    return "unknown"