Adding package-author.

This commit is contained in:
Alex Shinn 2014-06-16 23:16:40 +09:00
parent e8e3f701c5
commit 59cfb85caf
2 changed files with 11 additions and 2 deletions

View file

@ -75,11 +75,20 @@
(and lib (library-name lib))))))
(define (package-email pkg)
(and (pair? pkg)
(and (package? pkg)
(let ((sig (assq 'signature (cdr pkg))))
(and (pair? sig)
(assoc-get (cdr sig) 'email eq?)))))
(define (package-author repo pkg)
(and (package? pkg)
(let ((email (package-email pkg)))
(or (cond
((repo-find-publisher repo email)
=> (lambda (pub) (assoc-get pub 'name)))
(else #f))
email))))
(define (package-url repo pkg)
(let ((url (and (pair? pkg) (assoc-get (cdr pkg) 'url eq?))))
(if (and url (uri-has-scheme? url))

View file

@ -3,7 +3,7 @@
(export package? library?
package-name package-email package-url package-version
package-libraries package-provides? package-dependencies
package-installed-files
package-installed-files package-author
package-digest-mismatches package-signature-mismatches
package-digest-ok? package-signature-ok?
package->path package-name->meta-file