Ben Bolker
2012-Jan-06 20:24 UTC
[Rd] pointers on including SVN revision number in package info?
I'm trying to keep debugging of a development package relatively sane. I see that some packages manage to incorporate what appears to be Subversion (SVN) revision information in the package description; for example,> library(MASS) > sessionInfo()$otherPkgs$MASS$Revision[1] "$Rev: 3016 $" which looks like an auto-generated revision number. On the other hand, the rgl package (for example) appears to manually encode the SVN revision in the package number:> library(rgl) > sessionInfo()$otherPkgs$rgl$Version[1] "0.92.829" I'd love an automatic strategy, if possible, so I can be lazy about updating the DESCRIPTION file every time I commit a change to SVN ... I searched the R extensions manual (and the r-forge manual), but I'm sure I could have missed something ... Or can people suggest other useful strategies for keeping track of which development (micro-)version a random user might be working with? thanks, Ben Bolker
Prof Brian Ripley
2012-Jan-06 20:37 UTC
[Rd] pointers on including SVN revision number in package info?
On 06/01/2012 20:24, Ben Bolker wrote:> > I'm trying to keep debugging of a development package relatively sane. > > I see that some packages manage to incorporate what appears to be > Subversion (SVN) revision information in the package description; for > example, > >> library(MASS) >> sessionInfo()$otherPkgs$MASS$Revision > [1] "$Rev: 3016 $" > > which looks like an auto-generated revision number. > > On the other hand, the rgl package (for example) appears to manually > encode the SVN revision in the package number: > >> library(rgl) >> sessionInfo()$otherPkgs$rgl$Version > [1] "0.92.829" > > I'd love an automatic strategy, if possible, so I can be lazy about > updating the DESCRIPTION file every time I commit a change to SVN ... > I searched the R extensions manual (and the r-forge manual), but I'm > sure I could have missed something ...The Subversion book? The MASS/DESCRIPTION file has gannet% svn proplist DESCRIPTION Properties on 'DESCRIPTION': svn:keywords Note this only tracks the version when DESCRIPTION is changed, not what anything else is updated. But then I change the DESCRIPTION file immediately before release.> Or can people suggest other useful strategies for keeping track of > which development (micro-)version a random user might be working with? > > thanks, > Ben Bolker > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Duncan Murdoch
2012-Jan-06 21:45 UTC
[Rd] pointers on including SVN revision number in package info?
On 12-01-06 3:24 PM, Ben Bolker wrote:> > I'm trying to keep debugging of a development package relatively sane. > > I see that some packages manage to incorporate what appears to be > Subversion (SVN) revision information in the package description; for > example, > >> library(MASS) >> sessionInfo()$otherPkgs$MASS$Revision > [1] "$Rev: 3016 $" > > which looks like an auto-generated revision number. > > On the other hand, the rgl package (for example) appears to manually > encode the SVN revision in the package number: > >> library(rgl) >> sessionInfo()$otherPkgs$rgl$Version > [1] "0.92.829"Yes, those are done manually.> I'd love an automatic strategy, if possible, so I can be lazy about > updating the DESCRIPTION file every time I commit a change to SVN ... > I searched the R extensions manual (and the r-forge manual), but I'm > sure I could have missed something ...I'd like one that produced an R version number directly, but I think Dirk's script is the only way to do it, and I forget how to use such scripts five minutes after I write them.> > Or can people suggest other useful strategies for keeping track of > which development (micro-)version a random user might be working with?R-forge sometimes gets out of sync in what it displays as the revision, the Version, and what it actually offers as the "Package source" (let alone binaries), so I find putting the revision into the version number very helpful. But I often forget to do it... Duncan Murdoch> > thanks, > Ben Bolker > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Roger Bivand
2012-Jan-07 13:10 UTC
[Rd] pointers on including SVN revision number in package info?
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 > >