summaryrefslogtreecommitdiff
path: root/guix/scripts/lint.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-04-23 19:43:59 +0200
committerMarius Bakke <mbakke@fastmail.com>2019-04-23 19:43:59 +0200
commit37da4fbe1562583589eeddb4be8e11bece80fd35 (patch)
tree4d8a454b27e62f9b8d7b0fe641a9f6aa6de2402c /guix/scripts/lint.scm
parent73326e742d82b6706333885eca770f7518636b1f (diff)
parente01bd1a67447c1f2a2b5b03e8ea8fbbccd2cd5bd (diff)
downloadguix-patches-37da4fbe1562583589eeddb4be8e11bece80fd35.tar
guix-patches-37da4fbe1562583589eeddb4be8e11bece80fd35.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'guix/scripts/lint.scm')
-rw-r--r--guix/scripts/lint.scm10
1 files changed, 6 insertions, 4 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index ddad5b7fd0..dc338a1d7b 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -45,7 +45,6 @@
#:use-module (guix cve)
#:use-module (gnu packages)
#:use-module (ice-9 match)
- #:use-module (ice-9 receive)
#:use-module (ice-9 regex)
#:use-module (ice-9 format)
#:use-module (web client)
@@ -796,10 +795,13 @@ descriptions maintained upstream."
(let ((uris (origin-uris origin)))
(for-each check-mirror-uri uris)))))
-(define (check-github-url package)
+(define* (check-github-url package #:key (timeout 3))
"Check whether PACKAGE uses source URLs that redirect to GitHub."
- (define (follow-redirect uri)
- (receive (response body) (http-head uri)
+ (define (follow-redirect url)
+ (let* ((uri (string->uri url))
+ (port (guix:open-connection-for-uri uri #:timeout timeout))
+ (response (http-head uri #:port port)))
+ (close-port port)
(case (response-code response)
((301 302)
(uri->string (assoc-ref (response-headers response) 'location)))