From 313b78569ea2a3756619ee4eeabdd6c998f5ab8c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 28 May 2018 21:47:12 +0200 Subject: [PATCH] core: drop deprecated (and ignored) configuration items from --dump-configuration-items output --- src/core/load-fragment.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 2a11e4bbd05..0bc162ad1de 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -4973,13 +4973,24 @@ void unit_dump_config_items(FILE *f) { NULSTR_FOREACH(i, load_fragment_gperf_nulstr) { const char *rvalue = "OTHER", *lvalue; - unsigned j; + const ConfigPerfItem *p; size_t prefix_len; const char *dot; - const ConfigPerfItem *p; + unsigned j; assert_se(p = load_fragment_gperf_lookup(i, strlen(i))); + /* Hide legacy settings */ + if (p->parse == config_parse_warn_compat && + p->ltype == DISABLED_LEGACY) + continue; + + for (j = 0; j < ELEMENTSOF(table); j++) + if (p->parse == table[j].callback) { + rvalue = table[j].rvalue; + break; + } + dot = strchr(i, '.'); lvalue = dot ? dot + 1 : i; prefix_len = dot-i; @@ -4992,12 +5003,6 @@ void unit_dump_config_items(FILE *f) { fprintf(f, "[%.*s]\n", (int) prefix_len, i); } - for (j = 0; j < ELEMENTSOF(table); j++) - if (p->parse == table[j].callback) { - rvalue = table[j].rvalue; - break; - } - fprintf(f, "%s=%s\n", lvalue, rvalue); prev = i; }