Skip to content

Permissions of binary files in install_github packages #326

Description

@iagomosqueira

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions