From 4755d4939973cb625f67db44f4838127141d1016 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 29 Mar 2022 14:47:37 +0200 Subject: AX_R_PACKAGE: Fix version comparison. * m4/ax_r_package.m4 (AX_R_PACKAGE): Use compareVersion instead of comparing strings. --- m4/ax_r_package.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/ax_r_package.m4 b/m4/ax_r_package.m4 index 9455001..9982652 100644 --- a/m4/ax_r_package.m4 +++ b/m4/ax_r_package.m4 @@ -15,7 +15,7 @@ # # LICENSE # -# Copyright (c) 2017 Ricardo Wurmus +# Copyright (c) 2017, 2022 Ricardo Wurmus # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice @@ -48,7 +48,7 @@ AC_DEFUN([AX_R_PACKAGE], [ if test -n "VERSION" then - TEST=$( $R --silent --vanilla -e 'if(!(packageDescription("PKG")$Version >= "VERSION")) stop("not found")' 2>/dev/null ) + TEST=$( $R --silent --vanilla -e 'if(compareVersion(packageDescription("PKG")$Version, "VERSION") < 0) { stop("not found") }' 2>/dev/null ) AS_IF([test $? -eq 0], [], [ AC_MSG_RESULT([no]) AC_MSG_ERROR([You need at least version VERSION of the R package PKG.]) -- cgit v1.2.1