gnu-maintenance: 'gnu-package?' ignores invalid URLs.

* guix/gnu-maintenance.scm (gnu-package?)[gnu-home-page?]: Add '>>'
threading macro and use it.
This commit is contained in:
Ludovic Courtès 2017-01-27 23:40:04 +01:00
parent 38cb4766d8
commit 6715e1ff2e
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 11 additions and 5 deletions

View File

@ -187,11 +187,17 @@ network to check in GNU's database."
'non-gnu)))))
(define (gnu-home-page? package)
(and=> (package-home-page package)
(lambda (url)
(and=> (uri-host (string->uri url))
(letrec-syntax ((>> (syntax-rules ()
((_ value proc)
(and=> value proc))
((_ value proc rest ...)
(and=> value
(lambda (next)
(>> (proc next) rest ...)))))))
(>> package package-home-page
string->uri uri-host
(lambda (host)
(member host '("www.gnu.org" "gnu.org")))))))
(member host '("www.gnu.org" "gnu.org"))))))
(or (gnu-home-page? package)
(let ((url (and=> (package-source package) origin-uri))