|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
From d8f6518b91f3c493471fa73b7ca98759e895a3d7 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
From: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Date: Sat, 12 Jul 2014 18:59:19 +0300
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Subject: [PATCH] path-lookup: don't make ~/.local/share/systemd/user a symlink
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
We already encourage upstreams to keep the default configuration
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
separate from user customizations for software that is installed in
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
the system location. Let's allow that separation also for software
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
that is installed in the home directory.
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Some discussion:
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
http://thread.gmane.org/gmane.comp.sysutils.systemd.devel/19627
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
(cherry picked from commit 667a1cd645c9402921dedff08a86bb35cddbcbf9)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
src/shared/path-lookup.c | 18 ------------------
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
1 file changed, 18 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
index e0aaf4431f..7d53d859b6 100644
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
--- a/src/shared/path-lookup.c
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+++ b/src/shared/path-lookup.c
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
@@ -125,26 +125,8 @@ static char** user_dirs(
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
goto fail;
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
} else if (home) {
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- _cleanup_free_ char *data_home_parent = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
if (asprintf(&data_home, "%s/.local/share/systemd/user", home) < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
goto fail;
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- /* There is really no need for two unit dirs in $HOME,
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- * except to be fully compliant with the XDG spec. We
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- * now try to link the two dirs, so that we can
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- * minimize disk seeks a little. Further down we'll
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- * then filter out this link, if it is actually is
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- * one. */
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- if (path_get_parent(data_home, &data_home_parent) >= 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- _cleanup_free_ char *config_home_relative = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- if (path_make_relative(data_home_parent, config_home, &config_home_relative) >= 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- mkdir_parents_label(data_home, 0777);
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- (void) symlink(config_home_relative, data_home);
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- }
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- }
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
e = getenv("XDG_DATA_DIRS");
|