summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-08-01 12:25:56 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-08-07 17:00:15 +0200
commitf9ad4ea2ca06e7067da269743d6f7d70b9ae4864 (patch)
treefc0819ee81d87c878230f3f094a62fc40668c851
parentdda6fec1dfc73d974827bbb540a043fc3ec76b18 (diff)
downloadsystemd-f9ad4ea2ca06e7067da269743d6f7d70b9ae4864.tar.gz
analyze: fix 'cat-config systemd/zram-generator.conf'
Also makes this work for various systemd config files that support .d. (cherry picked from commit 28365e88d0dfc6332b26120e23b2c39b7958f907)
-rw-r--r--src/shared/pretty-print.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/shared/pretty-print.c b/src/shared/pretty-print.c
index 69bae6883c..edba23985f 100644
--- a/src/shared/pretty-print.c
+++ b/src/shared/pretty-print.c
@@ -234,6 +234,12 @@ static int guess_type(const char **name, char ***prefixes, bool *is_collection,
if (!n)
return log_oom();
+ /* All systemd-style config files should support the /usr-/etc-/run split and
+ * dropins. Let's add a blanket rule that allows us to support them without keeping
+ * an explicit list. */
+ if (path_startswith(n, "systemd") && endswith(n, ".conf"))
+ usr = true;
+
delete_trailing_chars(n, "/");
if (endswith(n, ".d"))