summaryrefslogtreecommitdiff
blob: 8b4b76916e1db80b30608805707275fc15f1236a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Index: src/library/utils/R/packages.R
===================================================================
--- src/library/utils/R/packages.R	(revision 58579)
+++ src/library/utils/R/packages.R	(working copy)
@@ -323,6 +323,20 @@
 	oldPkgs <- old.packages(lib.loc = lib.loc,
 				contriburl = contriburl, method = method,
 				available = available, checkBuilt = checkBuilt)
+        ## prune package versions which are invisible to require()
+        if(!is.null(oldPkgs)) {
+            pkg <- 0
+            while(pkg < nrow(oldPkgs)) {
+                pkg <- pkg + 1
+                if(find.package(oldPkgs[pkg], lib.loc = lib.loc) != find.package(oldPkgs[pkg], lib.loc = oldPkgs[pkg,2])) {
+                    warning(sprintf("package '%s' in library '%s' will not be updated",
+                                    oldPkgs[pkg], oldPkgs[pkg, 2]),
+                            call. = FALSE, immediate. = TRUE)
+                    oldPkgs <- oldPkgs[-pkg, , drop = FALSE]
+                    pkg <- pkg - 1
+                }
+            }
+        }
 	if(is.null(oldPkgs))
 	    return(invisible())
     } else if (!(is.matrix(oldPkgs) && is.character(oldPkgs)))