}
log_clear()
dir <- setup()
+
+ # obtain the Debian version-to-be
version <- try(new_build_version(name))
if (inherits(version,'try-error')) {
error('failed to build',name)
- return(NA)
+ return(NULL)
}
+
result <- try((function() {
if (!force && !needs_build(name,version)) {
notice('skipping build of',name)
- return(NA)
+ return(NULL)
}
pkg <- prepare_new_debian(prepare_pkg(dir,name),extra_deps)
file.remove(Sys.glob(file.path(pbuilder_results,'*.upload')))
# make mini-dinstall generate the skeleton of the archive
- ret = log_system('umask 022;mini-dinstall --batch -c',dinstall_config)
+ ret = log_system('umask 002;mini-dinstall --batch -c',dinstall_config)
if (ret != 0) {
fail('failed to create archive')
}
# pull in all the R dependencies
- notice('dependencies:',paste(pkg$depends$r,collapse=', '))
+ notice('R dependencies:',paste(pkg$depends$r,collapse=', '))
for (dep in pkg$depends$r) {
if (pkgname_as_debian(dep) %in% debian_pkgs) {
notice('using Debian package of',dep)
srcdep = pkgname_as_debian(dep,binary=F)
notice('uploading',srcdep)
- ret = log_system('umask 022;dput','-c',shQuote(dput_config),'local'
+ ret = log_system('umask 002;dput','-c',shQuote(dput_config),'local'
,changesfile(srcdep))
if (ret != 0) {
fail('upload of dependency failed! maybe you did not build it first?')
build_debian(pkg)
# upload the package
- ret = log_system('umask 022;dput','-c',shQuote(dput_config),'local'
+ ret = log_system('umask 002;dput','-c',shQuote(dput_config),'local'
,changesfile(pkg$srcname,pkg$debversion))
if (ret != 0) {
fail('upload failed!')
}
+ # delete the current archive (XXX: assumes mini-dinstall)
+ # this is handy for group operation
+ for (subdir in c('mini-dinstall','unstable')) {
+ path = file.path(dinstall_archive,subdir)
+ if (file.exists(path)) {
+ unlink(path,recursive=T)
+ }
+ }
+
return(pkg$debversion)
})())
cleanup(dir)
- if (is.na(result)) {
+ if (is.null(result)) {
# nothing was done so escape asap.
return(result)
}
+
# otherwise record progress
failed = inherits(result,'try-error')
if (failed) {
notice('already built',srcname,'version',version)
return(F)
}
+
# XXX: what about building newer versions of Debian packages?
if (debname %in% debian_pkgs) {
notice(srcname,' exists in Debian (perhaps a different version)')
cmd = paste('pdebuild --configfile',shQuote(pbuilder_config))
if (version_revision(pkg$debversion) > 2) {
cmd = paste(cmd,'--debbuildopts','-sd')
+ notice('build should exclude original source')
}
ret = log_system(cmd)
setwd(wd)