New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permissions of binary files in install_github packages #326

Closed
iagomosqueira opened this Issue Jul 9, 2013 · 6 comments

Comments

Projects
None yet
3 participants
@iagomosqueira

iagomosqueira commented Jul 9, 2013

When calling install_github on a pkg that contains binary files, the call to unzip() does not keep the executable permissions for files in, for example, inst/bin/linux in

https://github.com/colinpmillar/FLa4a/archive/master.zip

utils::unzip uses the internal unzip, which does not seem to keep the permissions. If

unzip("FLa4a-master.zip", unzip=getOption("unzip"))

is used on the file above in a Linux machine where getOption("unzip") returns

[1] "/usr/bin/unzip"

permissions are kept. So this seems to be an issue upstream with unzip in utils/libs/utils.so, but right now it affects devtools. Could maybe install_github have an unzip option?

# Example code

library(devtools)

## install_github
install.packages(c("copula", "triangle", "np", "latticeExtra"))
install_github("FLa4a", "colinpmillar")

system("ls -l $HOME/R/x86_64-pc-linux-gnu-library/3.0/FLa4a/bin/linux/")

> system("ls -l $HOME/R/x86_64-pc-linux-gnu-library/3.0/FLa4a/bin/linux/")
total 1772
> -rw-r--r-- 1 imosqueira imosqueira 1813664 Jul  9 14:19 a4a

## R's unzip

system("wget https://github.com/colinpmillar/FLa4a/archive/master.zip")
unzip("master.zip")
system("ls -l FLa4a-master/inst/bin/linux")

> system("ls -l FLa4a-master/inst/bin/linux")
total 1772
> -rw-rw-r-- 1 imosqueira imosqueira 1813664 Jul  9 14:20 a4a

## system's unzip
unzip("master.zip", overwrite=TRUE, unzip=getOption("unzip"))
system("ls -l FLa4a-master/inst/bin/linux")

> system("ls -l FLa4a-master/inst/bin/linux")
total 1772
> -rwxr-xr-x 1 imosqueira imosqueira 1813664 Jul  9 12:03 a4a
@hadley

This comment has been minimized.

Member

hadley commented Jul 9, 2013

What if unzip just used unzip = getOption("unzip") internally?

@iagomosqueira

This comment has been minimized.

iagomosqueira commented Jul 9, 2013

On 07/09/2013 03:04 PM, hadley wickham wrote:

What if |unzip| just used |unzip = getOption("unzip")| internally?


Reply to this email directly or view it on GitHub
#326 (comment).

Sounds good, at least the option can be set before calling
install_github. Maybe the wider issue here is why the internal unzip
behaves that way.

Iago

@krlmlr

This comment has been minimized.

Member

krlmlr commented Jul 9, 2013

What if there is no unzip executable, e.g., on Windows?

@iagomosqueira

This comment has been minimized.

iagomosqueira commented Jul 9, 2013

On 07/09/2013 04:10 PM, Kirill Müller wrote:

What if there is no |unzip| executable, e.g., on Windows?

That appears to default to "internal". And file permissions are not an
issue, as fai as I can see, in Windows.

Iago

@hadley hadley closed this in 70848ea Oct 7, 2013

@hadley

This comment has been minimized.

Member

hadley commented Oct 7, 2013

I'd appreciate you trying this out and letting me know if it fixes the problem.

@iagomosqueira

This comment has been minimized.

iagomosqueira commented Oct 7, 2013

Yes, this seems to work as expected. Many thanks.

Iago

@lock lock bot locked and limited conversation to collaborators Sep 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.