path-lookup: introduce user_search_dirs() (shall replace xdg_user_dirs())
authorMike Yuan <me@yhndnzj.com>
Sat, 14 Sep 2024 17:02:32 +0000 (19:02 +0200)
committerMike Yuan <me@yhndnzj.com>
Sun, 6 Oct 2024 17:42:39 +0000 (19:42 +0200)
commit1f8eedba9d9b2c81455c788d0edca2146d5f30a4
tree90dc45e58ee70d376e6e43765d614928051d2637
parent546110ded9c1cc0124e604f209c3f0ef442daaf0
path-lookup: introduce user_search_dirs() (shall replace xdg_user_dirs())

xdg_user_dirs() doesn't seem well-organized currently.
In all other xdg_user_*() funcs we assume /etc/xdg/systemd
to be a symlink to /etc/systemd/, hence it is the odd one out.
Also, when the relevant envvar is unset, it only returns
the global search dirs.

sd_path_lookup() actually covers this nicely with SD_PATH_SEARCH_*,
where the combined search paths (from user home and system) are used.
Therefore, let's introduce a wrapper for that, and deprecate xdg_user_dirs()
(would be removed in later commits).
src/libsystemd/sd-path/path-lookup.c
src/libsystemd/sd-path/path-lookup.h
src/tmpfiles/tmpfiles.c