From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyril Roelandt Subject: [PATCH 01/12] guix: download: properly detect https when mirror:// is used. Date: Mon, 12 Oct 2015 23:40:57 +0200 Message-ID: <1444686068-7668-2-git-send-email-tipecaml@gmail.com> References: <1444686068-7668-1-git-send-email-tipecaml@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlkqQ-0003Z8-2i for guix-devel@gnu.org; Mon, 12 Oct 2015 17:41:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlkqN-0006wW-AT for guix-devel@gnu.org; Mon, 12 Oct 2015 17:41:22 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:33984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlkqN-0006w8-4L for guix-devel@gnu.org; Mon, 12 Oct 2015 17:41:19 -0400 Received: by wicgb1 with SMTP id gb1so65628523wic.1 for ; Mon, 12 Oct 2015 14:41:18 -0700 (PDT) In-Reply-To: <1444686068-7668-1-git-send-email-tipecaml@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org * guix/download.scm (url-fetch): fix need-gnutls? which always returned #f when a URL with "mirror://" scheme was used. --- guix/download.scm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/guix/download.scm b/guix/download.scm index 204cfc0..8ec47ce 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -235,13 +235,12 @@ in the store." (basename url)))) (define need-gnutls? - ;; True if any of the URLs need TLS support. - (let ((https? (cut string-prefix? "https://" <>))) - (match url - ((? string?) - (https? url)) - ((url ...) - (any https? url))))) + (let ((https? (lambda (uri) + (eq? 'https (uri-scheme uri))))) + (any https? (append-map (cut build:maybe-expand-mirrors <> %mirrors) + (match url + ((_ ...) (map string->uri url)) + (_ (list (string->uri url)))))))) (define builder #~(begin -- 2.1.4