X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=trunk%2FR%2Fzzz.R;h=f35903d7e42c0859c9738c520f43e0905bb551c2;hb=047885bdcfe53ddbda1fbc7d79e9d7ba1ef46c96;hp=3255fe703267cb369d55474e13a3d969bcb876d7;hpb=49b44dc25b2664f0b2cbbed14a444d77c4d0ca07;p=cran2deb.git diff --git a/trunk/R/zzz.R b/trunk/R/zzz.R index 3255fe7..f35903d 100644 --- a/trunk/R/zzz.R +++ b/trunk/R/zzz.R @@ -1,24 +1,35 @@ .First.lib <- function(libname, pkgname) { global <- function(name,value) assign(name,value,envir=.GlobalEnv) - global("maintainer", 'cran2deb autobuild ') + global("which_system", Sys.getenv('CRAN2DEB_SYS','debian-amd64')) + if (!length(grep('^[a-z]+-[a-z0-9]+$',which_system))) { + stop('Invalid system specification: must be of the form name-arch') + } + global("host_arch", gsub('^[a-z]+-','',which_system)) + global("maintainer", 'cran2deb autobuild ') global("root", system.file(package='cran2deb')) - global("cache_root", '/var/cache/cran2deb') - global("pbuilder_results", '/var/cache/cran2deb/results') - global("pbuilder_config", '/etc/cran2deb/pbuilderrc') - global("dput_config", '/etc/cran2deb/dput.cf') - global("dinstall_config", '/etc/cran2deb/mini-dinstall.conf') - global("dinstall_archive", '/etc/cran2deb/archive') + global("cache_root", Sys.getenv('CRAN2DEB_CACHE','/var/cache/cran2deb')) + global("config_dir", Sys.getenv('CRAN2DEB_CONFDIR','/etc/cran2deb')) + global("pbuilder_results", file.path(cache_root,which_system)) + global("pbuilder_config", file.path(config_dir,'sys',which_system,'pbuilderrc')) + global("dput_config", file.path(config_dir,'sys',which_system,'dput.cf')) + global("dinstall_config", file.path(config_dir,'sys',which_system,'mini-dinstall.conf')) + global("dinstall_archive", file.path(config_dir,'archive',which_system)) global("r_depend_fields", c('Depends','Imports')) # Suggests, Enhances - global("scm_revision", 'svn:$Id$') - global("patch_dir", '/etc/cran2deb/patches') + global("scm_revision", paste("svn:", svnversion())) + global("patch_dir", file.path(config_dir,'patches')) + global("lintian_dir", file.path(config_dir,'lintian')) global("changesfile", function(srcname,version='*') { return(file.path(pbuilder_results ,paste(srcname,'_',version,'_' - ,host_arch(),'.changes',sep=''))) + ,host_arch,'.changes',sep=''))) }) + global("version_suffix","~debianr+") + # perhaps db_cur_version() should be used instead? + global("version_suffix_step",1) cache <- file.path(cache_root,'cache.rda') if (file.exists(cache)) { load(cache,envir=.GlobalEnv) } + message(paste('I: cran2deb',scm_revision,'building for',which_system,'at',Sys.time())) }