From: Zbigniew Jędrzejewski-Szmek Date: Tue, 20 Sep 2022 18:12:50 +0000 (+0200) Subject: hostnamectl,localectl: use "(unset)" in empty fields X-Git-Tag: v252-rc1~115^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=639405b934c7785b2b8eebe26a4e584af6869069;p=thirdparty%2Fsystemd.git hostnamectl,localectl: use "(unset)" in empty fields "n/a" is more ambiguous: not available or not set or maybe we didn't check it. Let's just say directly that the field is not set. --- diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c index a96241c42e1..abaea404a74 100644 --- a/src/hostname/hostnamectl.c +++ b/src/hostname/hostnamectl.c @@ -92,7 +92,7 @@ static int print_status_info(StatusInfo *i) { table_set_header(table, false); - r = table_set_empty_string(table, "n/a"); + r = table_set_empty_string(table, "(unset)"); if (r < 0) return log_oom(); diff --git a/src/locale/localectl.c b/src/locale/localectl.c index ebbf1074321..b52a56be71d 100644 --- a/src/locale/localectl.c +++ b/src/locale/localectl.c @@ -81,7 +81,7 @@ static int print_status_info(StatusInfo *i) { table_set_header(table, false); - r = table_set_empty_string(table, "n/a"); + r = table_set_empty_string(table, "(unset)"); if (r < 0) return log_oom(); diff --git a/test/units/testsuite-73.sh b/test/units/testsuite-73.sh index d96e9f4151d..f9e2dce1bf1 100755 --- a/test/units/testsuite-73.sh +++ b/test/units/testsuite-73.sh @@ -251,7 +251,7 @@ test_vc_keymap() { assert_in "X11 Variant: intl" "$output" assert_in "X11 Options: terminate:ctrl_alt_bksp" "$output" elif [[ "$i" =~ ^us-.* ]]; then - assert_in "X11 Layout: n/a" "$output" + assert_in "X11 Layout: .unset." "$output" assert_not_in "X11 Model:" "$output" assert_not_in "X11 Variant:" "$output" assert_not_in "X11 Options:" "$output" @@ -262,7 +262,7 @@ test_vc_keymap() { systemctl stop systemd-localed.service wait_vconsole_setup rm -f /etc/vconsole.conf - assert_in "VC Keymap: n/a" "$(localectl)" + assert_in "VC Keymap: .unset." "$(localectl)" } test_x11_keymap() { @@ -374,7 +374,7 @@ XKBMODEL=pc105+inet" systemctl stop systemd-localed.service rm -f /etc/X11/xorg.conf.d/00-keyboard.conf /etc/default/keyboard output=$(localectl) - assert_in "X11 Layout: n/a" "$output" + assert_in "X11 Layout: .unset." "$output" assert_not_in "X11 Model:" "$output" assert_not_in "X11 Variant:" "$output" assert_not_in "X11 Options:" "$output"