From 4fd3650aec46281cf7dc9ef5e5a649a390e3b958 Mon Sep 17 00:00:00 2001 From: blundellc Date: Sat, 13 Sep 2008 13:18:48 +0000 Subject: [PATCH] depends+license: use boolean masking on arrow of rownames instead of directly on available when reversing arcs. typo in license simplification. 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 | 2 +- pkg/trunk/R/rdep.R | 16 +++++++--------- pkg/trunk/exec/build | 2 ++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/trunk/R/license.R b/pkg/trunk/R/license.R index 928ffd5..ba84164 100644 --- a/pkg/trunk/R/license.R +++ b/pkg/trunk/R/license.R @@ -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 diff --git a/pkg/trunk/R/rdep.R b/pkg/trunk/R/rdep.R index 305e43f..fe87c69 100644 --- a/pkg/trunk/R/rdep.R +++ b/pkg/trunk/R/rdep.R @@ -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)) diff --git a/pkg/trunk/exec/build b/pkg/trunk/exec/build index 63ccf3b..f58246e 100755 --- a/pkg/trunk/exec/build +++ b/pkg/trunk/exec/build @@ -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) -- 2.39.5