summaryrefslogtreecommitdiff
path: root/m4/ax_r_package.m4
diff options
context:
space:
mode:
authorHenrik Bengtsson <hb@aroma-project.org>2019-09-04 19:16:51 -0700
committerHenrik Bengtsson <hb@aroma-project.org>2019-09-04 20:16:08 -0700
commit21d5ec712652f347c9739347c07896fe04481230 (patch)
tree6c913ee881695ea437335045c8ac1c407a5ed9de /m4/ax_r_package.m4
parent74f2f6807edd33b2252e5f5cf2351a04f9e91a54 (diff)
downloadautoconf-archive-21d5ec712652f347c9739347c07896fe04481230.tar.gz
BUG FIX: Fixing a _R_CHECK_LENGTH_1_CONDITION_=true bug
If a package exists, the test for its existence produces an error with _R_CHECK_LENGTH_1_CONDITION_=true (introduced in R 3.4.0), e.g. $ _R_CHECK_LENGTH_1_CONDITION_=true R --silent --vanilla -e 'if(is.na(packageDescription("BH"))) stop("not found")' > if(is.na(packageDescription("BH"))) stop("not found") Error in if (is.na(packageDescription("BH"))) stop("not found") : the condition has length > 1 Execution halted This is because 'is.na(packageDescription("BH"))' resolved to a logical vector of 15(!) FALSE values when package 'BH' is installed. If it is not installed, then it resolves to TRUE. Bumping 'serial' (because that's what other PRs do)
Diffstat (limited to 'm4/ax_r_package.m4')
-rw-r--r--m4/ax_r_package.m44
1 files changed, 2 insertions, 2 deletions
diff --git a/m4/ax_r_package.m4 b/m4/ax_r_package.m4
index b8940e9..9455001 100644
--- a/m4/ax_r_package.m4
+++ b/m4/ax_r_package.m4
@@ -22,7 +22,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 1
+#serial 2
AC_DEFUN([AX_R_PACKAGE], [
pushdef([PKG],$1)
@@ -40,7 +40,7 @@ AC_DEFUN([AX_R_PACKAGE], [
AC_MSG_CHECKING([R package PKG VERSION])
- TEST=$( $R --silent --vanilla -e 'if(is.na(packageDescription("PKG"))) stop("not found")' 2>/dev/null )
+ TEST=$( $R --silent --vanilla -e 'if(system.file(package="PKG") == "") stop("not found")' 2>/dev/null )
AS_IF([test $? -eq 0], [], [
AC_MSG_RESULT([no])
AC_MSG_ERROR([R package PKG not found.])