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

nix-prefetch-url fails to put package in store with some URLs #247

Closed
Fuuzetsu opened this issue May 2, 2014 · 8 comments
Closed

nix-prefetch-url fails to put package in store with some URLs #247

Fuuzetsu opened this issue May 2, 2014 · 8 comments

Comments

@Fuuzetsu
Copy link
Member

Fuuzetsu commented May 2, 2014

nix-prefetch-url https://drive.google.com/uc?export=download&id=0Bzghs6gQWi60WTYtaXk3c1IzNVU

downloads the file and then exits with

invalid character `&' in name `uc?export=download&id=0Bzghs6gQWi60WTYtaXk3c1IzNVU' at /run/current-system/sw/bin/nix-prefetch-url line 122.

This particular example is cantata-1.3.4 which uses Google Drive as Google code stopped offering downloads.

Perhaps we should be able to specify what the name a download is stored under. For example, the Gentoo ebuild does this.

@Fuuzetsu
Copy link
Member Author

Fuuzetsu commented May 2, 2014

I also note that this causes problems for fetchurl.

@vcunat
Copy link
Member

vcunat commented May 2, 2014

For fetchurl it's folklore to fix it by setting suitable name = "foo";. I know of no (direct) way for nix-prefetch-url yet, and adding --name could be a nice solution.

@Fuuzetsu
Copy link
Member Author

Fuuzetsu commented May 2, 2014

No matter what name is, if there is & in the url value, I can't build the package. My temporary workaround involved using tinyurl.com to generate a URL without & in it.

@vcunat
Copy link
Member

vcunat commented May 2, 2014

For a workaround you can download the file by another way and then nix-prefetch-url file://...

@abbradar
Copy link
Member

Got bitten with this -- there are indeed workarounds but it would be nice to fix this in nix-prefetch-url.

@strout
Copy link

strout commented Apr 30, 2017

Is this fixed? The following works fine:

nix-prefetch-url 'https://drive.google.com/uc?export=download&id=0Bzghs6gQWi60WTYtaXk3c1IzNVU' --name foo

As does passing name = "foo" to fetchurl.

@armijnhemel
Copy link
Contributor

Is this from the command line, or from within a script? If it is from the commandline, then it is likely that the shell is the problem, as & has special meaning there (to make something a background process). If it is from the commandline, then this is not a bug, but expected behaviour.

@edolstra
Copy link
Member

edolstra commented Feb 1, 2018

Closing as by design. You can use --name to set a valid name if needed.

@edolstra edolstra closed this as completed Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants