From: blundellc Date: Sat, 13 Sep 2008 13:26:51 +0000 (+0000) Subject: revert to using git commit id in zzz.R; git $Id$ is not the same as CVS $Id$ X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=107bed5dd443d872caf6d1c2500c67bdee44db0d;p=cran2deb.git revert to using git commit id in zzz.R; git $Id$ is not the same as CVS $Id$ git $Id$ binds to the identity of the resident object, not of the ocmmit. git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@126 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- diff --git a/pkg/trunk/.gitattributes b/pkg/trunk/.gitattributes deleted file mode 100644 index de1c092..0000000 --- a/pkg/trunk/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -R/zzz.R ident diff --git a/pkg/trunk/R/zzz.R b/pkg/trunk/R/zzz.R deleted file mode 100644 index 86dbe1e..0000000 --- a/pkg/trunk/R/zzz.R +++ /dev/null @@ -1,23 +0,0 @@ -.First.lib <- function(libname, pkgname) { - global <- function(name,value) assign(name,value,envir=.GlobalEnv) - 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("r_depend_fields", c('Depends','Imports')) # Suggests, Enhances - global("git_revision","$Id$") - global("changesfile", function(srcname,version='*') { - return(file.path(pbuilder_results - ,paste(srcname,'_',version,'_' - ,host_arch(),'.changes',sep=''))) - }) - - cache <- file.path(cache_root,'cache.rda') - if (file.exists(cache)) { - load(cache,envir=.GlobalEnv) - } -} diff --git a/pkg/trunk/R/zzz.R.in b/pkg/trunk/R/zzz.R.in new file mode 100644 index 0000000..e486f50 --- /dev/null +++ b/pkg/trunk/R/zzz.R.in @@ -0,0 +1,24 @@ +.First.lib <- function(libname, pkgname) { + global <- function(name,value) assign(name,value,envir=.GlobalEnv) + 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("r_depend_fields", c('Depends','Imports')) # Suggests, Enhances + # git_revision { + # git_revision } + global("changesfile", function(srcname,version='*') { + return(file.path(pbuilder_results + ,paste(srcname,'_',version,'_' + ,host_arch(),'.changes',sep=''))) + }) + + cache <- file.path(cache_root,'cache.rda') + if (file.exists(cache)) { + load(cache,envir=.GlobalEnv) + } +} diff --git a/pkg/trunk/configure b/pkg/trunk/configure new file mode 100755 index 0000000..106c58a --- /dev/null +++ b/pkg/trunk/configure @@ -0,0 +1,11 @@ +#!/bin/sh +# stamp the source with the originating git revision. +git_rev=$(git show --pretty'=oneline' 'HEAD' | head -n1 | cut -f1 -d' ') +#git_r='assign("git_revision","'$git_rev'",envir=.GlobalEnv)' +git_r=' global("git_revision","'$git_rev'")' + +awk -v "git_r=$git_r" ' +/# git_revision }/ {suppress=0} +suppress == 0 {print} +/# git_revision {/ {print git_r; suppress=1} +' R/zzz.R