From 59cfb85cafc541ce3eaba106a65e9d8988bda11a Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 16 Jun 2014 23:16:40 +0900 Subject: [PATCH] Adding package-author. --- lib/chibi/snow/package.scm | 11 ++++++++++- lib/chibi/snow/package.sld | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/chibi/snow/package.scm b/lib/chibi/snow/package.scm index 7b0ddb74..3f3686c2 100644 --- a/lib/chibi/snow/package.scm +++ b/lib/chibi/snow/package.scm @@ -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)) diff --git a/lib/chibi/snow/package.sld b/lib/chibi/snow/package.sld index 4ec95bca..42e8e6a2 100644 --- a/lib/chibi/snow/package.sld +++ b/lib/chibi/snow/package.sld @@ -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