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

Error: contains a blank line #394

Closed
kevinushey opened this issue Dec 11, 2013 · 6 comments
Closed

Error: contains a blank line #394

kevinushey opened this issue Dec 11, 2013 · 6 comments

Comments

@kevinushey
Copy link
Contributor

When attempting to install one of our packages with install_github, I get the error:

Error: contains a blank line

From what I can see, it occurs because devtools adds some extra GitHub-specific information to the DESCRIPTION file, but that DESCRIPTION file may have more than one newline ending the file. Hence, a blank line is left between the old DESCRIPTION fields and the new material added by devtools.

I think excessive final newlines should be stripped from the DESCRIPTION before modifying it, just to protect users from this error.

@hadley
Copy link
Member

hadley commented Mar 17, 2014

Could you provide a simple reproducible example?

@kevinushey
Copy link
Contributor Author

Sure. Here's a commit on my package that breaks install_github:

kevinushey/Kmisc@2e5f662

library(devtools)
install_github("Kmisc", "kevinushey", ref="2e5f66201771919fa70001c69c45080338526387")

Undoing that fixes everything, of course (kevinushey/Kmisc@9441306)

library(devtools)
install_github("Kmisc", "kevinushey", ref="94413062dc275993d0de3461ebf5edda4d708f0a")

Of course, a more local solution as far as unit testing would be preferred, but either that means the code in install_github() should be refactored out into a testable piece or there needs to be some skeleton GitHub package that can be tested.

@hadley
Copy link
Member

hadley commented Mar 17, 2014

Ok - so the problem is only if there's a trailing empty line?

@hadley
Copy link
Member

hadley commented Mar 17, 2014

Ok, so this probably requires some refactoring of install_github() etc.

@kevinushey
Copy link
Contributor Author

(Argh. Sorry, deleted my comment by accident.)

Basically, any blank line between fields will cause R CMD INSTALL to fail. If a DESCRIPTION file ends with edit: more than one blank line, it will be preserved, and install_github will append some GitHub-specific information, e.g.

...DESCRIPTION stuff...
VignetteBuilder: knitr

GitHubStuff: ...

and it is that blank line between fields, now generated, that causes it to fail.

kevinushey added a commit to kevinushey/devtools that referenced this issue Mar 19, 2014
@hadley
Copy link
Member

hadley commented Mar 19, 2014

Fixed by #439

@hadley hadley closed this as completed Mar 19, 2014
sje30 added a commit to sje30/g2chvc that referenced this issue Sep 16, 2014
This caused an error:

Installing g2chvc
Error: contains a blank line

when doing install_github()

This seems to have been fixed March 2014

r-lib/devtools#394
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

2 participants