From d71a9f7db60107a98b1e30fd0e886766169cdf8e Mon Sep 17 00:00:00 2001 From: blundellc Date: Sun, 14 Jun 2009 12:32:57 +0000 Subject: [PATCH] version suffix git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@240 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- trunk/R/build.R | 7 ++++--- trunk/R/version.R | 8 ++++---- trunk/R/zzz.R | 3 +++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/trunk/R/build.R b/trunk/R/build.R index 6e8f5e5..ad3892a 100644 --- a/trunk/R/build.R +++ b/trunk/R/build.R @@ -44,13 +44,14 @@ build <- function(name,extra_deps,force=F) { # wait for mini-dinstall to get to work upload_success = FALSE - for (i in seq(1,12)) { + for (i in seq(1,60)) { if (file.exists(file.path(dinstall_archive,'testing','source',paste(pkg$srcname, '_', pkg$version, '.orig.tar.gz', sep='')))) { upload_success = TRUE break } - warn(i,'/12: does not exist',file.path(dinstall_archive,which_system,'testing','source',paste(pkg$srcname, '_', pkg$version, '.orig.tar.gz', sep=''))) - Sys.sleep(5) + warn(i,'/60: does not exist',file.path(dinstall_archive,which_system,'testing','source',paste(pkg$srcname, '_', pkg$version, '.orig.tar.gz', sep=''))) + + Sys.sleep(1) } if (!upload_success) { warn('upload took too long; continuing as normal (some builds may fail temporarily)') diff --git a/trunk/R/version.R b/trunk/R/version.R index 184ec23..0dffa19 100644 --- a/trunk/R/version.R +++ b/trunk/R/version.R @@ -26,28 +26,28 @@ version_new <- function(rver,debian_revision=1, debian_epoch=db_get_base_epoch() # always add the '-1' Debian release; nothing is lost and rarely will R # packages be Debian packages without modification. - return(paste(pkgver,'-',debian_revision,sep='')) + return(paste(pkgver,'-',debian_revision,version_suffix,version_suffix_step,sep='')) } version_epoch <- function(pkgver) { # return the Debian epoch of a Debian package version if (!length(grep(':',pkgver))) return(0) - return(as.integer(sub('^([0-9]+):.*','\\1',pkgver))) + return(as.integer(sub('^([0-9]+):.*$','\\1',pkgver))) } # version_epoch . version_new(x,y) = id # version_epoch(version_new(x,y)) = base_epoch version_revision <- function(pkgver) { # return the Debian revision of a Debian package version - return(as.integer(sub('.*-([0-9]+)$','\\1',pkgver))) + return(as.integer(sub(paste('.*-([0-9]+)(',version_suffix,'[0-9]+)?$',sep=''),'\\1',pkgver))) } # version_revision . version_new(x) = id # version_revision(version_new(x)) = 1 version_upstream <- function(pkgver) { # return the upstream version of a Debian package version - return(sub('-[0-9]+$','',sub('^[0-9]+:','',pkgver))) + return(sub('-[a-zA-Z0-9+.~]+$','',sub('^[0-9]+:','',pkgver))) } # version_upstream . version_new = id diff --git a/trunk/R/zzz.R b/trunk/R/zzz.R index 0c01a3b..aee18cd 100644 --- a/trunk/R/zzz.R +++ b/trunk/R/zzz.R @@ -21,6 +21,9 @@ ,paste(srcname,'_',version,'_' ,host_arch,'.changes',sep=''))) }) + global("version_suffix","cran") + # perhaps db_cur_version() should be used instead? + global("version_suffix_step",1) cache <- file.path(cache_root,'cache.rda') if (file.exists(cache)) { -- 2.39.5