@@ -39,6 +39,7 @@
channel-commit
channel-location
+ channel->sexp
%default-channels
channel-instance?
@@ -85,6 +86,14 @@
"Return true if CHANNEL is the 'guix' channel."
(eq? 'guix (channel-name channel)))
+(define channel->sexp
+ (match-lambda
+ (($ <channel> name url branch commit location)
+ `(channel
+ (name ,name)
+ (url ,url)
+ (commit ,commit)))))
+
(define-record-type <channel-instance>
(channel-instance channel commit checkout)
channel-instance?
@@ -18,6 +18,7 @@
(define-module (guix scripts describe)
#:use-module ((guix ui) #:hide (display-profile-content))
+ #:use-module (guix channels)
#:use-module (guix scripts)
#:use-module (guix describe)
#:use-module (guix profiles)
@@ -104,10 +105,9 @@ within a Git checkout."
(format #t (G_ " branch: ~a~%") (reference-shorthand head))
(format #t (G_ " commit: ~a~%") commit))
('channels
- (pretty-print `(list (channel
- (name 'guix)
- (url ,(dirname directory))
- (commit ,commit))))))
+ (pretty-print (channel->sexp (channel (name 'guix)
+ (url (dirname directory))
+ (commit commit))))))
(display-package-search-path fmt)))
(define (display-profile-info profile fmt)
@@ -116,34 +116,35 @@ in the format specified by FMT."
(define number
(generation-number profile))
+ (define (channels)
+ (map (lambda (entry)
+ (match (assq 'source (manifest-entry-properties entry))
+ (('source ('repository ('version 0)
+ ('url url)
+ ('branch branch)
+ ('commit commit)
+ _ ...))
+ (channel (name (string->symbol (manifest-entry-name entry)))
+ (url url)
+ (commit commit)))
+
+ ;; Pre-0.15.0 Guix does not provide that information,
+ ;; so there's not much we can do in that case.
+ (_ '???)))
+
+ ;; Show most recently installed packages last.
+ (reverse
+ (manifest-entries
+ (profile-manifest
+ (if (zero? number)
+ profile
+ (generation-file-name profile number)))))))
+
(match fmt
('human
(display-profile-content profile number))
('channels
- (pretty-print
- `(list ,@(map (lambda (entry)
- (match (assq 'source (manifest-entry-properties entry))
- (('source ('repository ('version 0)
- ('url url)
- ('branch branch)
- ('commit commit)
- _ ...))
- `(channel (name ',(string->symbol
- (manifest-entry-name entry)))
- (url ,url)
- (commit ,commit)))
-
- ;; Pre-0.15.0 Guix does not provide that information,
- ;; so there's not much we can do in that case.
- (_ '???)))
-
- ;; Show most recently installed packages last.
- (reverse
- (manifest-entries
- (profile-manifest
- (if (zero? number)
- profile
- (generation-file-name profile number))))))))))
+ (pretty-print (map channel->sexp (channels)))))
(display-package-search-path fmt))