X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=branch%2Fpatch%2FR%2Fdebiannaming.R;fp=branch%2Fpatch%2FR%2Fdebiannaming.R;h=0000000000000000000000000000000000000000;hb=21489018a9c733dc99bb8899ef53088166d0f189;hp=83c0ab58cf430782c2bb1e9c5b289832c4bd227e;hpb=49b44dc25b2664f0b2cbbed14a444d77c4d0ca07;p=cran2deb.git diff --git a/branch/patch/R/debiannaming.R b/branch/patch/R/debiannaming.R deleted file mode 100644 index 83c0ab5..0000000 --- a/branch/patch/R/debiannaming.R +++ /dev/null @@ -1,52 +0,0 @@ -repourl_as_debian <- function(url) { - # map the url to a repository onto its name in debian package naming - if (length(grep('cran',url))) { - return('cran') - } - if (length(grep('bioc',url))) { - return('bioc') - } - fail('unknown repository',url) -} - -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' - } - if (name == 'R') { - # R is special. - if (binary) { - if (build) { - debname='r-base-dev' - } else { - debname='r-base-core' - } - } else { - debname='R' - } - } 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)) { - repopref <- tolower(repourl_as_debian(available[name,'Repository'])) - } else if (is.null(repopref)) { - repopref <- 'unknown' - } - debname = paste('r',repopref,debname,sep='-') - } - } - if (!is.null(version) && length(version) > 1) { - debname = paste(debname,' (',version,')',sep='') - } - return(debname) -} -