[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

08/09: guix system: Add "describe" action.

From: guix-commits
Subject: 08/09: guix system: Add "describe" action.
Date: Fri, 6 Dec 2019 19:02:38 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 158032bd7dcc33d17da8091b2319bf59ee9db6a1
Author: Ludovic Court├Ęs <address@hidden>
Date:   Sat Nov 30 23:19:45 2019 +0100

    guix system: Add "describe" action.
    * 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 4c2ecd4..84548b1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -26301,6 +26301,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 129c248..3e95707 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -922,6 +922,8 @@ Some ACTIONS support additional ARGS.\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_ "\
    switch-generation switch to an existing operating system configuration\n"))
@@ -1196,6 +1198,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))))
      (apply (resolve-subcommand "search") args))
     ;; The following commands need to use the store, but they do not need an
@@ -1235,7 +1243,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))))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]