Ejemplo n.º 1
0
def _process_entry_parts(entry_parts, parts, origin, maintainer, description,
                         origin_name, origin_version):
    after_parts = set()
    parts_list = {}
    for part_name in entry_parts:
        if '/' in part_name:
            logger.warning(
                'DEPRECATED: Found a "/" in the name of the {!r} part'.format(
                    part_name))
        source_part = parts.get(part_name)
        replacements = project_loader.environment_to_replacements({
            'SNAPCRAFT_PROJECT_NAME':
            origin_name,
            'SNAPCRAFT_PROJECT_VERSION':
            origin_version,
        })

        source_part = project_loader.replace_attr(source_part, replacements)

        if source_part:
            source_part = _update_source(source_part, origin)
            source_part['maintainer'] = maintainer
            source_part['description'] = description

            parts_list[part_name] = source_part
            after = source_part.get("after", [])

            if after:
                after_parts.update(set(after))
        else:
            after_parts.add(part_name)

    return parts_list, after_parts
Ejemplo n.º 2
0
def _replace_in_part(part):
    for key, value in part.plugin.options.__dict__.items():
        replacements = project_loader.environment_to_replacements(
            project_loader.snapcraft_part_environment(part))

        value = project_loader.replace_attr(value, replacements)
        setattr(part.plugin.options, key, value)

    return part
Ejemplo n.º 3
0
def _replace_in_part(part):
    for key, value in part.plugin.options.__dict__.items():
        replacements = project_loader.environment_to_replacements(
            project_loader.snapcraft_part_environment(part)
        )

        value = project_loader.replace_attr(value, replacements)
        setattr(part.plugin.options, key, value)

    return part