[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] ui: 'package->recutils' serializes the source field.
From: |
David Craven |
Subject: |
[PATCH] ui: 'package->recutils' serializes the source field. |
Date: |
Fri, 5 Aug 2016 16:58:04 +0200 |
* guix/ui.scm (package->recutils): Format origin.
---
guix/ui.scm | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/guix/ui.scm b/guix/ui.scm
index 4d1b65c..e232548 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -26,6 +26,7 @@
(define-module (guix ui)
#:use-module (guix utils)
#:use-module (guix store)
+ #:use-module (guix base32)
#:use-module (guix config)
#:use-module (guix packages)
#:use-module (guix profiles)
@@ -33,6 +34,7 @@
#:use-module (guix combinators)
#:use-module (guix build-system)
#:use-module (guix serialization)
+ #:use-module (guix git-download)
#:use-module ((guix build utils) #:select (mkdir-p))
#:use-module ((guix licenses) #:select (license? license-name))
#:use-module ((guix build syscalls) #:select (terminal-columns))
@@ -878,6 +880,22 @@ WIDTH columns."
;; Note: Don't i18n field names so that people can post-process it.
(format port "name: ~a~%" (package-name p))
(format port "version: ~a~%" (package-version p))
+
+ (let ((uri (origin-uri (package-source p))))
+ (cond
+ ((git-reference? uri)
+ (begin
+ (format port "source-git-url: ~a~%"
+ (git-reference-url uri))
+ (format port "source-git-commit: ~a~%"
+ (git-reference-commit uri))
+ (format port "source-git-recursive: ~a~%"
+ (git-reference-recursive? uri))))
+ (#t
+ (format port "source-uri: ~a~%" uri))))
+
+ (format port "source-hash: ~a~%" (bytevector->base32-string
+ (origin-sha256 (package-source p))))
(format port "outputs: ~a~%" (string-join (package-outputs p)))
(format port "systems: ~a~%"
(string-join (package-transitive-supported-systems p)))
--
2.9.0
- How to get the package metadata as structured data?, Philippe Ombredanne, 2016/08/04
- Re: How to get the package metadata as structured data?, David Craven, 2016/08/04
- Re: How to get the package metadata as structured data?, Ludovic Courtès, 2016/08/04
- RE: How to get the package metadata as structured data?, Cook, Malcolm, 2016/08/04
- Re: How to get the package metadata as structured data?, David Craven, 2016/08/05
- Re: How to get the package metadata as structured data?, David Craven, 2016/08/05
- Re: How to get the package metadata as structured data?, Aljosha Papsch, 2016/08/05
- Re: How to get the package metadata as structured data?, Philippe Ombredanne, 2016/08/05
- [PATCH] ui: 'package->recutils' serializes the source field.,
David Craven <=
- Re: [PATCH] ui: 'package->recutils' serializes the source field., Alex Kost, 2016/08/06
- Re: [PATCH] ui: 'package->recutils' serializes the source field., David Craven, 2016/08/06
- Re: [PATCH] ui: 'package->recutils' serializes the source field., Mathieu Lirzin, 2016/08/06
- Re: [PATCH] ui: 'package->recutils' serializes the source field., David Craven, 2016/08/07
- Re: [PATCH] ui: 'package->recutils' serializes the source field., Mathieu Lirzin, 2016/08/07
- Re: [PATCH] ui: 'package->recutils' serializes the source field., David Craven, 2016/08/07
- Re: [PATCH] ui: 'package->recutils' serializes the source field., David Craven, 2016/08/07
- Re: [PATCH] ui: 'package->recutils' serializes the source field., Mathieu Lirzin, 2016/08/07
- Re: [PATCH] ui: 'package->recutils' serializes the source field., David Craven, 2016/08/07
- Re: [PATCH] ui: 'package->recutils' serializes the source field., Mathieu Lirzin, 2016/08/07