pub fn resolve_service_impacts(
items: &[PackageItem],
action: PreflightAction,
) -> Vec<ServiceImpact>Expand description
What: Resolve systemd service impacts for the selected transaction items.
Inputs:
items: Packages being installed or removed.action: Preflight action (install/update vs. remove).
Output:
- Vector of
ServiceImpactentries representing impacted systemd units.
Details:
- Inspects
pacman -Floutput for each package to find shipped unit files. - Determines which units are currently active via
systemctl list-units. - Heuristically detects binaries that impact active units, even without unit files.
- Computes a recommended restart decision; defaults to defer when the unit is inactive or the action is a removal.