mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
guix system: Fix 'describe' when booting the latest generation.
Fixes a regression introduced in
9679123ce0
, whereby 'guix system describe'
would error out when /run/current-system points to /gnu/store/…-system,
which is the case when booting the latest generation or after
reconfigure.
* guix/scripts/system.scm (process-command): For 'describe'. Try
'generation-number' with and without the optional argument.
This commit is contained in:
parent
ee92b0fb7d
commit
791069737c
1 changed files with 9 additions and 1 deletions
|
@ -1328,9 +1328,17 @@ argument list and OPTS is the option alist."
|
||||||
(x (leave (G_ "wrong number of arguments~%"))))))
|
(x (leave (G_ "wrong number of arguments~%"))))))
|
||||||
(list-generations pattern)))
|
(list-generations pattern)))
|
||||||
((describe)
|
((describe)
|
||||||
|
;; Describe the running system, which is not necessarily the current
|
||||||
|
;; generation. /run/current-system might point to
|
||||||
|
;; /var/guix/profiles/system-N-link, or it might point directly to
|
||||||
|
;; /gnu/store/…-system. Try both.
|
||||||
(match (generation-number "/run/current-system" %system-profile)
|
(match (generation-number "/run/current-system" %system-profile)
|
||||||
(0
|
(0
|
||||||
(leave (G_ "no system generation, nothing to describe~%")))
|
(match (generation-number %system-profile)
|
||||||
|
(0
|
||||||
|
(leave (G_ "no system generation, nothing to describe~%")))
|
||||||
|
(generation
|
||||||
|
(display-system-generation generation))))
|
||||||
(generation
|
(generation
|
||||||
(display-system-generation generation))))
|
(display-system-generation generation))))
|
||||||
((search)
|
((search)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue