Patch idea: an environment variable for setting the user ID

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Patch idea: an environment variable for setting the user ID

landau
To R-devel,


In `R CMD build`, the ID of the user is automatically inserted into the
DESCRIPTION file, e.g.

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


This is problematic for those of us who work in corporate settings. We must
not divulge our user IDs in the packages we develop and release.

Jim Hester pointed out that these two lines in
`add_build_stamp_to_description_file()`
<https://github.com/wch/r-source/blob/521c90a175d67475b9f1b43d7ae68bc48062d8e6/src/library/tools/R/build.R#L170-L171>
are responsible. Could we consider his suggestion of using an optional
environment variable to overwrite the default behavior?

user <- Sys.getenv("R_BUILD_USERNAME")
if (!nzchar(user)) user <- Sys.info()["user"]
if(user == "unknown") user <- Sys.getenv("LOGNAME")

Will Landau
--
wlandau.github.io
linkedin.com/in/wlandau
github.com/wlandau

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Patch idea: an environment variable for setting the user ID

Kurt Hornik-5
>>>>> Will L writes:

> To R-devel,
> In `R CMD build`, the ID of the user is automatically inserted into the
> DESCRIPTION file, e.g.

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


> This is problematic for those of us who work in corporate settings. We must
> not divulge our user IDs in the packages we develop and release.

> Jim Hester pointed out that these two lines in
> `add_build_stamp_to_description_file()`
> <https://github.com/wch/r-source/blob/521c90a175d67475b9f1b43d7ae68bc48062d8e6/src/library/tools/R/build.R#L170-L171>
> are responsible. Could we consider his suggestion of using an optional
> environment variable to overwrite the default behavior?

> user <- Sys.getenv("R_BUILD_USERNAME")
> if (!nzchar(user)) user <- Sys.info()["user"]
> if(user == "unknown") user <- Sys.getenv("LOGNAME")

Yep, something along these lines should be possible.
R_BUILD_USER or R_BUILD_LOGNAME may seem more natural though ...

Best
-k



> Will Landau
> --
> wlandau.github.io
> linkedin.com/in/wlandau
> github.com/wlandau

> [[alternative HTML version deleted]]

> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel