[systemd-commits] 2 commits - src/journal src/systemctl

Lennart Poettering lennart at kemper.freedesktop.org
Wed Sep 12 00:24:06 PDT 2012


 src/journal/journalctl.c  |   11 +++++++++--
 src/systemctl/systemctl.c |    6 ++++--
 2 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit cf5a3432117cfbe4249919d2e947295aa19879d3
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Sep 12 09:23:38 2012 +0200

    journalctl: print QR code only if we are running on an UTF-8 system

diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index e260054..8e52dd5 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -32,6 +32,8 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <linux/fs.h>
+#include <locale.h>
+#include <langinfo.h>
 
 #include <systemd/sd-journal.h>
 
@@ -634,8 +636,13 @@ static int setup_keys(void) {
                         fprintf(stderr, "\nThe keys have been generated for host " SD_ID128_FORMAT_STR ".\n", SD_ID128_FORMAT_VAL(machine));
 
 #ifdef HAVE_QRENCODE
-                fprintf(stderr, "\nTo transfer the verification key to your phone please scan the QR code below:\n\n");
-                print_qr_code(stderr, seed, seed_size, n, arg_interval, hn, machine);
+                /* If this is not an UTF-8 system don't print any QR codes */
+                setlocale(LC_CTYPE, "");
+
+                if (streq_ptr(nl_langinfo(CODESET), "UTF-8")) {
+                        fputs("\nTo transfer the verification key to your phone please scan the QR code below:\n\n", stderr);
+                        print_qr_code(stderr, seed, seed_size, n, arg_interval, hn, machine);
+                }
 #endif
                 free(hn);
         }

commit bb3241614a1a3a3ef68329dadc56e8fec090ff64
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Sep 12 08:56:57 2012 +0200

    systemctl: direct the user to list-unit-files from the list-units output

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 5102c8e..55202c7 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -425,9 +425,11 @@ static void output_units_list(const struct unit_info *unit_infos, unsigned c) {
                        "JOB    = Pending job for the unit.\n");
 
                 if (arg_all)
-                        printf("\n%u units listed.\n", n_shown);
+                        printf("\n%u loaded units listed.\n"
+                               "To show all installed unit files use 'systemctl list-unit-files'.\n", n_shown);
                 else
-                        printf("\n%u units listed. Pass --all to see inactive units, too.\n", n_shown);
+                        printf("\n%u loaded units listed. Pass --all to see loaded but inactive units, too.\n"
+                               "To show all installed unit files use 'systemctl list-unit-files'.\n", n_shown);
         }
 }
 



More information about the systemd-commits mailing list