From: Adrian Vovk Date: Thu, 19 Sep 2024 12:33:02 +0000 (-0400) Subject: updatectl: check: Don't print an empty table X-Git-Tag: v257-rc1~311^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=802d9b18e928e9d7071abbc80a4cb5450c9325be;p=thirdparty%2Fsystemd.git updatectl: check: Don't print an empty table If there are no updates available, `updatectl check` would previously just print an empty table. We should instead just tell the user that there are no updates available. --- diff --git a/src/sysupdate/updatectl.c b/src/sysupdate/updatectl.c index af27d0dc803..602ed1e4bf4 100644 --- a/src/sysupdate/updatectl.c +++ b/src/sysupdate/updatectl.c @@ -788,6 +788,11 @@ static int verb_check(int argc, char **argv, void *userdata) { if (r < 0) return log_error_errno(r, "Failed to start event loop: %m"); + if (table_isempty(table)) { + log_info("No updates available."); + return 0; + } + return table_print_with_pager(table, SD_JSON_FORMAT_OFF, arg_pager_flags, arg_legend); }