From sfalcon at fhcrc.org  Wed Aug 30 17:48:42 2006
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Wed, 30 Aug 2006 08:48:42 -0700
Subject: [Rd] Duplicated definition of helper in available.packages
Message-ID: <m2lkp6442t.fsf@ziti.fhcrc.org>

Hi,

The .checkRversion helper function is defined twice in
available.packages.  I'm pretty sure one definition will suffice.

Untested patch below.

+ seth


diff --git a/src/library/utils/R/packages.R b/src/library/utils/R/packages.R
index 0b84f02..5184992 100644
--- a/src/library/utils/R/packages.R
+++ b/src/library/utils/R/packages.R
@@ -86,13 +86,6 @@ available.packages <-
     }
     ## ignore packages which don't fit our version of R
     if(length(res)) {
-        .checkRversion <- function(x) {
-            if(is.na(xx <- x["Depends"])) return(TRUE)
-            xx <- tools:::.split_dependencies(xx)
-            if(length(z <- xx[["R"]]) > 1)
-                eval(parse(text=paste("currentR", z$op, "z$version")))
-            else TRUE
-        }
         currentR <- getRversion()
         res <- res[apply(res, 1, .checkRversion), , drop=FALSE]
     }




[Rd] Duplicated definition of helper in available.packages
Seth Falcon