Browse code

Fixed the loading of R.utils in findFiles. This loading had bad consequences for R CMD check - unfortunately. A better fix would be to take care of the problem at its root.

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/affxparser@30071 bc3139a8-67e5-0310-9ffc-ced21a209358

Kasper D. Hansen authored on 21/02/2008 04:58:15
Showing 3 changed files

... ...
@@ -1,5 +1,5 @@
1 1
 Package: affxparser
2
-Version: 1.11.3
2
+Version: 1.11.4
3 3
 Date: 2007-12-01
4 4
 Title: Affymetrix File Parsing SDK
5 5
 Author: Henrik Bengtsson, James Bullard, Kasper Daniel Hansen
... ...
@@ -12,7 +12,7 @@
12 12
 # \arguments{
13 13
 #  \item{pattern}{A regular expression file name pattern to match.}
14 14
 #  \item{paths}{A @character @vector of paths to be searched.}
15
-#  \item{recursive}{If @TRUE, the directory structure is searched 
15
+#  \item{recursive}{If @TRUE, the directory structure is searched
16 16
 #    breath-first, in lexicographic order.}
17 17
 #  \item{firstOnly}{If @TRUE, the method returns as soon as a matching
18 18
 #    file is found, otherwise not.}
... ...
@@ -25,12 +25,12 @@
25 25
 #
26 26
 # \section{Paths}{
27 27
 #   The \code{paths} argument may also contain paths specified as
28
-#   semi-colon (\code{";"}) separated paths, e.g. 
28
+#   semi-colon (\code{";"}) separated paths, e.g.
29 29
 #   \code{"/usr/;usr/bin/;.;"}.
30 30
 # }
31 31
 #
32 32
 # \section{Windows Shortcut links}{
33
-#   If package \pkg{R.utils} is available, Windows Shortcut links (*.lnk)
33
+#   If package \pkg{R.utils} is available and loaded , Windows Shortcut links (*.lnk)
34 34
 #   are recognized and can be used to immitate links to directories
35 35
 #   elsewhere.  For more details, see @see "R.utils::filePath".
36 36
 # }
... ...
@@ -80,7 +80,8 @@ findFiles <- function(pattern=NULL, paths=NULL, recursive=FALSE, firstOnly=TRUE,
80 80
   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
81 81
   # Prepare list of paths to be scanned
82 82
   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
83
-  hasRutils <- suppressWarnings(require(R.utils, quietly=TRUE));
83
+  hasRutilsLoaded "R.utils:package" %in% sub("_[0-9.-]*", "", search())
84
+  ## hasRutils <- suppressWarnings(require(R.utils, quietly=TRUE));
84 85
 
85 86
   # Don't search the same path twice
86 87
   paths <- unique(paths);
... ...
@@ -93,7 +94,7 @@ findFiles <- function(pattern=NULL, paths=NULL, recursive=FALSE, firstOnly=TRUE,
93 94
     path <- gsub("^[.][/\\]", "", path);
94 95
 
95 96
     # Follow Windows shortcut links?
96
-    if (hasRutils)
97
+    if (hasRutilsLoaded)
97 98
       path <- filePath(path, expandLinks="any");
98 99
 
99 100
     # Does the path exist and is it a directory
... ...
@@ -131,11 +132,11 @@ findFiles <- function(pattern=NULL, paths=NULL, recursive=FALSE, firstOnly=TRUE,
131 132
 
132 133
     # Expand Windows shortcut links?
133 134
     files0 <- files;
134
-    if (hasRutils) {
135
+    if (hasRutilsLoaded) {
135 136
       # Remember these
136 137
       files <- sapply(files, FUN=filePath, expandLinks="any", USE.NAMES=FALSE);
137 138
     }
138
- 
139
+
139 140
     # Keep only existing files and directories
140 141
     ok <- sapply(files, FUN=function(file) {
141 142
       (file.exists(path) && !is.na(file.info(file)$isdir));
... ...
@@ -214,7 +215,7 @@ findFiles <- function(pattern=NULL, paths=NULL, recursive=FALSE, firstOnly=TRUE,
214 215
 # 2007-08-30
215 216
 # o BUG FIX: Pattern matching was done on expanded filenames, whereas they
216 217
 #   should really be done on the non-expanded ones.  This, only applies to
217
-#   Windows shortcuts, but it is not the destination file that is of 
218
+#   Windows shortcuts, but it is not the destination file that is of
218 219
 #   interest, but the name of the shortcut file.
219 220
 # o BUG FIX: The recent update was not grep():ing correctly; forgot to
220 221
 #   extract the basename().
... ...
@@ -226,4 +227,4 @@ findFiles <- function(pattern=NULL, paths=NULL, recursive=FALSE, firstOnly=TRUE,
226 227
 # o Removed usage of R.utils for now.
227 228
 # 2006-03-14
228 229
 # o Created from findCdf.R.
229
-############################################################################  
230
+############################################################################
... ...
@@ -39,7 +39,7 @@
39 39
 }
40 40
 
41 41
 \section{Windows Shortcut links}{
42
-  If package \pkg{R.utils} is available, Windows Shortcut links (*.lnk)
42
+  If package \pkg{R.utils} is available and loaded, Windows Shortcut links (*.lnk)
43 43
   are recognized and can be used to immitate links to directories
44 44
   elsewhere.  For more details, see \code{\link[R.utils]{filePath}}.
45 45
 }