summaryrefslogtreecommitdiff
path: root/guix/scripts/describe.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-02-24 19:37:03 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-02-24 19:37:03 +0100
commit3941af527df6f27c88258c5d3b78720a07fe60ef (patch)
tree4747f74f32faef8a4f20bf7adf797ce57a8324fc /guix/scripts/describe.scm
parentd85f8e46dbc5a978fe7359c89cbb3167fb9c2029 (diff)
parent7daae3c9d09a4d27586824a1d1af99e7af454d26 (diff)
downloadpatches-3941af527df6f27c88258c5d3b78720a07fe60ef.tar
patches-3941af527df6f27c88258c5d3b78720a07fe60ef.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'guix/scripts/describe.scm')
-rw-r--r--guix/scripts/describe.scm15
1 files changed, 11 insertions, 4 deletions
diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm
index f13f221da9..5e00067ef8 100644
--- a/guix/scripts/describe.scm
+++ b/guix/scripts/describe.scm
@@ -201,7 +201,11 @@ way and displaying details about the channel's source code."
(format #t (G_ " commit: ~a~%")
(if (supports-hyperlinks?)
(channel-commit-hyperlink channel commit)
- commit))))
+ commit))
+ (when (not (supports-hyperlinks?))
+ (format #t (G_ " URL: ~a~%")
+ (channel-commit-hyperlink channel commit
+ (lambda (url msg) url))))))
(_ #f)))
;; Show most recently installed packages last.
@@ -233,9 +237,12 @@ way and displaying details about the channel's source code."
(define* (channel-commit-hyperlink channel
#:optional
- (commit (channel-commit channel)))
+ (commit (channel-commit channel))
+ (transformer hyperlink))
"Return a hyperlink for COMMIT in CHANNEL, using COMMIT as the hyperlink's
-text. The hyperlink links to a web view of COMMIT, when available."
+text. The hyperlink links to a web view of COMMIT, when available.
+TRANSFORMER is a procedure of 2 arguments, a URI and text, and returns a
+string for display."
(let* ((url (channel-url channel))
(uri (string->uri url))
(host (and uri (uri-host uri))))
@@ -244,7 +251,7 @@ text. The hyperlink links to a web view of COMMIT, when available."
(#f
commit)
((_ template)
- (hyperlink (template url commit) commit)))
+ (transformer (template url commit) commit)))
commit)))