Skip to content
Prev 42201 / 63424 Next

pointers on including SVN revision number in package info?

Ben Bolker <bbolker <at> gmail.com> writes:
...
Rather than update the DESCRIPTION file, rgeos includes the SVN revision 
in the startup messages, by copying in ./configure (here ./configure.in):

if test -e ".svn" ; then
  svnversion -n > inst/SVN_VERSION
fi

and testing for the file in R/AAA.R:

  fn <- system.file("SVN_VERSION", package="rgeos")
  if (file.exists(fn)) {
    svn_version <- scan(system.file("SVN_VERSION", package="rgeos"),
      what=character(1), sep="\n", quiet=TRUE)
  } else {
    svn_version <- "(unknown)"
  }

Clunky, and inst/SVN_VERSION isn't in svn itself, but it does work if the 
build machine uses SVN and is up-to-date. I think I'll try to use the
DESCRIPTION Revision tag too. Naturally, this is feasible in packages 
using ./configure already. The package is on R-Forge, so the implicated 
files can be browsed online.

Roger