X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=trunk%2FR%2Frdep.R;h=78c5d79bd97d401aa3e6cecc1b0e22e811ff6f2e;hb=d8a2e28b2f013a8624cb587f09f90120f46f1ce8;hp=8efaf454a1ff152254b8cc901f65a3eb44c0a61c;hpb=86e55bf48a319cf529b4a3519a11c0d94d47414b;p=cran2deb.git diff --git a/trunk/R/rdep.R b/trunk/R/rdep.R index 8efaf45..78c5d79 100644 --- a/trunk/R/rdep.R +++ b/trunk/R/rdep.R @@ -1,37 +1,6 @@ -r_bundle_of <- function(pkgname) { - return(NULL) ## there are no more bundles as of R 2.11.0 - - ## -- old code below, never reached - ## - # returns the bundle containing pkgname or NA - bundles <- names(available[!is.na(available[, 'Bundle']), 'Contains']) - # use the first bundle - for (bundle in bundles) { - if (pkgname %in% r_bundle_contains(bundle)) { - return(bundle) - } - } - return(NULL) -} - -r_bundle_contains <- function(bundlename) { - return(strsplit(available[bundlename,'Contains'],'[[:space:]]+')[[1]]) -} r_requiring <- function(names) { - #for (name in names) { - # if (!(name %in% base_pkgs) && !(name %in% rownames(available))) { - # bundle <- r_bundle_of(name) - # if (!is.null(bundle)) { - # name = bundle - # names <- c(names,bundle) - # } - # } - # if (name %in% rownames(available) && !is.na(available[name,'Contains'])) { - # names <- c(names,r_bundle_contains(name)) - # } - #} # approximately prune first into a smaller availability candidates <- rownames(available)[sapply(rownames(available) ,function(name) @@ -40,7 +9,7 @@ r_requiring <- function(names) { if (length(candidates) == 0) { return(c()) } - # find a logical index into available of every package/bundle + # find a logical index into available of every package # whose dependency field contains at least one element of names. # (this is not particularly easy to read---sorry---but is much faster than # the alternatives i could think of) @@ -71,13 +40,8 @@ r_dependencies_of <- function(name=NULL,description=NULL) { } if (is.null(description)) { if (!(name %in% rownames(available))) { - bundle <- r_bundle_of(name) - if (!is.null(bundle)) { - name <- bundle - } else { - # unavailable packages don't depend upon anything - return(data.frame()) - } + # unavailable packages don't depend upon anything + return(data.frame()) } description <- data.frame() # keep only the interesting fields @@ -117,12 +81,6 @@ r_parse_dep_field <- function(dep) { } version = sub(pat,'\\3',dep) dep = sub(pat,'\\1',dep) - if (!(dep %in% rownames(available))) { - depb <- r_bundle_of(dep) - if (!is.null(depb)) { - dep <- depb - } - } return(list(name=dep,version=version)) }