diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-02-09 17:17:07 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-02-09 18:18:41 +0100 |
commit | cde1e967cfc0849c7010eda0bc700dadf222275f (patch) | |
tree | b1fe25aa7ed58a109aa737aa249c56de575d8927 /guix/utils.scm | |
parent | d4f12db8c07961543e3bb55a1d342680b925cc63 (diff) |
utils: Add 'version>=?'.
* guix/utils.scm (version>?): Clarify docstring.
(version>=?): New procedure.
Diffstat (limited to 'guix/utils.scm')
-rw-r--r-- | guix/utils.scm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/guix/utils.scm b/guix/utils.scm index 1c619c3ef9..3d38ba1223 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013, 2014, 2015 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net> @@ -67,6 +67,7 @@ %current-target-system version-compare version>? + version>=? version-prefix version-major+minor guile-version>? @@ -554,9 +555,15 @@ minor version numbers from version-string." (version-prefix version-string 2)) (define (version>? a b) - "Return #t when A denotes a newer version than B." + "Return #t when A denotes a version strictly newer than B." (eq? '> (version-compare a b))) +(define (version>=? a b) + "Return #t when A denotes a version newer or equal to B." + (case (version-compare a b) + ((> =) #t) + (else #f))) + (define (guile-version>? str) "Return #t if the running Guile version is greater than STR." ;; Note: Using (version>? (version) "2.0.5") or similar doesn't work, |