unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 38441@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#38441] [PATCH 5/5] guix system: Add "describe" action.
Date: Sat, 30 Nov 2019 23:31:48 +0100	[thread overview]
Message-ID: <20191130223148.14336-5-ludo@gnu.org> (raw)
In-Reply-To: <20191130223148.14336-1-ludo@gnu.org>

* 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

  parent reply	other threads:[~2019-11-30 22:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-30 22:30 [bug#38441] [PATCH 0/5] Record operating system provenance info Ludovic Courtès
2019-11-30 22:31 ` [bug#38441] [PATCH 1/5] services: Add 'provenance-service-type' Ludovic Courtès
2019-11-30 22:31   ` [bug#38441] [PATCH 2/5] guix system: Use 'provenance-service-type', add "--save-provenance" Ludovic Courtès
2019-11-30 22:31   ` [bug#38441] [PATCH 3/5] machine: Add provenance tracking to each machine operating system Ludovic Courtès
2019-11-30 22:31   ` [bug#38441] [PATCH 4/5] guix system: "list-generations" displays provenance info Ludovic Courtès
2019-11-30 22:31   ` Ludovic Courtès [this message]
2019-12-02 12:12 ` [bug#38441] [PATCH 0/5] Record operating system " zimoun
2019-12-07  0:03 ` bug#38441: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191130223148.14336-5-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=38441@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).