summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorRicardo Wurmus <ricardo.wurmus@mdc-berlin.de>2015-06-23 16:35:16 +0200
committerDavid Thompson <dthompson@vistahigherlearning.com>2015-06-23 16:37:07 -0400
commitaad72327d17a1479f586af3cdb7123ffec2d9719 (patch)
treefec824a5e8f0add0de3e5ae008ea414dcec59bd9 /guix
parentb97a8ef94909bd07f7f2013a399ab43e310693bd (diff)
view: json: Add "location" field to JSON representation.
* guix/web/view/json.scm (package->json): Add "location" field.
Diffstat (limited to 'guix')
-rw-r--r--guix/web/view/json.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/guix/web/view/json.scm b/guix/web/view/json.scm
index e3f8bc1..73b78f3 100644
--- a/guix/web/view/json.scm
+++ b/guix/web/view/json.scm
@@ -25,6 +25,7 @@
#:use-module (guix licenses)
#:use-module (guix packages)
#:use-module (guix profiles)
+ #:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (guix web package)
#:export (all-packages-json
@@ -63,6 +64,9 @@
("version" ,(package-version package))
("synopsis" ,(package-synopsis package))
("description" ,(package-description package))
+ ("location" ,(last (string-split (location-file
+ (package-location package))
+ #\/)))
("homepage" ,(package-home-page package))
("license" ,(serialize-license package))
,@(if serialize-inputs?