Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build an R package tarball without divulging your user name in the tarball

Tags:

r

r-package

In R CMD build, the ID of the user is automatically inserted into the DESCRIPTION file. This is problematic because I work in a corporate computing environment and I do not want to divulge my user ID.

Reproducible example:

git clone [email protected]:tidyverse/reprex
R CMD build reprex
rm -rf reprex
tar -xf reprex*tar.gz
grep Packaged reprex/DESCRIPTION

Current output:

Packaged: 2018-11-06 14:01:50 UTC; <MY USER ID>

Desired output

Packaged: 2018-11-06 14:01:50 UTC; 
like image 989
landau Avatar asked Nov 06 '18 14:11

landau


1 Answers

I'm not aware of doing this internally, but, why don't you just remove the ID and repackage it?

git clone [email protected]:tidyverse/reprex
R CMD build reprex
rm -rf reprex
tar -xf reprex*tar.gz
grep -l "Packaged" reprex/DESCRIPTION | xargs sed  's/UTC;.*/UTC;/' >  reprex/DESCRIPTION

Now compress it again with tar. Probably add this to your build system.

like image 59
Aravind Voggu Avatar answered Oct 12 '22 05:10

Aravind Voggu