From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: `guix lint' warn of GitHub autogenerated source tarballs Date: Sat, 05 Jan 2019 18:39:53 +0100 Message-ID: <87zhsf2ec6.fsf@gnu.org> References: <87pntxwqx0.fsf@gnu.org> <08635A1A-EDA5-44B0-8C8A-532F16683154@flashner.co.il> <20181219192926.GB2581@macbook41> <87imzmmwno.fsf@gnu.org> <20181225143202.GO2581@macbook41> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggsout.gnu.org ([209.51.188.92]:51830 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfpvQ-0001WB-Kl for guix-devel@gnu.org; Sat, 05 Jan 2019 12:39:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfpvQ-0006Zz-0U for guix-devel@gnu.org; Sat, 05 Jan 2019 12:39:56 -0500 Received: from hera.aquilenet.fr ([2a0c:e300::1]:39350) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gfpvP-0006Ze-Qh for guix-devel@gnu.org; Sat, 05 Jan 2019 12:39:55 -0500 In-Reply-To: <20181225143202.GO2581@macbook41> (Efraim Flashner's message of "Tue, 25 Dec 2018 16:32:02 +0200") 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" To: Efraim Flashner Cc: guix-devel@gnu.org Hello! Efraim Flashner skribis: > From dcd8b207f932289cb3b35720af45f49f849b7c27 Mon Sep 17 00:00:00 2001 > From: Efraim Flashner > Date: Tue, 25 Dec 2018 16:29:12 +0200 > Subject: [PATCH] lint: Add checker for unstable tarballs. > > * guix/scripts/lint.scm (check-source-unstable-tarball): New procedure. > (%checkers): Add it. > * tests/lint.scm ("source-unstable-tarball", "source-unstable-tarball: > source #f", "source-unstable-tarball: valid", "source-unstable-tarball: > package named archive", "source-unstable-tarball: not-github", > "source-unstable-tarball: git-fetch"): New tests. One last thing: > +(define (check-source-unstable-tarball package) > + "Emit a warning if PACKAGE's source is an autogenerated tarball." > + (define (check-source-uri uri) > + (when (and (string=3D? (uri-host (string->uri uri)) "github.com") > + (string=3D? (third (split-and-decode-uri-path > + (uri-path (string->uri uri)))) > + "archive")) =E2=80=98third=E2=80=99 could fail badly if the list has fewer elements, so= I=E2=80=99d suggest writing it something like: (when (and =E2=80=A6 (match (split-and-decode-uri-path =E2=80=A6) ((_ _ "archive" _ ...) #t) (_ #f))) =E2=80=A6) Otherwise LGTM, thank you! Ludo=E2=80=99.