]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/shared/path-lookup.c
shared/path-lookup: rearrange paths in --global mode to match --user mode
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 8 Feb 2018 13:12:13 +0000 (14:12 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 9 Feb 2018 11:27:34 +0000 (12:27 +0100)
commit7e684baf9038b536a511886a4d0a49554d128c7d
treed690e5fdff52fcf1a7344c159b5504b78770b131
parent7b6344d35fdbe523fb6eff2fdfa892d7f07ebfa9
shared/path-lookup: rearrange paths in --global mode to match --user mode

It's not good if the paths are in different order. With --user, we expect
more paths, but it must be a strict superset, and the order for the ones
that appear in both sets must be the same.

$  diff -u <(build/systemd-analyze --global unit-paths) <(build/systemd-analyze --user unit-paths)|colordiff
--- /proc/self/fd/14 2018-02-08 14:11:45.425353107 +0100
+++ /proc/self/fd/15 2018-02-08 14:11:45.426353116 +0100
@@ -1,6 +1,17 @@
+/home/zbyszek/.config/systemd/system.control
+/run/user/1000/systemd/system.control
+/run/user/1000/systemd/transient
+/run/user/1000/systemd/generator.early
+/home/zbyszek/.config/systemd/user
 /etc/systemd/user
+/run/user/1000/systemd/user
 /run/systemd/user
+/run/user/1000/systemd/generator
+/home/zbyszek/.local/share/systemd/user
+/home/zbyszek/.local/share/flatpak/exports/share/systemd/user
+/var/lib/flatpak/exports/share/systemd/user
 /usr/local/share/systemd/user
 /usr/share/systemd/user
 /usr/local/lib/systemd/user
 /usr/lib/systemd/user
+/run/user/1000/systemd/generator.late

A test is added so that we don't regress on this.
src/shared/path-lookup.c
src/test/test-path-lookup.c