]> git.donarmstrong.com Git - cran2deb.git/commitdiff
depends+license: use boolean masking on arrow of rownames instead of directly on...
authorblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:18:48 +0000 (13:18 +0000)
committerblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:18:48 +0000 (13:18 +0000)
since R, like MATLAB, treats containers as size 1 as scalars (at least
in some cases), it seems that foo[x,drop = F] where x is a container has
sometimes surprising results (e.g., forgetting rownames), particularly
when x is of size 1 and/or foo is of size 1.  instead only deal with the
form where foo is one dimensional -- this at least seems ok.

git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@62 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

pkg/trunk/R/license.R
pkg/trunk/R/rdep.R
pkg/trunk/exec/build

index 928ffd51be8c1f5367bc791f15af63ecf55789c2..ba84164bb1cc2c229a0173096a0c5e63a83c57dc 100644 (file)
@@ -15,7 +15,7 @@ is_acceptable_license <- function(license) {
     # uninteresting urls
     license = gsub('http://www.gnu.org/[[:alnum:]/._-]*','',license)
     license = gsub('http://www.x.org/[[:alnum:]/._-]*','',license)
-    license = gsub('http://www.opensource.org/[[:alnum]/._-]*','',license)
+    license = gsub('http://www.opensource.org/[[:alnum:]/._-]*','',license)
     # remove all punctuation
     license = gsub('[[:punct:]]+','',license)
     # remove any extra space introduced
index 305e43fe851e01cbe26f14f007af4766656ee142..fe87c699e8a885c7e18f05f2032ce8766cf65a79 100644 (file)
@@ -26,12 +26,10 @@ r.requiring <- function(names) {
         }
     }
     # approximately prune first into a smaller availability
-    candidates <- available[sapply(rownames(available)
-                                  ,function(name)
-                                      length(grep(paste(names,sep='|')
-                                                 ,available[name,r_depend_fields])) > 0)
-                           ,r_depend_fields
-                           ,drop=F]
+    candidates <- rownames(available)[sapply(rownames(available)
+                                            ,function(name)
+                                                length(grep(paste(names,sep='|')
+                                                           ,available[name,r_depend_fields])) > 0)]
     if (length(candidates) == 0) {
         return(c())
     }
@@ -42,14 +40,14 @@ r.requiring <- function(names) {
     prereq=c()
     dep_matches <- function(dep) chomp(gsub('\\([^\\)]+\\)','',dep)) %in% names
     any_dep_matches <- function(name,field=NA)
-                any(sapply(strsplit(chomp(candidates[name,field])
+                any(sapply(strsplit(chomp(available[name,field])
                                    ,'[[:space:]]*,[[:space:]]*')
                           ,dep_matches))
 
     for (field in r_depend_fields) {
-        matches = sapply(rownames(candidates), any_dep_matches, field=field)
+        matches = sapply(candidates, any_dep_matches, field=field)
         if (length(matches) > 0) {
-            prereq = c(prereq,rownames(candidates[matches,]))
+            prereq = c(prereq,candidates[matches])
         }
     }
     return(unique(prereq))
index 63ccf3b05495c4ca6b868f3a64e042e2643d676f..f58246e446e9118590f9747419c9ab0dbd3d32dd 100755 (executable)
@@ -50,6 +50,8 @@ go <- function(name,extra_deps) {
     })())
     cleanup(dir)
     if (inherits(pkg,'try-error')) {
+        message(paste('E: failure of',name,'means these packages will fail:'
+                     ,paste(r.dependency.closure(name,forward_arcs=F),collapse=', ')))
         stop(call.=F)
     }
     return(pkg)