aboutsummaryrefslogtreecommitdiff
path: root/guix/gnu-maintenance.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2013-02-12 12:02:15 -0500
committerMark H Weaver <mhw@netris.org>2013-02-12 20:34:25 -0500
commit0d1e6ce4d2e384b73fc393ca13602ac6db41c1be (patch)
tree65726a222f350f6e1905687580d3e75a3f386aa0 /guix/gnu-maintenance.scm
parent96be765ca5f89640b5d13e61ca04de7254040f3c (diff)
downloadgnu-guix-0d1e6ce4d2e384b73fc393ca13602ac6db41c1be.tar
gnu-guix-0d1e6ce4d2e384b73fc393ca13602ac6db41c1be.tar.gz
Add version-compare and version>? to utils.scm.
* guix/utils.scm (version-compare, version>?): New exported procedures, based on version-string>?, which was formerly in gnu-maintenance.scm. * guix/gnu-maintenance.scm (version-string>?): Removed procedure. (latest-release): Use 'version>?' instead of 'version-string>?'.
Diffstat (limited to 'guix/gnu-maintenance.scm')
-rw-r--r--guix/gnu-maintenance.scm12
1 files changed, 2 insertions, 10 deletions
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index c934694147..6475c386d3 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -28,6 +28,7 @@
#:use-module (srfi srfi-26)
#:use-module (system foreign)
#:use-module (guix ftp-client)
+ #:use-module (guix utils)
#:export (official-gnu-packages
releases
latest-release
@@ -156,21 +157,12 @@ pairs. Example: (\"mit-scheme-9.0.1\" . \"/gnu/mit-scheme/stable.pkg/9.0.1\").
files)
result)))))))
-(define version-string>?
- (let ((strverscmp
- (let ((sym (or (dynamic-func "strverscmp" (dynamic-link))
- (error "could not find `strverscmp' (from GNU libc)"))))
- (pointer->procedure int sym (list '* '*)))))
- (lambda (a b)
- "Return #t when B denotes a newer version than A."
- (> (strverscmp (string->pointer a) (string->pointer b)) 0))))
-
(define (latest-release project)
"Return (\"FOO-X.Y\" . \"/bar/foo\") or #f."
(let ((releases (releases project)))
(and (not (null? releases))
(fold (lambda (release latest)
- (if (version-string>? (car release) (car latest))
+ (if (version>? (car release) (car latest))
release
latest))
'("" . "")