From: "Ludovic Courtès" <ludo@gnu.org>
To: Efraim Flashner <efraim@flashner.co.il>
Cc: guix-devel@gnu.org
Subject: Re: `guix lint' warn of GitHub autogenerated source tarballs
Date: Sat, 05 Jan 2019 18:39:53 +0100 [thread overview]
Message-ID: <87zhsf2ec6.fsf@gnu.org> (raw)
In-Reply-To: <20181225143202.GO2581@macbook41> (Efraim Flashner's message of "Tue, 25 Dec 2018 16:32:02 +0200")
Hello!
Efraim Flashner <efraim@flashner.co.il> skribis:
> From dcd8b207f932289cb3b35720af45f49f849b7c27 Mon Sep 17 00:00:00 2001
> From: Efraim Flashner <efraim@flashner.co.il>
> 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=? (uri-host (string->uri uri)) "github.com")
> + (string=? (third (split-and-decode-uri-path
> + (uri-path (string->uri uri))))
> + "archive"))
‘third’ could fail badly if the list has fewer elements, so I’d suggest
writing it something like:
(when (and …
(match (split-and-decode-uri-path …)
((_ _ "archive" _ ...) #t)
(_ #f)))
…)
Otherwise LGTM, thank you!
Ludo’.
next prev parent reply other threads:[~2019-01-05 17:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-18 20:45 `guix lint' warn of GitHub autogenerated source tarballs Arun Isaac
2018-12-19 8:43 ` Pierre Neidhardt
2018-12-19 14:07 ` Ludovic Courtès
2018-12-19 14:33 ` Efraim Flashner
2018-12-19 17:43 ` Arun Isaac
2018-12-19 19:29 ` Efraim Flashner
2018-12-21 20:50 ` Ludovic Courtès
2018-12-21 21:00 ` swedebugia
2018-12-25 14:32 ` Efraim Flashner
2019-01-05 17:39 ` Ludovic Courtès [this message]
2019-01-05 21:25 ` Learning the match-syntax swedebugia
2019-01-05 22:35 ` Ricardo Wurmus
2019-01-06 21:36 ` Chris Marusich
2019-01-07 17:34 ` swedebugia
2019-01-07 22:18 ` Ricardo Wurmus
2019-01-08 8:25 ` swedebugia
2019-01-08 20:32 ` Ricardo Wurmus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zhsf2ec6.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=efraim@flashner.co.il \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.