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

Comments

Projects
None yet
2 participants
@kevinushey
Contributor

kevinushey commented Dec 11, 2013

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

This comment has been minimized.

Member

hadley commented Mar 17, 2014

Could you provide a simple reproducible example?

@kevinushey

This comment has been minimized.

Contributor

kevinushey commented Mar 17, 2014

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

This comment has been minimized.

Member

hadley commented Mar 17, 2014

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

@hadley

This comment has been minimized.

Member

hadley commented Mar 17, 2014

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

@kevinushey

This comment has been minimized.

Contributor

kevinushey commented Mar 17, 2014

(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

@kevinushey kevinushey referenced this issue Mar 19, 2014

Merged

Fix for #394 #439

@hadley

This comment has been minimized.

Member

hadley commented Mar 19, 2014

Fixed by #439

@hadley hadley closed this Mar 19, 2014

@jingz8804 jingz8804 referenced this issue Mar 29, 2014

Closed

安装失败 #12

sje30 added a commit to sje30/g2chvc that referenced this issue Sep 16, 2014

Remove trailing blank lines from DESCRIPTION
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

Merge pull request #1202 from ysgit/remove-blankline-from-description
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.