From 503cc4431b8fa008caca7d06026dcfcab8626884 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Mon, 10 Apr 2017 18:16:36 -0400 Subject: [PATCH] nix-channel: error out if direct tarball unpack fails. It's very unlikely a path ending in .tar.gz is a directory Fixes #1318 --- src/nix-channel/nix-channel.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/nix-channel/nix-channel.cc b/src/nix-channel/nix-channel.cc index 361627823..0f50f6242 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 " - "{ name = \"" + cname + "\"; channelName = \"" + name + "\"; src = builtins.storePath \"" + filename + "\"; }" }); - unpacked = true; - } catch (ExecError & e) { - } + runProgram(settings.nixBinDir + "/nix-build", false, { "--no-out-link", "--expr", "import " + "{ name = \"" + cname + "\"; channelName = \"" + name + "\"; src = builtins.storePath \"" + filename + "\"; }" }); + unpacked = true; } if (!unpacked) {