From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:42818) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ibBIX-0006Pw-9t for guix-patches@gnu.org; Sat, 30 Nov 2019 17:33:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ibBIW-0004SN-6W for guix-patches@gnu.org; Sat, 30 Nov 2019 17:33:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57558) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ibBIW-0004SH-3Y for guix-patches@gnu.org; Sat, 30 Nov 2019 17:33:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ibBIW-0006lc-1Z for guix-patches@gnu.org; Sat, 30 Nov 2019 17:33:04 -0500 Subject: [bug#38441] [PATCH 5/5] guix system: Add "describe" action. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 30 Nov 2019 23:31:48 +0100 Message-Id: <20191130223148.14336-5-ludo@gnu.org> In-Reply-To: <20191130223148.14336-1-ludo@gnu.org> References: <20191130223148.14336-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 38441@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= * guix/scripts/system.scm (show-help): Add "describe". (process-command): Handle it. (guix-system): Likewise. * doc/guix.texi (Invoking guix system): Document it. --- doc/guix.texi | 4 ++++ guix/scripts/system.scm | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 198792c54a..cb4b0b45e7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -26240,6 +26240,10 @@ bootloader boot menu: @table @code +@item describe +Describe the current system generation: its file name, the kernel and +bootloader used, etc., as well as provenance information when available. + @item list-generations List a summary of each generation of the operating system available on disk, in a human-readable way. This is similar to the diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 0ddb40a03c..ccff68f1ab 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -921,6 +921,8 @@ Some ACTIONS support additional ARGS.\n")) reconfigure switch to a new operating system configuration\n")) (display (G_ "\ roll-back switch to the previous operating system configuration\n")) + (display (G_ "\ + describe describe the current system\n")) (display (G_ "\ list-generations list the system generations\n")) (display (G_ "\ @@ -1187,6 +1189,12 @@ argument list and OPTS is the option alist." ((pattern) pattern) (x (leave (G_ "wrong number of arguments~%")))))) (list-generations pattern))) + ((describe) + (match (generation-number %system-profile) + (0 + (error (G_ "no system generation, nothing to describe~%"))) + (generation + (display-system-generation generation)))) ((search) (apply (resolve-subcommand "search") args)) ;; The following commands need to use the store, but they do not need an @@ -1226,7 +1234,8 @@ argument list and OPTS is the option alist." (case action ((build container vm vm-image disk-image reconfigure init extension-graph shepherd-graph - list-generations delete-generations roll-back + list-generations describe + delete-generations roll-back switch-generation search docker-image) (alist-cons 'action action result)) (else (leave (G_ "~a: unknown action~%") action)))))) -- 2.24.0