[Rd] pointers on including SVN revision number in package info?

Roger Bivand Roger.bivand at nhh.no
Sat Jan 7 14:10:49 CET 2012

Ben Bolker <bbolker <at> gmail.com> writes:

>   I'm trying to keep debugging of a development package relatively sane.
>   Or can people suggest other useful strategies for keeping track of
> which development (micro-)version a random user might be working with?

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

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.


>  thanks,
>   Ben Bolker

More information about the R-devel mailing list