From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 09 05:05:12 2021 Received: (at 47670) by debbugs.gnu.org; 9 Apr 2021 09:05:12 +0000 Received: from localhost ([127.0.0.1]:49070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUn4i-0003ms-IO for submit@debbugs.gnu.org; Fri, 09 Apr 2021 05:05:12 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:37382 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUn4g-0003mX-Ec for 47670@debbugs.gnu.org; Fri, 09 Apr 2021 05:05:11 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1617959104; bh=yk7J3hhjFTEnNotmuLNGq4iYXnfKKScjpIRuxhvMPYY=; h=From:To:Subject:In-Reply-To:References:Date; b=PawVXOqXSDD0oQZOF7UyvfbGmFu2lhbdRvE4OwvfUhEfZVW28ThQqQsAtftoDTM0K OcI+VbBHj2xK7xzLq3ZuQo2Uy/uLL30pye6ETOfPgqGlgEaUn7BJIa7NH4o+ALEDzq qh1LJMafquR4h5/mJKIBx+gp7EcZnGbOV78sLLqA= To: 47670@debbugs.gnu.org Subject: [PATCH 1/2] upstream: Add predicate for Git URLs. In-Reply-To: References: Message-Id: <834e423bf8682e98d55bddb8f7c9b50389f7326c.1617958554.git.public@yoctocell.xyz> Date: Fri, 09 Apr 2021 11:05:03 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/upstream.scm (git-url-predicate): New procedure. --- guix/upstream.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/guix/upstream.scm b/guix/upstream.scm index 632e9ebc4f..47d11043dd 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2010, 2011, 2012, 2013, 2014, 20 [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS X-Debbugs-Envelope-To: 47670 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.9 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/upstream.scm (git-url-predicate): New procedure. --- guix/upstream.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/guix/upstream.scm b/guix/upstream.scm index 632e9ebc4f..47d11043dd 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2010, 2011, 2012, 2013, 2014, 20 [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * guix/upstream.scm (git-url-predicate): New procedure. --- guix/upstream.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/guix/upstream.scm b/guix/upstream.scm index 632e9ebc4f..47d11043dd 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -2,6 +2,7 @@ ;;; Copyright =C2=A9 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018,= 2019, 2020, 2021 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2015 Alex Kost ;;; Copyright =C2=A9 2019 Ricardo Wurmus +;;; Copyright =C2=A9 2021 Xinglu Chen ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ #:use-module (guix discovery) #:use-module ((guix download) #:select (download-to-store url-fetch)) + #:use-module (guix git-download) #:use-module (guix gnupg) #:use-module (guix packages) #:use-module (guix diagnostics) @@ -54,6 +56,7 @@ =20 url-predicate url-prefix-predicate + git-url-predicate coalesce-sources =20 upstream-updater @@ -185,6 +188,23 @@ MATCHING-URL?." source URLs starts with PREFIX." (url-predicate (cut string-prefix? prefix <>))) =20 +(define (git-url-predicate matching-url?) + "Return a predicate that returns true when passed a package whose source= is +an with the GIT-FETCH method, and one of its URLs passes +MATCHING-URL?." + (lambda (package) + (match (package-source package) + ((? origin? origin) + (and (eq? (origin-method origin) git-fetch) + (match (origin-uri origin) + ((? git-reference? git-reference) + (matching-url? (git-reference-url git-reference))) + (((? git-reference? git-reference) ...) + (any matching-url? (git-reference-url git-reference))) + (_ + #f)))) + (_ #f)))) + (define (upstream-source-archive-types release) "Return the available types of archives for RELEASE---a list of strings = such as \"gz\" or \"xz\"." --=20 2.31.1