From patchwork Sat Oct 7 19:45:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Giacomo Leidi X-Patchwork-Id: 54587 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C70EF27BBEA; Sat, 7 Oct 2023 20:47:07 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D357127BBE2 for ; Sat, 7 Oct 2023 20:47:06 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpDG9-0000W1-1B; Sat, 07 Oct 2023 15:46:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpDG7-0000Vp-DZ for guix-patches@gnu.org; Sat, 07 Oct 2023 15:46:43 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpDG7-0008VA-5N for guix-patches@gnu.org; Sat, 07 Oct 2023 15:46:43 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qpDGQ-0004Td-A4 for guix-patches@gnu.org; Sat, 07 Oct 2023 15:47:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66396] [PATCH] guix: Add case to Github url updater. Resent-From: Giacomo Leidi Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Oct 2023 19:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66396 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66396@debbugs.gnu.org Cc: Giacomo Leidi X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.169670797217112 (code B ref -1); Sat, 07 Oct 2023 19:47:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Oct 2023 19:46:12 +0000 Received: from localhost ([127.0.0.1]:55970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpDFb-0004Rw-Gd for submit@debbugs.gnu.org; Sat, 07 Oct 2023 15:46:11 -0400 Received: from lists.gnu.org ([2001:470:142::17]:55088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpDFZ-0004Rg-Jr for submit@debbugs.gnu.org; Sat, 07 Oct 2023 15:46:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpDF9-0008JB-SX for guix-patches@gnu.org; Sat, 07 Oct 2023 15:45:44 -0400 Received: from confino.investici.org ([93.190.126.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpDF7-0008Or-5R for guix-patches@gnu.org; Sat, 07 Oct 2023 15:45:43 -0400 Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4S2wkn04h4z118p; Sat, 7 Oct 2023 19:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1696707937; bh=4ztMqVeGh1sMQFn0vClzwxYldcAO+XBo06zMubuM/1c=; h=From:To:Cc:Subject:Date:From; b=lr6eywly9Q8nupDA4g8jB+EHHAC1Fxnb4NN3kh6UciSa0Rx00HLnI18Cq7UG9y8da sI6P4Dlf5m0FlsEFSiGqQeJ0r2PGfe+xgIte+DkkEeU8A2syqGQRa6DkleArro9F65 Wvnr9PgU+iF5VIIXtw8UDSQ1lNSdctzO+98GXnCg= Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: goodoldpaul@autistici.org) by localhost (Postfix) with ESMTPSA id 4S2wkm6gnZz117w; Sat, 7 Oct 2023 19:45:36 +0000 (UTC) Date: Sat, 7 Oct 2023 21:45:11 +0200 Message-ID: <1ed23c30a7592facd1db4c28c0f3cfb908157d9e.1696707911.git.goodoldpaul@autistici.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=93.190.126.19; envelope-from=goodoldpaul@autistici.org; helo=confino.investici.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Giacomo Leidi X-ACL-Warn: , Giacomo Leidi via Guix-patches X-Patchwork-Original-From: Giacomo Leidi via Guix-patches via From: Giacomo Leidi Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/import/github.scm (updated-github-url)[updated-url]: Add additional heuristics to Github url updater. --- guix/import/github.scm | 7 +++++++ 1 file changed, 7 insertions(+) base-commit: 00a28bc435606dc98925fbae1ebe314881f35c90 diff --git a/guix/import/github.scm b/guix/import/github.scm index 7409c9a202..c5556d78ee 100644 --- a/guix/import/github.scm +++ b/guix/import/github.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2019 Efraim Flashner ;;; Copyright © 2022 Maxime Devos ;;; Copyright © 2022 Hartmut Goebel +;;; Copyright © 2023 Giacomo Leidi ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ (define-module (guix import github) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) @@ -96,6 +98,11 @@ (define (updated-github-url old-package new-version) url) (string-append prefix "/releases/download/" repo "-" new-version "/" repo "-" new-version ext)) + ((string-match (string-append "/releases/download/(v)?" version "/" + name ".*" ext "$") + url) + (string-replace-substring url version new-version)) + (#t #f))) ; Some URLs are not recognised. #f))