diff mbox series

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

Message ID 1ed23c30a7592facd1db4c28c0f3cfb908157d9e.1696707911.git.goodoldpaul@autistici.org
State New
Headers show
Series [bug#66396] guix: Add case to Github url updater. | expand

Commit Message

Giacomo Leidi Oct. 7, 2023, 7:45 p.m. UTC
* 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

Comments

Ludovic Courtès Oct. 23, 2023, 9:55 p.m. UTC | #1
Hi,

Giacomo Leidi <goodoldpaul@autistici.org> skribis:

> * guix/import/github.scm (updated-github-url)[updated-url]: Add
> additional heuristics to Github url updater.

[...]

> +           ((string-match (string-append "/releases/download/(v)?" version "/"
> +                                         name ".*" ext "$")
> +                          url)
> +            (string-replace-substring url version new-version))

Is it not already covered by one of the other cases?  Do you have an
example URL matched by this new clause?

Thanks,
Ludo’.
Giacomo Leidi Oct. 23, 2023, 10:05 p.m. UTC | #2
Hi Ludo’ ,

On 10/23/23 23:55, Ludovic Courtès wrote:
>> +           ((string-match (string-append "/releases/download/(v)?" version "/"
>> +                                         name ".*" ext "$")
>> +                          url)
>> +            (string-replace-substring url version new-version))
> Is it not already covered by one of the other cases?  Do you have an
> example URL matched by this new clause?
Yes, this patch fixes some failings I got from urls such as:

|https://github.com/derailed/k9s/releases/download/v||0.27.4||/k9s_Linux_amd64.tar.gz|

|https://github.com/metal3d/katenary/releases/download/||2.0.0-beta2||/katenary-linux-amd64|

|https://github.com/kubernetes/kompose/releases/download/v||1.30.0||/kompose-linux-amd64|


Thank you for your time,


giacomo
Giacomo Leidi Dec. 3, 2023, 10:03 p.m. UTC | #3
Hi,

On 10/24/23 00:05, paul wrote:
>
> Hi Ludo’ ,
>
> On 10/23/23 23:55, Ludovic Courtès wrote:
>>> +           ((string-match (string-append "/releases/download/(v)?" version "/"
>>> +                                         name ".*" ext "$")
>>> +                          url)
>>> +            (string-replace-substring url version new-version))
>> Is it not already covered by one of the other cases?  Do you have an
>> example URL matched by this new clause?

Besides k9s, kompose and katenary I believe also  pigx_rnaseq and 
pigx-chipseq  and probably others need this.


Thank you for your time,


giacomo
Giacomo Leidi Feb. 7, 2024, 12:50 a.m. UTC | #4
Hi Ludo’ ,

I made a detailed analysis on the current status of the updater. I'm 
attaching the source code I used.

There are ~239 packages (probably with some false positive due to 
deprecated packages I believe) that have a github.com origin-uri that 
currently are marked as having no updater:

guix time-machine -C channels-lock.scm -- repl -- t.scm | grep github.com | awk '{ print $1 }' | wc -l

239

This patch allows the following packages (and probably more in 
downstream channels) to be refreshed:

gnu/packages/admin.scm:4242:13: 4.9 is already the latest version of nnn
gnu/packages/admin.scm:4416:13: launchmon would be upgraded from 1.0.2 
to 1.2.0
gnu/packages/audio.scm:5814:13: lsp-dsp-lib would be upgraded from 
0.5.14 to 1.0.20
gnu/packages/bioinformatics.scm:9847:13: seqan would be upgraded from 
3.0.3 to 3.3.0
gnu/packages/bioinformatics.scm:9847:13: seqan would be upgraded from 
3.0.3 to 3.3.0
gnu/packages/bioinformatics.scm:9563:13: preseq would be upgraded from 
2.0.3 to 3.2.0
gnu/packages/bioinformatics.scm:18604:13: arriba would be upgraded from 
1.0.1 to 2.4.0
gnu/packages/build-tools.scm:436:13: premake would be upgraded from 
5.0.0-alpha15 to 5.0.0.alpha4
gnu/packages/compression.scm:2292:13: upx would be upgraded from 4.1.0 
to 4.2.2
gnu/packages/datastructures.scm:294:13: 2.1.1 is already the latest 
version of sdsl-lite
gnu/packages/dlang.scm:219:2: ldc would be upgraded from 1.35.0 to 1.36.0
gnu/packages/dns.scm:475:13: dnscrypt-wrapper would be upgraded from 
0.2.2 to 0.4.2
gnu/packages/engineering.scm:4303:13: rizin would be upgraded from 0.6.2 
to 0.6.3
gnu/packages/fontutils.scm:1585:13: libuninameslist would be upgraded 
from 20200313 to 20230916
gnu/packages/fontutils.scm:1563:13: libspiro would be upgraded from 
20200505 to 20221101
gnu/packages/game-development.scm:268:12: 5.2.2 is already the latest 
version of deutex
gnu/packages/game-development.scm:952:13: love would be upgraded from 
11.4 to 11.5
gnu/packages/game-development.scm:3057:13: 1.5.2 is already the latest 
version of dhewm3
gnu/packages/games.scm:2427:15: retux would be upgraded from 1.6.1 to 1.6.2
gnu/packages/games.scm:6336:13: 1.02e is already the latest version of 
mrrescue
gnu/packages/games.scm:5832:13: 2.4 is already the latest version of 
starfighter
gnu/packages/games.scm:9239:13: edgar would be upgraded from 1.36 to 1.37
gnu/packages/geo.scm:144:13: gmt would be upgraded from 6.4.0 to 6.5.0
gnu/packages/java.scm:11861:13: java-gson would be upgraded from 2.8.6 
to 2.10.1
gnu/packages/java.scm:8135:13: antlr3 would be upgraded from 3.5.2 to 3.5.3
gnu/packages/java.scm:8076:13: java-stringtemplate would be upgraded 
from 4.0.8 to 4.3.3
gnu/packages/java.scm:8135:13: antlr3 would be upgraded from 3.5.2 to 3.5.3
gnu/packages/maths.scm:221:13: bitwise would be upgraded from 0.43 to 0.50
gnu/packages/music.scm:6018:13: lsp-plugins would be upgraded from 1.2.3 
to 1.2.14
gnu/packages/networking.scm:2801:13: 21.1 is already the latest version 
of nzbget
gnu/packages/notcurses.scm:39:13: 3.0.9 is already the latest version of 
notcurses
gnu/packages/password-utils.scm:1406:13: 1.9 is already the latest 
version of hashcat-utils
gnu/packages/password-utils.scm:1490:13: 1.4.0 is already the latest 
version of bruteforce-luks
gnu/packages/solidity.scm:37:13: solidity would be upgraded from 0.8.15 
to 0.8.24
gnu/packages/sync.scm:568:13: rclone would be upgraded from 1.52.3 to 1.65.2
gnu/packages/virtualization.scm:2202:13: 0.4.7 is already the latest 
version of umoci
gnu/packages/virtualization.scm:2152:13: runc would be upgraded from 
1.1.9 to 1.1.12
gnu/packages/web-browsers.scm:108:13: 9.0 is already the latest version 
of midori
gnu/packages/wm.scm:791:13: 3.4.5 is already the latest version of icewm


I see this as an, albeit small, valuable addition. What do you think?

Thank you for your time

giacomo
Ludovic Courtès April 17, 2024, 9:12 a.m. UTC | #5
Hi,

paul <goodoldpaul@autistici.org> skribis:

> I made a detailed analysis on the current status of the updater. I'm
> attaching the source code I used.
>
> There are ~239 packages (probably with some false positive due to
> deprecated packages I believe) that have a github.com origin-uri that
> currently are marked as having no updater:
>
> guix time-machine -C channels-lock.scm -- repl -- t.scm | grep github.com | awk '{ print $1 }' | wc -l
>
> 239
>
> This patch allows the following packages (and probably more in
> downstream channels) to be refreshed:

Got it.  Finally applied with a commit log that explains this.

Thanks!

Ludo’.
diff mbox series

Patch

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))