~ruther/guix-local

392e97ed0800ff3ed56bfe8cd54350a8bc2f9817 — Ludovic Courtès 3 years ago 69d72c5
import: gnome: Reject version strings such as "43.alpha".

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

* guix/import/gnome.scm (latest-gnome-release)[even-minor-version?]:
Reject VERSION is the minor or micro part is not an integer.
1 files changed, 8 insertions(+), 6 deletions(-)

M guix/import/gnome.scm
M guix/import/gnome.scm => guix/import/gnome.scm +8 -6
@@ 62,14 62,16 @@ not be determined."

  (define (even-minor-version? version)
    (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".
       (and minor (even? minor)))
      (((= string->number major) . _)
       (and minor (even? minor) micro))
      (((= string->number major) (= string->number minor))
       ;; GNOME applications have version strings like "42.1" (only two
       ;; integers) and are not subject to the odd/even policy.  MAJOR should
       ;; be a valid number though.
       major)))
       ;; integers) and are not subject to the odd/even policy.  MAJOR and
       ;; MINOR should be valid numbers though; "43.alpha" is rejected.
       (and major minor))
      (_
       #f)))

  (define upstream-name
    ;; Some packages like "NetworkManager" have camel-case names.