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
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
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