systemd-path: add 'system-search-configuration'

This provides functionality to replace what was provided by the preceding
revert:

  $ build/systemd-path system-search-configuration --suffix=sysctl.d
  /etc/sysctl.d:/run/sysctl.d:/usr/local/lib/sysctl.d:/usr/lib/sysctl.d

The result is identical, but more generic, since by changing suffix we can also
get the answer for sysusers.d, tmpfiles.d, and any other of the directories
which follow the same general rule.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-11-13 14:02:30 +01:00
parent 14a9fb7a8e
commit dc04a884e0
5 changed files with 11 additions and 0 deletions

View File

@@ -51,6 +51,8 @@ assert_eq "$(systemd-path --suffix='' system-runtime)" "/run"
assert_eq "$(systemd-path --suffix='🤔' system-runtime)" "/run/🤔"
assert_eq "$(systemd-path --suffix=hello system-runtime)" "/run/hello"
assert_eq "$(systemd-path system-search-configuration --suffix=sysctl.d)" "/etc/sysctl.d:/run/sysctl.d:/usr/local/lib/sysctl.d:/usr/lib/sysctl.d"
# Note for the stuff below: everything defaults to $HOME, only the desktop
# directory defaults to $HOME/Desktop.
#