diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-09-04 17:22:55 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-09-04 17:22:55 +0200 |
commit | 7e1d229019c1924a2748e5daec2a619e7efbd7d7 (patch) | |
tree | 13a9ee538f851ec4ab28d173d75f13d241dc4b85 /guix/inferior.scm | |
parent | 1bf758767d1553594b6d7534ca8c38a2171b5afe (diff) | |
download | gnu-guix-7e1d229019c1924a2748e5daec2a619e7efbd7d7.tar gnu-guix-7e1d229019c1924a2748e5daec2a619e7efbd7d7.tar.gz |
inferior: Add home-page and location package accessors.
* guix/inferior.scm (inferior-package-home-page)
(inferior-package-location): New procedures.
* tests/inferior.scm ("inferior-packages"): Test them.
Diffstat (limited to 'guix/inferior.scm')
-rw-r--r-- | guix/inferior.scm | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/guix/inferior.scm b/guix/inferior.scm index 05c8d65deb..af37233a03 100644 --- a/guix/inferior.scm +++ b/guix/inferior.scm @@ -19,6 +19,7 @@ (define-module (guix inferior) #:use-module (srfi srfi-9) #:use-module (srfi srfi-9 gnu) + #:use-module ((guix utils) #:select (source-properties->location)) #:use-module (ice-9 match) #:use-module (ice-9 popen) #:export (inferior? @@ -33,7 +34,9 @@ inferior-packages inferior-package-synopsis - inferior-package-description)) + inferior-package-description + inferior-package-home-page + inferior-package-location)) ;;; Commentary: ;;; @@ -198,3 +201,18 @@ TRANSLATE? is true, translate it to the current locale's language." (if translate? '(compose (@ (guix ui) P_) package-description) 'package-description))) + +(define (inferior-package-home-page package) + "Return the home page of PACKAGE." + (inferior-package-field package 'package-home-page)) + +(define (inferior-package-location package) + "Return the source code location of PACKAGE, either #f or a <location> +record." + (source-properties->location + (inferior-package-field package + '(compose (lambda (loc) + (and loc + (location->source-properties + loc))) + package-location)))) |