From 84d5241c6b3e4cc14bc57a450d0b1c0656ab4193 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Mon, 25 Feb 2013 18:18:45 -0800 Subject: [PATCH] use debuild instead of dpkg-source put results in the proper location --- trunk/R/build.R | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/trunk/R/build.R b/trunk/R/build.R index 1839e01..911e3f6 100644 --- a/trunk/R/build.R +++ b/trunk/R/build.R @@ -130,19 +130,37 @@ needs_build <- function(name,version) { build_debian_srcpkg <- function(pkg) { wd <- getwd() #notice(paste("Now in path ",wd,"\n",sep="")) - setwd(pbuilder_results) - + setwd(pkg$path) + notice('building Debian source package',pkg$debname,paste('(',pkg$debversion,')',sep=''),'in',getwd(),'...') - cmd = paste('dpkg-source','-b',pkg$path) + + cmd = paste('debuild -uc -us -d -S -nc') + if (version_revision(pkg$debversion) > 2) { + cmd = paste(cmd,'-sd') + notice('build should exclude original source') + } + else { + cmd = paste(cmd,'-sa') + notice('build should include 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.') } + else { # copy the build results into the appropriate location + changes.fn <- list.files(path=dirname(pkg$path),pattern="\\.changes$") + changes.file <- readLines(file.path(dirname(pkg$path),changes.fn)) + ## extract out the files that belong to the changes file + srcpkg.files <- gsub(".+ ","",changes.file[(which(changes.file=="Files: ")+1):NROW(changes.file)]) + for (file in c(srcpkg.files,changes.fn)) { + file.copy(file.path(dirname(pkg$path),file),file.path(pbuilder_results,file)); + } + } return(ret); -ls} +} build_debian <- function(pkg) { wd <- getwd() -- 2.39.2