Esempio n. 1
0
def check(profile, project_dir, profile_dict={}):
    deps_expr = get_deps(project_dir)
    check_deps = parse_deps(deps_expr, profile_dict)
    profile_file = os.path.join(profiles_dir, profile)
    kconfig.get_values(profile_file, profile_dict)
    if not check_deps():
        sys.stderr.write("profile does not meet project dependencies:\n")
        sys.stderr.write("%s\n" % deps_expr)
        return False
    return True
Esempio n. 2
0
def update(profile, project_dir, autogen=None):
    make_autogen = autogen == None
    if make_autogen:
        profile_dict = {}
        profile_file = os.path.join(profiles_dir, profile)
        kconfig.get_values(profile_file, profile_dict)
        autogen = build_autogen(project_dir, profile, profile_dict)
    env = dict(os.environ)
    env['_DT_PROJECT'] = os.path.abspath(project_dir)
    env['_DT_PROFILE'] = profile
    env['_DT_AUTOGEN'] = autogen
    options = os.path.join(devtool.root_dir, 'options', 'project.dt')
    config_dir = os.path.join(project_dir, 'build')
    config = os.path.join(config_dir, '%s.cfg' % profile)
    include_dir = os.path.join(config_dir, profile)
    if not os.path.exists(include_dir):
        os.makedirs(include_dir)
    env['KCONFIG_AUTOHEADER'] = os.path.join(include_dir, 'config.h')
    env['KCONFIG_AUTOCONFIG'] = os.path.join(include_dir, 'auto.mk')
    kconfig.conf(options, config, env)
    if make_autogen:
        os.remove(autogen)

    return True