Skip to content
Snippets Groups Projects
Commit 16c9935f authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

Fix fetchurl of executable file

Pointed out by @cstrahan, thanks!
parent 19eddecc
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ derivation { ...@@ -16,7 +16,7 @@ derivation {
if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5; if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5;
outputHashMode = if executable then "recursive" else "flat"; outputHashMode = if executable then "recursive" else "flat";
inherit system url; inherit system url executable;
# No need to double the amount of network traffic # No need to double the amount of network traffic
preferLocalBuild = true; preferLocalBuild = true;
......
...@@ -14,7 +14,7 @@ void builtinFetchurl(const BasicDerivation & drv) ...@@ -14,7 +14,7 @@ void builtinFetchurl(const BasicDerivation & drv)
if (out == drv.env.end()) throw Error("attribute ‘url’ missing"); if (out == drv.env.end()) throw Error("attribute ‘url’ missing");
writeFile(out->second, data.data); writeFile(out->second, data.data);
auto executable = drv.env.find("out"); auto executable = drv.env.find("executable");
if (executable != drv.env.end() && executable->second == "1") { if (executable != drv.env.end() && executable->second == "1") {
if (chmod(out->second.c_str(), 0755) == -1) if (chmod(out->second.c_str(), 0755) == -1)
throw SysError(format("making ‘%1%’ executable") % out->second); throw SysError(format("making ‘%1%’ executable") % out->second);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment