From d8a2e28b2f013a8624cb587f09f90120f46f1ce8 Mon Sep 17 00:00:00 2001 From: blundellc Date: Sun, 6 Jun 2010 19:00:54 +0000 Subject: [PATCH] rip bundles git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@312 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- trunk/R/debcontrol.R | 16 +------------- trunk/R/debiannaming.R | 6 ------ trunk/R/debianpkg.R | 13 +----------- trunk/R/getrpkg.R | 14 +----------- trunk/R/rdep.R | 48 +++--------------------------------------- trunk/R/version.R | 6 +----- 6 files changed, 7 insertions(+), 96 deletions(-) diff --git a/trunk/R/debcontrol.R b/trunk/R/debcontrol.R index 9018a2d..a044f89 100644 --- a/trunk/R/debcontrol.R +++ b/trunk/R/debcontrol.R @@ -131,16 +131,6 @@ generate_control <- function(pkg) { } control[2,'Depends'] <- paste(pkg$depends$bin,collapse=', ') -# # bundles provide virtual packages of their contents -# # unnecessary for now; cran2deb converts R bundles itself -# if (pkg$is_bundle) { -# control[2,'Provides'] = paste( -# lapply(r_bundle_contains(pkg$name) -# ,function(name) return(pkgname_as_debian(paste(name) -# ,repopref=pkg$repo))) -# ,collapse=', ') -# } - # generate the description descr <- 'GNU R package "' if ('Title' %in% colnames(pkg$description)) { @@ -148,11 +138,7 @@ generate_control <- function(pkg) { } else { descr <- paste(descr,pkg$name,sep='') } - if (pkg$is_bundle) { - long_descr <- pkg$description[1,'BundleDescription'] - } else { - long_descr <- pkg$description[1,'Description'] - } + long_descr <- pkg$description[1,'Description'] if (length(long_descr) < 1 || long_descr == "") { # bypass lintian extended-description-is-empty for which we care not. diff --git a/trunk/R/debiannaming.R b/trunk/R/debiannaming.R index 83c0ab5..7e07c9e 100644 --- a/trunk/R/debiannaming.R +++ b/trunk/R/debiannaming.R @@ -28,12 +28,6 @@ pkgname_as_debian <- function(name,repopref=NULL,version=NULL,binary=T,build=F) } else { # XXX: data.frame rownames are unique, so always override repopref for # now. - if (!(name %in% rownames(available))) { - bundle <- r_bundle_of(name) - if (!is.null(bundle)) { - name <- bundle - } - } debname = tolower(name) if (binary) { if (name %in% rownames(available)) { diff --git a/trunk/R/debianpkg.R b/trunk/R/debianpkg.R index 63aaadd..e3656d3 100644 --- a/trunk/R/debianpkg.R +++ b/trunk/R/debianpkg.R @@ -109,18 +109,7 @@ prepare_new_debian <- function(pkg,extra_deps) { # says: ``The sources and headers for the compiled code are in src, plus # optionally file Makevars or Makefile.'' It seems unlikely that # architecture independent code would end up here. - if (pkg$is_bundle) { - # if it's a bundle, check each of the packages - pkg$archdep = F - for (pkgname in r_bundle_contains(pkg$name)) { - pkg$archdep = file.exists(file.path(pkg$path,pkgname,'src')) - if (pkg$archdep) { - break - } - } - } else { - pkg$archdep = file.exists(file.path(pkg$path,'src')) - } + pkg$archdep = file.exists(file.path(pkg$path,'src')) pkg$arch <- 'all' if (pkg$archdep) { pkg$arch <- host_arch() diff --git a/trunk/R/getrpkg.R b/trunk/R/getrpkg.R index b5e990f..9c87c37 100644 --- a/trunk/R/getrpkg.R +++ b/trunk/R/getrpkg.R @@ -117,19 +117,9 @@ repack_pkg <- function(pkg) { prepare_pkg <- function(dir, pkgname) { # download and extract an R package named pkgname - # OR the bundle containing pkgname # based loosely on library/utils/R/packages2.R::install.packages - # first a little trick; change pkgname if pkgname is contained in a bundle - if (!(pkgname %in% rownames(available))) { - bundle <- r_bundle_of(pkgname) - if (is.null(bundle)) { - fail('package',pkgname,'is unavailable') - } - pkgname <- bundle - } - # grab the archive and some metadata pkg <- download_pkg(dir, pkgname) @@ -167,10 +157,8 @@ prepare_pkg <- function(dir, pkgname) { } } - pkg$is_bundle = 'Bundle' %in% names(pkg$description[1,]) # note subtly of short circuit operators (no absorption) - if ((!pkg$is_bundle && pkg$description[1,'Package'] != pkg$name) || - ( pkg$is_bundle && pkg$description[1,'Bundle'] != pkg$name)) { + if (pkg$description[1,'Package'] != pkg$name) { fail('package name mismatch') } return(pkg) 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)) } diff --git a/trunk/R/version.R b/trunk/R/version.R index 4094f4d..5795233 100644 --- a/trunk/R/version.R +++ b/trunk/R/version.R @@ -75,11 +75,7 @@ version_update <- function(rver, prev_pkgver, prev_success) { new_build_version <- function(pkgname) { if (!(pkgname %in% rownames(available))) { - bundle <- r_bundle_of(pkgname) - if (is.null(bundle)) { - fail('tried to discover new version of',pkgname,'but it does not appear to be available') - } - name <- bundle + fail('tried to discover new version of',pkgname,'but it does not appear to be available') } db_ver <- db_latest_build_version(pkgname) db_succ <- db_latest_build_status(pkgname)[[1]] -- 2.39.2