summary refs log tree commit diff
path: root/pkgs/applications/science/math/R/fix-tests-without-recommended-packages.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science/math/R/fix-tests-without-recommended-packages.patch')
-rw-r--r--pkgs/applications/science/math/R/fix-tests-without-recommended-packages.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/applications/science/math/R/fix-tests-without-recommended-packages.patch b/pkgs/applications/science/math/R/fix-tests-without-recommended-packages.patch
new file mode 100644
index 00000000000..c736c7098a3
--- /dev/null
+++ b/pkgs/applications/science/math/R/fix-tests-without-recommended-packages.patch
@@ -0,0 +1,24 @@
+diff -Naur R-3.2.2-upstream/tests/reg-packages.R R-3.2.2/tests/reg-packages.R
+--- R-3.2.2-upstream/tests/reg-packages.R	2015-08-05 17:45:05.000000000 -0430
++++ R-3.2.2/tests/reg-packages.R	2015-10-01 02:11:05.484992903 -0430
+@@ -82,7 +82,8 @@
+ ## pkgB tests an empty R directory
+ dir.create(file.path(pkgPath, "pkgB", "R"), recursive = TRUE,
+ 	   showWarnings = FALSE)
+-p.lis <- if("Matrix" %in% row.names(installed.packages(.Library)))
++matrixIsInstalled <- "Matrix" %in% row.names(installed.packages(.Library))
++p.lis <- if(matrixIsInstalled)
+ 	     c("pkgA", "pkgB", "exNSS4") else "exNSS4"
+ for(p. in p.lis) {
+     cat("building package", p., "...\n")
+@@ -111,8 +112,8 @@
+   tools::assertError(is.null(pkgA:::nilData))
+ }
+ 
+-if(dir.exists(file.path("myLib", "exNSS4"))) {
+-    for(ns in c("pkgB", "pkgA", "Matrix", "exNSS4")) unloadNamespace(ns)
++if(matrixIsInstalled && dir.exists(file.path("myLib", "exNSS4"))) {
++    for(ns in c(rev(p.lis), "Matrix")) unloadNamespace(ns)
+     ## Both exNSS4 and Matrix define "atomicVector" *the same*,
+     ## but  'exNSS4'  has it extended - and hence *both* are registered in cache -> "conflicts"
+     requireNamespace("exNSS4", lib= "myLib")