diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2022-03-29 14:47:37 +0200 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2022-09-07 07:55:05 +0200 |
commit | 4755d4939973cb625f67db44f4838127141d1016 (patch) | |
tree | e01b014d2154698b8bc9a71e678f73b7749bacac | |
parent | dbf1608cf646139a649793b53b641d6ec415b568 (diff) | |
download | autoconf-archive-4755d4939973cb625f67db44f4838127141d1016.tar.gz |
AX_R_PACKAGE: Fix version comparison.
* m4/ax_r_package.m4 (AX_R_PACKAGE): Use compareVersion instead of
comparing strings.
-rw-r--r-- | m4/ax_r_package.m4 | 4 |
1 files 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.]) |