Skip to content
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

install_url -> install_local_single -> getrootdir #537

Closed
smbache opened this Issue Aug 4, 2014 · 14 comments

Comments

Projects
None yet
3 participants
@smbache
Copy link

smbache commented Aug 4, 2014

I am trying to use install_url to install a package but I am running into trouble after the download and unarchiving is done by devtools.

I have (potentially) traced it to the decompress function. It returns path/to/folder/.Rbuildignore rather than just /path/to/folder/, and is then unable to find the DESCRIPTION file and quits.

My initial install command is

devtools::install_url("http://url?pkg=pkg_no_zip_extension", name = "pkgname.zip")

The url is one without the zip extension (the response is a zip file), and so I provide the name to make devtools reckognize that it is a zip file.

@smbache

This comment has been minimized.

Copy link
Author

smbache commented Aug 4, 2014

The downloaded zip does not have a single folder in it with the R package, but just has the contents of such a folder.. maybe that is where the problem is.

@smbache

This comment has been minimized.

Copy link
Author

smbache commented Aug 4, 2014

I could fix it as

devtools::install_url(url, subdir = "..")

Don't know whether it should be considered a "bug" or not.

@wch

This comment has been minimized.

Copy link
Member

wch commented Aug 4, 2014

IIRC, the installer code assumes that there's a subdirectory with the package contents. Perhaps it would be helpful to have better documentation, or an error message that explains the issue.

@smbache

This comment has been minimized.

Copy link
Author

smbache commented Aug 4, 2014

Yeah; that's what I also conclude :) I know, for example, that a Stash git server using an Archive plugin (https://marketplace.atlassian.com/plugins/com.atlassian.stash.plugin.stash-archive) does not use such subdirectory when archiving, so perhaps it should have a check whether it is actually a directory it gets; otherwise try to "level up"...

@wch

This comment has been minimized.

Copy link
Member

wch commented Aug 4, 2014

It seems reasonable to me check to see if a subdir contains a package (using the current method), and if not, check if the top level directory contains a package.

@hadley, @jmcphers What do you think?

@smbache

This comment has been minimized.

Copy link
Author

smbache commented Aug 4, 2014

While we're at it -- another nice minor (minor) thing would be to perhaps default to something (e.g. zip which is probably more common?!) when the saved temp file doesn't have a file ending, i.e. when basename(url) doesn't return anything useful. Also something I encountered. Specifying namesolved it, but just makes the call a little more verbose.

@hadley

This comment has been minimized.

Copy link
Member

hadley commented Aug 13, 2014

Sounds reasonable to me. Some test cases would be nice.

@hadley

This comment has been minimized.

Copy link
Member

hadley commented Aug 21, 2014

Can you please try the dev version? I've made some improvements to the install process.

@smbache

This comment has been minimized.

Copy link
Author

smbache commented Aug 22, 2014

as in the master branch? Still does not seem to fix this issue.

Also I got a warning package ‘BiocInstaller’ is not available" and also

Warning in file.copy(files, dest, overwrite = TRUE) :
  problem copying .\devtools.dll to C:\opt\R\current\library\devtools\libs\x64\devtools.dll: Permission    denied
@hadley

This comment has been minimized.

Copy link
Member

hadley commented Aug 22, 2014

Ok, can you please send a reproducible example?

@smbache

This comment has been minimized.

Copy link
Author

smbache commented Aug 22, 2014

Problem is that I only know this one private stash server and can't really use that. But it delivers the R packages zipped, but not in a "sub directory", and the URL does not have base name, i.e. no extension can be extracted from it, e.g. zip.

Oh, and the warnings mentioned above was from installing devtools from github master...

@hadley

This comment has been minimized.

Copy link
Member

hadley commented Aug 22, 2014

Could you make a zip file with similar structure and email it to me?

@smbache

This comment has been minimized.

Copy link
Author

smbache commented Aug 22, 2014

Sure, on phone for the weekend, but monday-ish! :)

@smbache

This comment has been minimized.

Copy link
Author

smbache commented Aug 26, 2014

You can try this:

devtools::install_url("http://stefanbache.dk/spacewastr.zip")

should replicate the bahviour.

@hadley hadley closed this in 1cd9890 Aug 26, 2014

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.