in antlir/compiler/items/rpm_action.py [0:0]
def builder(subvol: Subvol) -> None:
# pyre-fixme[16]: `Path` has no attribute `__enter__`.
with _prepare_versionlock(
version_sets, layer_opts.version_set_override
) as versionlock_path:
# Convert porcelain RpmAction to plumbing YumDnfCommands. This
# is done in the builder because we need access to the subvol.
#
# Sort by command for determinism and clearer behaivor.
for cmd, nors in sorted(
_convert_actions_to_commands(
subvol, build_appliance, action_to_names_or_rpms
).items(),
key=lambda cn: YUM_DNF_COMMAND_ORDER[cn[0]],
):
# pyre-fixme[6]: Expected `List[Union[_LocalRpm, str]]` for
# 1st param but got `Union[_LocalRpm, str]`.
rpms, bind_ros = _rpms_and_bind_ros(nors)
_yum_dnf_using_build_appliance(
build_appliance=build_appliance,
# pyre-fixme[6]: Expected `List[Tuple[str, str]]` for
# 2nd param but got `List[str]`.
bind_ros=bind_ros,
install_root=subvol.path(),
protected_paths=protected_path_set(subvol),
versionlock_list=versionlock_path,
yum_dnf_args=[
cmd.value,
"--assumeyes",
# Sort ensures determinism even if `yum` or
# `dnf` is order-dependent
*sorted(rpms),
],
layer_opts=layer_opts,
)