Dirk Eddelbuettel
2012-Nov-25 21:57 UTC
[Rd] Option to set permissions on directories and files after package installation
The R package on Debian (and hence Ubuntu) has had a default for close to a decade to install into /usr/local/R/site-library/. This came from a suggestion by Kurt and Fritz, and I still think of it as rather useful. To me, this suggests multiuser mode, preferably without sudo. One can get close via group membership on the directory, but ultimate this always fails because tools:::.install_packages() insists on putting 0644 / 0755 modes on everything as seen from the following selection from that function: ## not clear if this is still necessary, but sh version did so if (!WINDOWS) Sys.chmod(file.path(dest, files), "755") if (file.exists(f)) { file.copy(f, instdir, TRUE) Sys.chmod(file.path(instdir, f), "644") } Sys.chmod(Sys.glob(file.path(instdir, "data", "*")), "644") Sys.chmod(Sys.glob(file.path(instdir, "demo", "*")), "644") Sys.chmod(Sys.glob(file.path(instdir, "exec", "*")), "755") Sys.chmod(i2_files[execs], "755") I would like to have the option of haveing the effect of setting umask 0002 so that people in my group can replace packages. The simplest may be to replace "644"/"755" with "664"/"775" is a suitable option is set. More involved schemes are of course possible too. Naturally, I would be happy to work on patch if there was any indication that the patch would be reviewed and possibly included. With that: comments, please. Is this seen as sensible or deemed nutty and off-limits? Thanks, Dirk -- Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
Warnes, Gregory
2012-Nov-25 23:13 UTC
[Rd] Option to set permissions on directories and files after package installation
I second the request to allow specification of the permissions to use when installing packages, preferably controllable via a site-wide configuration file. On 11/25/12 4:57 PM, "Dirk Eddelbuettel" <edd at debian.org> wrote:> >The R package on Debian (and hence Ubuntu) has had a default for close to >a >decade to install into /usr/local/R/site-library/. This came from a >suggestion by Kurt and Fritz, and I still think of it as rather useful. > >To me, this suggests multiuser mode, preferably without sudo. One can get >close via group membership on the directory, but ultimate this always >fails >because tools:::.install_packages() insists on putting 0644 / 0755 modes >on >everything as seen from the following selection from that function: > > > ## not clear if this is still necessary, but sh version >did so > if (!WINDOWS) Sys.chmod(file.path(dest, files), "755") > > > if (file.exists(f)) { > file.copy(f, instdir, TRUE) > Sys.chmod(file.path(instdir, f), "644") > } > > > Sys.chmod(Sys.glob(file.path(instdir, "data", "*")), "644") > > > Sys.chmod(Sys.glob(file.path(instdir, "demo", "*")), "644") > > > Sys.chmod(Sys.glob(file.path(instdir, "exec", "*")), >"755") > > > Sys.chmod(i2_files[execs], "755") > > >I would like to have the option of haveing the effect of setting umask >0002 >so that people in my group can replace packages. The simplest may be to >replace "644"/"755" with "664"/"775" is a suitable option is set. More >involved schemes are of course possible too. > >Naturally, I would be happy to work on patch if there was any indication >that >the patch would be reviewed and possibly included. > >With that: comments, please. Is this seen as sensible or deemed nutty and >off-limits? > >Thanks, Dirk > >-- >Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com > >______________________________________________ >R-devel at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-devel
Kasper Daniel Hansen
2012-Nov-25 23:14 UTC
[Rd] Option to set permissions on directories and files after package installation
I use this all the time for similar reasons (but not on debian). I currently post-process with chmod and chown. I support this request, and I would be happy if the owner could be set as well. Best, Kasper On Sun, Nov 25, 2012 at 4:57 PM, Dirk Eddelbuettel <edd at debian.org> wrote:> > The R package on Debian (and hence Ubuntu) has had a default for close to a > decade to install into /usr/local/R/site-library/. This came from a > suggestion by Kurt and Fritz, and I still think of it as rather useful. > > To me, this suggests multiuser mode, preferably without sudo. One can get > close via group membership on the directory, but ultimate this always fails > because tools:::.install_packages() insists on putting 0644 / 0755 modes on > everything as seen from the following selection from that function: > > > ## not clear if this is still necessary, but sh version did so > if (!WINDOWS) Sys.chmod(file.path(dest, files), "755") > > > if (file.exists(f)) { > file.copy(f, instdir, TRUE) > Sys.chmod(file.path(instdir, f), "644") > } > > > Sys.chmod(Sys.glob(file.path(instdir, "data", "*")), "644") > > > Sys.chmod(Sys.glob(file.path(instdir, "demo", "*")), "644") > > > Sys.chmod(Sys.glob(file.path(instdir, "exec", "*")), "755") > > > Sys.chmod(i2_files[execs], "755") > > > I would like to have the option of haveing the effect of setting umask 0002 > so that people in my group can replace packages. The simplest may be to > replace "644"/"755" with "664"/"775" is a suitable option is set. More > involved schemes are of course possible too. > > Naturally, I would be happy to work on patch if there was any indication that > the patch would be reviewed and possibly included. > > With that: comments, please. Is this seen as sensible or deemed nutty and > off-limits? > > Thanks, Dirk > > -- > Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel