aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornee <nee.git@cock.li>2017-10-09 23:02:05 +0200
committerChristopher Baines <mail@cbaines.net>2017-12-11 19:12:23 +0000
commit47dc9a0dae35960ec6239152df748bb062c640b2 (patch)
tree075ef3b862b740f0ae6253c61b5b84762e18a972
parent1e52fd83c2f03f9fb3de9dde662bccd4407a9309 (diff)
downloadpatches-47dc9a0dae35960ec6239152df748bb062c640b2.tar
patches-47dc9a0dae35960ec6239152df748bb062c640b2.tar.gz
guix: utils: Add version-major.
* guix/utils.scm (version-major): New procedure.
-rw-r--r--guix/utils.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/guix/utils.scm b/guix/utils.scm
index fed31f4ca4..92e45de616 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -82,6 +82,7 @@
version>=?
version-prefix
version-major+minor
+ version-major
guile-version>?
string-replace-substring
arguments-from-environment-variable
@@ -497,6 +498,10 @@ For example, (version-prefix \"2.1.47.4.23\" 3) returns \"2.1.47\""
minor version numbers from version-string."
(version-prefix version-string 2))
+(define (version-major version-string)
+ "Return the major version number as string from the version-string."
+ (version-prefix version-string 1))
+
(define (version>? a b)
"Return #t when A denotes a version strictly newer than B."
(eq? '> (version-compare a b)))