From: blundellc Date: Sat, 13 Sep 2008 13:19:37 +0000 (+0000) Subject: depends: distinguish generated names of build/run-time as well as source/binary Debia... X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=cd8e3958aeac56bad534d89239bdd2a66c41cf59;p=cran2deb.git depends: distinguish generated names of build/run-time as well as source/binary Debian packages. This cleans up a few spurious uses of tolower(), special cases, and incorrect thinking. git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@68 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- diff --git a/pkg/trunk/R/debcontrol.R b/pkg/trunk/R/debcontrol.R index 2f2aca6..ce71bd6 100644 --- a/pkg/trunk/R/debcontrol.R +++ b/pkg/trunk/R/debcontrol.R @@ -3,14 +3,14 @@ get.dependencies <- function(pkg,extra_deps) { dependencies <- r.dependencies.of(description=pkg$description) depends <- list() # these are used for generating the Depends fields - as.deb <- function(r,binary) { + as.deb <- function(r,build) { return(pkgname.as.debian(paste(dependencies[r,]$name) ,version=dependencies[r,]$version ,repopref=pkg$repo - ,binary=binary)) + ,build=build)) } - depends$bin <- lapply(rownames(dependencies), as.deb, binary=T) - depends$build <- lapply(rownames(dependencies), as.deb, binary=F) + depends$bin <- lapply(rownames(dependencies), as.deb, build=F) + depends$build <- lapply(rownames(dependencies), as.deb, build=T) # add the command line dependencies depends$bin = c(extra_deps$deb,depends$bin) depends$build = c(extra_deps$deb,depends$build) @@ -23,8 +23,8 @@ get.dependencies <- function(pkg,extra_deps) { # make sure we depend upon R in some way... if (!length(grep('^r-base',depends$build))) { - depends$build = c(depends$build,pkgname.as.debian('R',version='>= 2.7.0',binary=F)) - depends$bin = c(depends$bin, pkgname.as.debian('R',version='>= 2.7.0',binary=T)) + depends$build = c(depends$build,pkgname.as.debian('R',version='>= 2.7.0',build=T)) + depends$bin = c(depends$bin, pkgname.as.debian('R',version='>= 2.7.0',build=F)) } # also include stuff to allow tcltk to build (suggested by Dirk) depends$build = c(depends$build,'xvfb','xauth','xfonts-base') @@ -40,8 +40,7 @@ get.dependencies <- function(pkg,extra_deps) { # the names of dependent source packages (to find the .changes file to # upload via dput). these can be found recursively. - depends$r = lapply(r.dependency.closure(dependencies) - ,tolower) + depends$r = r.dependency.closure(dependencies) # append command line dependencies depends$r = c(extra_deps$r, depends$r) return(depends) @@ -103,8 +102,7 @@ generate.control <- function(pkg) { control[2,'Provides'] = paste( lapply(r.bundle.contains(pkg$name) ,function(name) return(pkgname.as.debian(paste(name) - ,repopref=pkg$repo - ,binary=T))) + ,repopref=pkg$repo))) ,collapse=', ') } diff --git a/pkg/trunk/R/debiannaming.R b/pkg/trunk/R/debiannaming.R index 001262a..e090cb2 100644 --- a/pkg/trunk/R/debiannaming.R +++ b/pkg/trunk/R/debiannaming.R @@ -9,7 +9,7 @@ repourl.as.debian <- function(url) { stop(paste('unknown repository',url)) } -pkgname.as.debian <- function(name,repopref=NULL,version=NULL,binary=T) { +pkgname.as.debian <- function(name,repopref=NULL,version=NULL,binary=T,build=F) { # generate the debian package name corresponding to the R package name if (name %in% base_pkgs) { name = 'R' @@ -17,9 +17,13 @@ pkgname.as.debian <- function(name,repopref=NULL,version=NULL,binary=T) { if (name == 'R') { # R is special. if (binary) { - debname='r-base-core' + if (build) { + debname='r-base-dev' + } else { + debname='r-base-core' + } } else { - debname='r-base-dev' + debname='R' } } else { # XXX: data.frame rownames are unique, so always override repopref for @@ -31,8 +35,11 @@ pkgname.as.debian <- function(name,repopref=NULL,version=NULL,binary=T) { } name <- bundle } - repopref <- repourl.as.debian(available[name,'Repository']) - debname = paste('r',tolower(repopref),tolower(name),sep='-') + debname = tolower(name) + if (binary) { + repopref <- tolower(repourl.as.debian(available[name,'Repository'])) + debname = paste('r',repopref,debname,sep='-') + } } if (!is.null(version) && length(version) > 1) { debname = paste(debname,' (',version,')',sep='') diff --git a/pkg/trunk/R/rdep.R b/pkg/trunk/R/rdep.R index fe87c69..ec625f5 100644 --- a/pkg/trunk/R/rdep.R +++ b/pkg/trunk/R/rdep.R @@ -137,7 +137,7 @@ r.dependency.closure <- function(fringe, forward_arcs=T) { fringe <- list() } src <- pkgname.as.debian(top,binary=F) - if (!length(grep('^r-',src)) || length(grep('^r-base',src))) { + if (src == 'R') { next } newdeps <- fun(top)