Esempio n. 1
0
def _calculate_value(config, config_key, arguments, key):
    original = config.get("DEFAULT", config_key, fallback="")
    if key in arguments:
        # this feels hacky; there's gotta be a better way to access
        # the value through a programatic key
        new = arguments.__dict__.get(key)
        if arguments.append:
            return _optional_append(original, new)
        return new
    return original
Esempio n. 2
0
def _overrides_changed(config, cache_mtime):
    default_config = config.get("DEFAULT")
    override_list = default_config.get_list("dp.overrides")
    for component_name, component_config in config.items():
        applied_overrides = component_config.get_list("dp.applied_overrides")
        # see if the applied overrides have been deleted
        for override_name in override_list:
            if _check_specific_override(
                    override_name,
                    applied_overrides,
                    component_config,
                    component_name,
                    cache_mtime,
            ):
                return True
    return False
Esempio n. 3
0
def _profiles_changed(config, cache_mtime):
    default_config = config.get("DEFAULT")
    profile_list = default_config.get_list("dp.profile_name")
    if profile_list:
        if os.path.isdir(
                devpipeline_configure.profiles.get_root_profile_path(
                    default_config)):
            for profile in profile_list:
                for name, component_config in config.items():
                    del name
                    profile_path = devpipeline_configure.profiles.get_individual_profile_path(
                        component_config, profile)
                    if os.path.isfile(profile_path):
                        if cache_mtime < os.path.getmtime(profile_path):
                            return True
        else:
            profile_path = devpipeline_configure.profiles.get_profile_path(
                config)
            if os.path.isfile(profile_path):
                return cache_mtime < os.path.getmtime(profile_path)
    return False
Esempio n. 4
0
def _updated_software(config, cache_mtime):
    # pylint: disable=unused-argument
    config_version = config.get("DEFAULT").get("dp.version", fallback="0")
    return devpipeline_configure.version.ID > int(config_version, 16)
Esempio n. 5
0
def _raw_updated(config, cache_mtime):
    raw_mtime = os.path.getmtime(config.get("DEFAULT").get("dp.build_config"))
    return cache_mtime < raw_mtime