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

Blank line in DESCRIPTION breaks installation with devtools >= 1.4 #383

Closed
lgatto opened this issue Nov 22, 2013 · 6 comments
Closed

Blank line in DESCRIPTION breaks installation with devtools >= 1.4 #383

lgatto opened this issue Nov 22, 2013 · 6 comments

Comments

@lgatto
Copy link

lgatto commented Nov 22, 2013

Using version 1.3 from CRAN

> library("devtools")
> packageVersion("devtools")
[1] ‘1.3> install_github("sequences", "lgatto")
Installing github repo(s) sequences/master from lgatto
Downloading sequences.zip from https://github.com/lgatto/sequences/archive/master.zip
Installing package from /tmp/RtmpQp2BHj/sequences.zip
Installing sequences
[ ... ]
** R
** data
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (sequences)

but with the latest version from github

> library("devtools")
> packageVersion("devtools")
[1] ‘1.4.0.99> install_github("sequences", "lgatto")
Installing github repo sequences/master from lgatto
Downloading sequences.zip from https://github.com/lgatto/sequences/archive/master.zip
Installing package from /tmp/RtmpQp2BHj/sequences.zip
arguments 'minimized' and 'invisible' are for Windows only
Installing sequences
Error: contains a blank line

Indeed, there is a blank line in the DESCRIPTION file.

Tested on R version 3.0.2 Patched (2013-10-02 r64018) Platform: x86_64-unknown-linux-gnu (64-bit). using R 3.0.2 (2013-09-25) x86_64-w64-mingw32/x64, both devtools 1.4 and 1.4.0.99 produce the error.

Feature or bug?

@jeroen
Copy link
Member

jeroen commented Nov 26, 2013

Ran into this as well. I don't think blank lines are illegal in DESCRIPTION files? According to R NEWS 2.15.3:

R CMD check no longer fails with an error if a ‘DESCRIPTION’ file incorrectly contains a blank line. (Reported by Bill Dunlap.)

So I think devtools shouldn't be choking on this either?

@hadley
Copy link
Member

hadley commented Nov 26, 2013

This bug is triggered by pkgVignettes() which I use to determine if the package has any vignettes - so I think this is an R bug.

@hadley hadley closed this as completed Nov 26, 2013
@lgatto
Copy link
Author

lgatto commented Nov 26, 2013

I investigated a bit and the error occurs in utils:::.read_description. The function seems to work fine if there is a blank line at the very end, but fails if it occurs in the middle of the file. However, devtools appends github-specific information (GithubRepo, GithubUsername, ...) at the end of the file, which eventually causes the error.

@hadley
Copy link
Member

hadley commented Nov 26, 2013

@lgatto as a workaround, remove the empty line at the end of your DESCRIPTION?

@lgatto
Copy link
Author

lgatto commented Nov 26, 2013

@hadley yes, of course, that's the most pragmatic fix. I have posted this on r-devel, to see if blank lines are supposed to trigger such an error or not.

@lgatto
Copy link
Author

lgatto commented Nov 28, 2013

@hadley Would you consider a pull request that checks/removes black lines before appending the Github lines? Something along the lines

desclines <- readLines(desc)
writeLines(desclines[!grepl('^[ \t]*$', desclines)], desc)

in install-github.r

dbarneche referenced this issue in dfalster/dataMashR May 9, 2014
ysgit referenced this issue in Rdatatable/data.table Aug 5, 2015
Remove blank line from description (breaks install with packrat)
@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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants