craft_parts.executor.collisions module¶
Helpers to detect conflicting staging files from multiple parts.
- class craft_parts.executor.collisions.StageCandidate(part_name, contents, source_dir, permissions)[source]¶
Bases:
object
Representation of a set of files and directories that want to be staged.
- Parameters:
part_name (
str
)contents (
set
[str
])source_dir (
Path
)permissions (
list
[Permissions
])
-
contents:
set
[str
]¶
-
part_name:
str
¶
-
permissions:
list
[Permissions
]¶
-
source_dir:
Path
¶
- 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 ofPermissions
that affectpath1
.permissions_path2 (
Optional
[list
[Permissions
]]) – The list ofPermissions
that affectpath2
.path1 (
str
)path2 (
str
)
- Return type:
bool