From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNmUb-000840-EV for guix-patches@gnu.org; Sat, 09 Dec 2017 16:17:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNmUY-0005Dy-AP for guix-patches@gnu.org; Sat, 09 Dec 2017 16:17:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:45507) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eNmUY-0005Dn-5W for guix-patches@gnu.org; Sat, 09 Dec 2017 16:17:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eNmUX-00040k-Vs for guix-patches@gnu.org; Sat, 09 Dec 2017 16:17:02 -0500 Subject: [bug#29629] [PATCH 1/2] guix: utils: Add version-major. References: <877etv7hgn.fsf@cbaines.net> In-Reply-To: <877etv7hgn.fsf@cbaines.net> Resent-Message-ID: From: Christopher Baines Date: Sat, 9 Dec 2017 21:16:49 +0000 Message-Id: <20171209211650.12619-1-mail@cbaines.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 29629@debbugs.gnu.org From: nee * guix/utils.scm (version-major): New procedure. --- guix/utils.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/guix/utils.scm b/guix/utils.scm index fed31f4ca..92e45de61 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))) -- 2.15.1