Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-10 Thread Dirk Eddelbuettel
We have a winner! (By bending the rules.) On 10 January 2019 at 16:44, Kyle Baron wrote: | Will this work for you? | | I had to stash the working directory (when R CMD build is run) in an | environment variable via ~/.R/build.Renviron` | | $ cat ~/.R/build.Renviron | OLDWD=${PWD} That is les

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-10 Thread Iñaki Ucar
On Thu, 10 Jan 2019 at 23:27, Dirk Eddelbuettel wrote: > > > On 10 January 2019 at 22:33, Iñaki Ucar wrote: > | On Thu, 10 Jan 2019 at 21:55, Dirk Eddelbuettel wrote: > | > Comes up with an empty / unset olddir when I do > | > > | > R CMD build someNameHere; R CMD INSTALL someNameHere_1.2.3.tar

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-10 Thread Kyle Baron
Will this work for you? I had to stash the working directory (when R CMD build is run) in an environment variable via ~/.R/build.Renviron` $ cat ~/.R/build.Renviron OLDWD=${PWD} But a Makefile tucked in vignettes directory will run and the two files will be there in the built package. For me, I

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-10 Thread Dirk Eddelbuettel
On 10 January 2019 at 22:33, Iñaki Ucar wrote: | On Thu, 10 Jan 2019 at 21:55, Dirk Eddelbuettel wrote: | > Comes up with an empty / unset olddir when I do | > | > R CMD build someNameHere; R CMD INSTALL someNameHere_1.2.3.tar.gz | | This is quite interesting. Because if you run | | R CMD bu

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-10 Thread Iñaki Ucar
On Thu, 10 Jan 2019 at 21:55, Dirk Eddelbuettel wrote: > > > On 9 January 2019 at 17:57, Iñaki Ucar wrote: > | Did you check Sys.getenv("OLDPWD")? I checked with a knitr vignette > | and the correct path was there. > > Code: > > [...] > > <>= > prettyVersion <- packageVersion("someNameHere") >

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-10 Thread Dirk Eddelbuettel
On 9 January 2019 at 17:57, Iñaki Ucar wrote: | Did you check Sys.getenv("OLDPWD")? I checked with a knitr vignette | and the correct path was there. Code: [...] <>= prettyVersion <- packageVersion("someNameHere") prettyDate <- format(Sys.Date(), "%B %e, %Y") user <- Sys.getenv("USER")

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-10 Thread Iñaki Ucar
It just ocurred to me the following. Instead of R CMD build pkg I've tried this: cd pkg; R CMD build --log `pwd` and voilà: the tarball includes a log file, and inside there's the complete path to the DESCRIPTION. Iñaki On Wed, 9 Jan 2019 at 20:33, Duncan Murdoch wrote: > > On 09/01/2019 11:

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-09 Thread Duncan Murdoch
On 09/01/2019 11:39 a.m., Dirk Eddelbuettel wrote: Hi Duncan and Iñaki, On 4 January 2019 at 14:13, Duncan Murdoch wrote: | If you want a total hack, the help system can run R code during a build, | e.g. \Sexpr[stage=build]{paste("Built at", Sys.time())}. Certainly it | could embed some inform

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-09 Thread Iñaki Ucar
On Wed, 9 Jan 2019 at 17:39, Dirk Eddelbuettel wrote: > > > Hi Duncan and Iñaki, > > On 4 January 2019 at 14:13, Duncan Murdoch wrote: > | If you want a total hack, the help system can run R code during a build, > | e.g. \Sexpr[stage=build]{paste("Built at", Sys.time())}. Certainly it > | could e

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-09 Thread Dirk Eddelbuettel
Hi Duncan and Iñaki, On 4 January 2019 at 14:13, Duncan Murdoch wrote: | If you want a total hack, the help system can run R code during a build, | e.g. \Sexpr[stage=build]{paste("Built at", Sys.time())}. Certainly it | could embed some information in a help page; perhaps it could do more. |

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-04 Thread Dirk Eddelbuettel
On 5 January 2019 at 00:00, Iñaki Ucar wrote: | On Fri, 4 Jan 2019 at 20:10, Iñaki Ucar wrote: | > | > I see. Then I suggest the following hack (not tested). If the package | > has a vignette, put there a hidden chunk that generates a file with | > info about the branch and the path. This file w

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-04 Thread Iñaki Ucar
On Fri, 4 Jan 2019 at 20:10, Iñaki Ucar wrote: > > I see. Then I suggest the following hack (not tested). If the package > has a vignette, put there a hidden chunk that generates a file with > info about the branch and the path. This file will be available for > your configure script, which runs a

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-04 Thread Dirk Eddelbuettel
On 4 January 2019 at 19:37, Martin Morgan wrote: | Add a tag to the DESCRIPTION file or configure.ac-like indicating the git (presumably) revision, perhaps like https://stackoverflow.com/a/11535358/547331 ? I need the path. I need to find the particular build / checkout of headers and libaries

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-04 Thread Martin Morgan
Add a tag to the DESCRIPTION file or configure.ac-like indicating the git (presumably) revision, perhaps like https://stackoverflow.com/a/11535358/547331 ? On 1/4/19, 1:42 PM, "R-package-devel on behalf of Dirk Eddelbuettel" wrote: On 4 January 2019 at 19:24, Iñaki Ucar wrote: |

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-04 Thread Dirk Eddelbuettel
Iñaki, Duncan, Fabulous -- that is just the type of 'hack' I was hoping for in the short term. Longer term, it would indeed be nice to do something about this and create something better. I had looked once or twice at packages utils and tools but didn't quite find the right spot to connect it

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-04 Thread Duncan Murdoch
On 04/01/2019 1:42 p.m., Dirk Eddelbuettel wrote: On 4 January 2019 at 19:24, Iñaki Ucar wrote: | On Fri, 4 Jan 2019 at 16:43, Dirk Eddelbuettel wrote: | > | > | > For a few years now I had mused about how nice it would be to have other | > scripts triggered like `cleanup`. For Rcpp, it would

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-04 Thread Iñaki Ucar
On Fri, 4 Jan 2019 at 19:42, Dirk Eddelbuettel wrote: > > > On 4 January 2019 at 19:24, Iñaki Ucar wrote: > | On Fri, 4 Jan 2019 at 16:43, Dirk Eddelbuettel wrote: > | > > | > > | > For a few years now I had mused about how nice it would be to have other > | > scripts triggered like `cleanup`. F

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-04 Thread Dirk Eddelbuettel
On 4 January 2019 at 19:24, Iñaki Ucar wrote: | On Fri, 4 Jan 2019 at 16:43, Dirk Eddelbuettel wrote: | > | > | > For a few years now I had mused about how nice it would be to have other | > scripts triggered like `cleanup`. For Rcpp, it would be nice to run | > compileAttributes(). For roxygen

Re: [R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-04 Thread Iñaki Ucar
On Fri, 4 Jan 2019 at 16:43, Dirk Eddelbuettel wrote: > > > For a few years now I had mused about how nice it would be to have other > scripts triggered like `cleanup`. For Rcpp, it would be nice to run > compileAttributes(). For roxygen2, it would be nice to run roxygenize() > (especially if tha

[R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

2019-01-04 Thread Dirk Eddelbuettel
For a few years now I had mused about how nice it would be to have other scripts triggered like `cleanup`. For Rcpp, it would be nice to run compileAttributes(). For roxygen2, it would be nice to run roxygenize() (especially if that continued to work the way it did, but I digress). That was mos