diff options
author | Shea Levy <shea@shealevy.com> | 2017-04-10T22·16-0400 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2017-04-10T22·16-0400 |
commit | 503cc4431b8fa008caca7d06026dcfcab8626884 (patch) | |
tree | 0fd6d5fb0c9990cb2923e6f9a87a47e5e4b443ad /src | |
parent | 915f62fa19790d8f826aeb4dd3d2bb5bde2f67e9 (diff) |
nix-channel: error out if direct tarball unpack fails.
It's very unlikely a path ending in .tar.gz is a directory Fixes #1318
Diffstat (limited to 'src')
-rwxr-xr-x | src/nix-channel/nix-channel.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/nix-channel/nix-channel.cc b/src/nix-channel/nix-channel.cc index 361627823126..0f50f6242c48 100755 --- a/src/nix-channel/nix-channel.cc +++ b/src/nix-channel/nix-channel.cc @@ -103,12 +103,9 @@ static void update(const StringSet & channelNames) auto unpacked = false; if (std::regex_search(filename, std::regex("\\.tar\\.(gz|bz2|xz)$"))) { - try { - runProgram(settings.nixBinDir + "/nix-build", false, { "--no-out-link", "--expr", "import <nix/unpack-channel.nix> " - "{ name = \"" + cname + "\"; channelName = \"" + name + "\"; src = builtins.storePath \"" + filename + "\"; }" }); - unpacked = true; - } catch (ExecError & e) { - } + runProgram(settings.nixBinDir + "/nix-build", false, { "--no-out-link", "--expr", "import <nix/unpack-channel.nix> " + "{ name = \"" + cname + "\"; channelName = \"" + name + "\"; src = builtins.storePath \"" + filename + "\"; }" }); + unpacked = true; } if (!unpacked) { |