]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hostnamectl,localectl: use "(unset)" in empty fields
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 20 Sep 2022 18:12:50 +0000 (20:12 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 21 Sep 2022 12:48:28 +0000 (14:48 +0200)
"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.

src/hostname/hostnamectl.c
src/locale/localectl.c
test/units/testsuite-73.sh

index a96241c42e1f1963f69d3f62ff6f84125786ba0f..abaea404a745285f89bef5b9a66bc83579ce1e08 100644 (file)
@@ -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();
 
index ebbf1074321c399818a2cfa7489515b7a608267b..b52a56be71d24109a4567675b6f1199e12f2e8c4 100644 (file)
@@ -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();
 
index d96e9f4151d7754a8ed78b3f4a66a49ab52f5665..f9e2dce1bf1fcf9cbcb6f7b532f024787ece3a2a 100755 (executable)
@@ -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"