Ian Denhardt <i...@zenhack.net> writes: > diff --git a/guix/utils.scm b/guix/utils.scm > index 6392914..a179f6b 100644 > --- a/guix/utils.scm > +++ b/guix/utils.scm > @@ -2,6 +2,7 @@ > ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <l...@gnu.org> > ;;; Copyright © 2013 Mark H Weaver <m...@netris.org> > ;;; Copyright © 2014 Eric Bavier <bav...@member.fsf.org> > +;;; Copyright © 2014 Ian Denhardt <i...@zenhack.net> > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -64,6 +65,7 @@ > %current-system > %current-target-system > version-compare > + version-take-api > version>? > guile-version>? > package-name->name+version > @@ -518,6 +520,11 @@ or '= when they denote equal versions." > ((negative? result) '<) > (else '=)))))) > > +(define (version-take-api version-string) > + "Return \"<major>.<minor>\", where major and minor are the major and > +minor version numbers from version-string." > + (string-join (take (string-split version-string #\.) 2) ".")) > + > (define (version>? a b) > "Return #t when A denotes a newer version than B." > (eq? '> (version-compare a b)))
Let's keep 'version-compare' and 'version>?' adjacent, in both the export list and the implementation, since they are much more closely related to each other than to this new procedure. And as discussed in another message, let's rename the procedure and replace the hard-coded 2 with an argument. Thanks, Mark