me
/
guix
Archived
1
0
Fork 0

import: gnome: Reject version strings such as "43.alpha".

Reported by Maxim Cournoyer.
This is a followup to 61b63e7fa7.

* guix/import/gnome.scm (latest-gnome-release)[even-minor-version?]:
Reject VERSION is the minor or micro part is not an integer.
master
Ludovic Courtès 2022-09-08 12:20:28 +02:00
parent 69d72c553f
commit 392e97ed08
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 8 additions and 6 deletions

View File

@ -62,14 +62,16 @@ not be determined."
(define (even-minor-version? version) (define (even-minor-version? version)
(match (string-tokenize version %not-dot) (match (string-tokenize version %not-dot)
(((= string->number major) (= string->number minor) micro) (((= string->number major) (= string->number minor) (= string->number micro))
;; This is for things like GLib, with version strings like "2.72.3". ;; This is for things like GLib, with version strings like "2.72.3".
(and minor (even? minor))) (and minor (even? minor) micro))
(((= string->number major) . _) (((= string->number major) (= string->number minor))
;; GNOME applications have version strings like "42.1" (only two ;; GNOME applications have version strings like "42.1" (only two
;; integers) and are not subject to the odd/even policy. MAJOR should ;; integers) and are not subject to the odd/even policy. MAJOR and
;; be a valid number though. ;; MINOR should be valid numbers though; "43.alpha" is rejected.
major))) (and major minor))
(_
#f)))
(define upstream-name (define upstream-name
;; Some packages like "NetworkManager" have camel-case names. ;; Some packages like "NetworkManager" have camel-case names.