From Roger.bivand at nhh.no  Sat Jan  7 14:10:49 2012
From: Roger.bivand at nhh.no (Roger Bivand)
Date: Sat, 7 Jan 2012 13:10:49 +0000
Subject: [Rd] pointers on including SVN revision number in package info?
References: <4F075895.3030509@gmail.com>
Message-ID: <loom.20120107T135826-429@post.gmane.org>

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
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

>  thanks,
>   Ben Bolker
> 
>



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