craft_parts.executor.collisions module

Helpers to detect conflicting staging files from multiple parts.

craft_parts.executor.collisions.check_for_stage_collisions(part_list, partitions)[source]

Verify whether parts have conflicting files to stage.

If the partitions feature is enabled, then check if parts have conflicting files to

stage for each partition.

If the partitions feature is disabled, only check for conflicts in the default

stage directory.

Parameters:
  • part_list (list[Part]) – The list of parts to check.

  • partitions (list[str] | None) – An optional list of partition names.

Raises:
  • PartConflictError – If conflicts are found.

  • FeatureError – If partitions are specified but the feature is not enabled or if partitions are not specified and the feature is enabled.

Return type:

None

craft_parts.executor.collisions.paths_collide(path1, path2, permissions_path1=None, permissions_path2=None)[source]

Check whether the provided paths conflict to each other.

If both paths have Permissions definitions, they are considered to be conflicting if the permissions are incompatible (as defined by permissions.permissions_are_compatible()).

Parameters:
  • permissions_path1 (Optional[list[Permissions]]) – The list of Permissions that affect path1.

  • permissions_path2 (Optional[list[Permissions]]) – The list of Permissions that affect path2.

  • path1 (str)

  • path2 (str)

Return type:

bool