rpm-build/scripts/systemd-services.req.in
Alexey Shabalin 8b687ab59e systemd-services.req.in: fix autoreq for systemd units
Starting with systemd-239, Exec*= lines of unit files
are no longer required to reference absolute paths.
systemd-services.req, however, was expecting an absolute paths.

Given the new system-update-cleanup.service:
ExecStart=rm -fv /system-update
systemd-services.req used to find "/system-update" requirement:
systemd-services.req: /usr/src/tmp/systemd-buildroot/lib/systemd/system/system-update-cleanup.service: /system-update -> /system-update (raw, not installed)

This change updates systemd-services.req to the new systemd unit files
semantics, and also cleanups the code by removing redundant grep.
2023-01-25 19:50:49 +03:00

17 lines
304 B
Bash
Executable File

#!/bin/sh -efu
. @RPMCONFIGDIR@/functions
. @RPMCONFIGDIR@/find-package
SystemdServiceReq()
{
local bin
sed -n 's|^[[:space:]]*Exec[^=]*=[[:space:]]*[@:+!]*\([^[:space:]@:+!-][^[:space:]]*\).*|\1|p' "$1" |
while read bin; do
FindPackage "$1" "$bin"
done
}
ArgvFileAction SystemdServiceReq "$@"