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

Viewed 165

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 git@github.com: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; 
1 Answers

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

git clone git@github.com: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.

Related