guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#66396] [PATCH] guix: Add case to Github url updater.


From: Giacomo Leidi
Subject: [bug#66396] [PATCH] guix: Add case to Github url updater.
Date: Sat, 7 Oct 2023 21:45:11 +0200

* 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(+)

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 <efraim@flashner.co.il>
 ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2023 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;;
 ;;; 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))
 

base-commit: 00a28bc435606dc98925fbae1ebe314881f35c90
-- 
2.41.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]