guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: lint: 'validate-uri' really returns #f on failure.


From: Ludovic Courtès
Subject: 01/02: lint: 'validate-uri' really returns #f on failure.
Date: Sun, 31 May 2015 21:26:17 +0000

civodul pushed a commit to branch master
in repository guix.

commit 91a0b9cc0bd60864aac43ca137d66f3aea1f92b3
Author: Ludovic Courtès <address@hidden>
Date:   Sun May 31 23:13:09 2015 +0200

    lint: 'validate-uri' really returns #f on failure.
    
    * guix/scripts/lint.scm (validate-uri): Always return #f on failure.
---
 guix/scripts/lint.scm |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index cced1bd..b04e399 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -287,20 +287,22 @@ response from URI, and additional details, such as the 
actual HTTP response."
        (values 'unknown-protocol #f)))))
 
 (define (validate-uri uri package field)
-  "Return #t if the given URI can be reached, otherwise emit a
+  "Return #t if the given URI can be reached, otherwise return #f and emit a
 warning for PACKAGE mentionning the FIELD."
   (let-values (((status argument)
                 (probe-uri uri)))
     (case status
       ((http-response)
        (or (= 200 (response-code argument))
-           (emit-warning package
-                         (format #f
-                                 (_ "URI ~a not reachable: ~a (~s)")
-                                 (uri->string uri)
-                                 (response-code argument)
-                                 (response-reason-phrase argument))
-                         field)))
+           (begin
+             (emit-warning package
+                           (format #f
+                                   (_ "URI ~a not reachable: ~a (~s)")
+                                   (uri->string uri)
+                                   (response-code argument)
+                                   (response-reason-phrase argument))
+                           field)
+             #f)))
       ((ftp-response)
        (match argument
          (('ok) #t)
@@ -309,7 +311,8 @@ warning for PACKAGE mentionning the FIELD."
                         (format #f
                                 (_ "URI ~a not reachable: ~a (~s)")
                                 (uri->string uri)
-                                code (string-trim-both message))))))
+                                code (string-trim-both message)))
+          #f)))
       ((getaddrinfo-error)
        (emit-warning package
                      (format #f



reply via email to

[Prev in Thread] Current Thread [Next in Thread]