From 3ba98e7ab3d2ba1f6463224d9ed8e5c1c41b3673 Mon Sep 17 00:00:00 2001 From: moeller Date: Tue, 8 Feb 2011 12:01:58 +0000 Subject: [PATCH] More messages in the build script. Some improved clarity of the code. Change of semantics: the system for the very moment does not fail upon the failure of the packaging process of a single package. This will become a paramter to set with a very soon further commit. git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@331 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- trunk/R/build.R | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/trunk/R/build.R b/trunk/R/build.R index 6eb3b80..967c68a 100644 --- a/trunk/R/build.R +++ b/trunk/R/build.R @@ -10,7 +10,7 @@ build <- function(name,extra_deps,force=F,do_cleanup=T) { # obtain the Debian version-to-be version <- try(new_build_version(name)) if (inherits(version,'try-error')) { - error('failed to build',name) + error('failed to build in new_build_version: ',name) return(NULL) } @@ -35,14 +35,24 @@ build <- function(name,extra_deps,force=F,do_cleanup=T) { file.remove(Sys.glob(file.path(pbuilder_results,'*.upload'))) notice('R dependencies:',paste(pkg$depends$r,collapse=', ')) + #if (debug) notice(paste("build_debian(",pkg,") invoked\n",sep="")) build_debian(pkg) + #if (debug) notice(paste("build_debian(",pkg,") completed.\n",sep="")) + # upload the package + notice("Package upload") ## ret = log_system('umask 002;dput','-c',shQuote(dput_config),'local' ,changesfile(pkg$srcname,pkg$debversion)) - ret = log_system('umask 002; cd /var/www/rep; reprepro -b . include testing', changesfile(pkg$srcname,pkg$debversion)) + + cmd = paste('umask 002; cd /var/www/cran2deb/rep && reprepro -b . include testing', changesfile(pkg$srcname,pkg$debversion),sep=" ") + #if (verbose) notice('Executing: ',cmd) + ret = log_system(cmd) if (ret != 0) { - fail('upload failed!') - } + #fail('upload failed!') + notice("Upload failed, ignored.") + } else { + notice("Upload successful.") + } ## # wait for mini-dinstall to get to work ## upload_success = FALSE ## for (i in seq(1,12)) { @@ -112,16 +122,20 @@ needs_build <- function(name,version) { if (build$db_version != db_get_version()) { notice('rebuilding',name,': new db version',build$db_version,'(old) vs',db_get_version(),'(new)') } + notice(paste("Now deleting ",debname,", ",srcname,".\n",sep="")) rm(debname,srcname) return(T) } build_debian <- function(pkg) { wd <- getwd() + #notice(paste("Now in path ",wd,"\n",sep="")) setwd(pkg$path) + notice('building Debian package' ,pkg$debname ,paste('(',pkg$debversion,')',sep='') + ,'in',getwd(), ,'...') cmd = paste('pdebuild --configfile',shQuote(pbuilder_config)) @@ -129,10 +143,12 @@ build_debian <- function(pkg) { cmd = paste(cmd,'--debbuildopts','-sd') notice('build should exclude original source') } + notice(paste("Executing '",cmd,"' from directory '",getwd(),"'.\n",sep="")) ret = log_system(cmd) setwd(wd) if (ret != 0) { fail('Failed to build package.') } + return(ret); } -- 2.39.2