From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCHv2] lint: add 'source' checker. Date: Thu, 15 Jan 2015 22:58:34 +0100 Message-ID: <87ppaf3dv9.fsf@gnu.org> References: <1419824407-6471-1-git-send-email-tipecaml@gmail.com> <1421308365-15655-1-git-send-email-tipecaml@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBsR8-0000Jk-9j for guix-devel@gnu.org; Thu, 15 Jan 2015 16:58:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBsR3-0006Oj-BN for guix-devel@gnu.org; Thu, 15 Jan 2015 16:58:42 -0500 Received: from hera.aquilenet.fr ([2a01:474::1]:41333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBsR3-0006OL-5M for guix-devel@gnu.org; Thu, 15 Jan 2015 16:58:37 -0500 In-Reply-To: <1421308365-15655-1-git-send-email-tipecaml@gmail.com> (Cyril Roelandt's message of "Thu, 15 Jan 2015 08:52:45 +0100") 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: Cyril Roelandt Cc: guix-devel@gnu.org Cyril Roelandt skribis: > * guix/scripts/lint.scm (validate-uri?): New procedure. > (%checkers): Add 'home-page' checker ^^^^^ Typo. > +(define (check-source package) > + "Emit a warning if PACKAGE has an invalid 'source' field, or if that > +'source' is not reachable." > + (let ((origin (package-source package))) > + (when (and origin > + (eqv? (origin-method origin) url-fetch)) > + (let* ((strings (origin-uri origin)) > + (uris (if (list? strings) > + (map string->uri strings) > + (list (string->uri strings))))) > + (for-each > + (match-lambda > + ((? uri? uri) > + (validate-uri uri package 'source)) > + (_ (error "internal linter error"))) Just: (for-each (cut validate-uri <> package 'source) ...) > + (concatenate (map (lambda (uri) > + (maybe-expand-mirrors uri %mirrors)) > + uris))))))) Here: (append-map (cut maybe-expand-mirrors <> %mirrors) uris) OK to push with these changes, thank you! The next step is to improve =E2=80=98probe-uri=E2=80=99 to handle FTP. Ludo=E2=80=99.