]> git.donarmstrong.com Git - cran2deb.git/commitdiff
revert to using git commit id in zzz.R; git $Id$ is not the same as CVS $Id$
authorblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:26:51 +0000 (13:26 +0000)
committerblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:26:51 +0000 (13:26 +0000)
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

pkg/trunk/.gitattributes [deleted file]
pkg/trunk/R/zzz.R [deleted file]
pkg/trunk/R/zzz.R.in [new file with mode: 0644]
pkg/trunk/configure [new file with mode: 0755]

diff --git a/pkg/trunk/.gitattributes b/pkg/trunk/.gitattributes
deleted file mode 100644 (file)
index de1c092..0000000
+++ /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 (file)
index 86dbe1e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-.First.lib <- function(libname, pkgname) {
-    global <- function(name,value) assign(name,value,envir=.GlobalEnv)
-    global("maintainer", 'cran2deb autobuild <cran2deb@example.org>')
-    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 (file)
index 0000000..e486f50
--- /dev/null
@@ -0,0 +1,24 @@
+.First.lib <- function(libname, pkgname) {
+    global <- function(name,value) assign(name,value,envir=.GlobalEnv)
+    global("maintainer", 'cran2deb autobuild <cran2deb@example.org>')
+    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 (executable)
index 0000000..106c58a
--- /dev/null
@@ -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.in >R/zzz.R