package-author takes an optional arg to show email

This commit is contained in:
Alex Shinn 2014-06-23 23:37:29 +09:00
parent 99a1f55049
commit 6f8ba58642
2 changed files with 8 additions and 5 deletions

View file

@ -1050,7 +1050,7 @@
(display " ") (display i)
(display " ") (display (package-name pkg))
(display " ") (display (package-version pkg))
(display " (") (display (package-author repo pkg))
(display " (") (display (package-author repo pkg #t))
(display ")\n")
(lp (cdr ls) (+ i 1)))))
(let ((n (input-number cfg 'candidate-number "Candidate number: "

View file

@ -80,14 +80,17 @@
(and (pair? sig)
(assoc-get (cdr sig) 'email eq?)))))
(define (package-author repo pkg)
(define (package-author repo pkg . o)
(and (package? pkg)
(let ((email (package-email pkg)))
(let ((email (package-email pkg))
(show-email? (and (pair? o) (car o))))
(or (cond
((repo-find-publisher repo email)
=> (lambda (pub)
(string-append (or (assoc-get pub 'name) "")
" <" (or email "") ">")))
(let ((name (assoc-get pub 'name)))
(if (and name show-email?)
(string-append name " <" (or email "") ">")
(or name email "")))))
(else #f))
email))))