From simon.urbanek at r-project.org  Wed Apr 13 04:49:17 2011
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Tue, 12 Apr 2011 22:49:17 -0400
Subject: [Rd] R CMD build --resave-data
In-Reply-To: <BANLkTim00CqwGUbtaKN7j0As8Nchdb+ryw@mail.gmail.com>
References: <4DA24F8A.7030405@fhcrc.org>
	<4DA31AA0.2050209@statistik.tu-dortmund.de>
	<4DA4F40C.7000409@fhcrc.org>
	<AD95DA9D-5887-4C59-AB6F-3AA400689306@r-project.org>
	<BANLkTim00CqwGUbtaKN7j0As8Nchdb+ryw@mail.gmail.com>
Message-ID: <8CBD2FB8-6F31-4930-8658-0EFE221747EC@r-project.org>


On Apr 12, 2011, at 10:26 PM, Hadley Wickham wrote:

>>> If you deliberately ignore the fact that 'R CMD INSTALL' is also used
>>> by developers to install from the *package source tree* (by opposition
>>> to end users who use it to install from a *source tarball*,
>> 
>> .. for a good reason, IMHO no serious developer would do that for obvious reasons - you'd be working on a dirty copy creating many unnecessary problems and polluting your sources. The first time you'll spend an hour chasing a non-existent problem due to stale binary objects in your tree you'll learn that lesson ;). The fraction of a second spent in R CMD build is well worth the hours saved. IMHO the only valid reason to run INSTALL on a (freshly unpacked tar ball) directory is to capture config.log.
> 
> This is news to me!  I know that you're supposed to run R CMD check on
> the built package, but you're supposed to run install on it too?  (And
> if it's so important, why doesn't R do it for you automatically?)
> 

I'm not saying "supposed to" I'm saying wise to. And the "IMHO"s above were what I really meant. By all means, you're free to do anything as long as you don't ask on the mailing list that something doesn't work because you ran it on a stale directory ;).


> Do you have any convenient shortcuts to overcome the fact that the
> binary package contains the package name?  i.e. how can I build and
> install/check in a single line without having to specify the full file
> name?
> 
> How can I go from:
> 
> R CMD build plyr && R CMD install plyr_1.5.tar.gz
> 

Some will argue that's an invalid command to start with ;). But other than that I see nothing wrong with it ... it's what I do to be honest ... (except where I don't, but that has to do with my custom build script legacy which has a defined way to get versions on the shell, long story...).


> to
> 
> R CMD build-and-install plyr ?
> 

R CMD build plyr && R CMD INSTALL plyr_*

... if you don't keep too many version in the same directory ;) - but it's not something I would use. For the paranoid

R CMD build plyr && R CMD INSTALL plyr_`sed -n 's/Version: *//p' plyr/DESCRIPTION`.tar.gz

But, seriously, that is the least problem I see - you'd have to advance your version numbers very quickly to get the version command out of your shell history...


Cheers,
Simon



[Rd] R CMD build --resave-data
Simon Urbanek