]> git.donarmstrong.com Git - cran2deb.git/commitdiff
More messages in the build script. Some
authormoeller <moeller@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Tue, 8 Feb 2011 12:01:58 +0000 (12:01 +0000)
committermoeller <moeller@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Tue, 8 Feb 2011 12:01:58 +0000 (12:01 +0000)
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

index 6eb3b80fc6fe23cc108a72be3abcdaee81468c6a..967c68ae7a08ce52334a62e8957d24f35ffc752b 100644 (file)
@@ -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);
 }