Merge pull request #1321 from shlevy/channel-direct-tarball-error

nix-channel: error out if direct tarball unpack fails.
This commit is contained in:
Eelco Dolstra 2017-04-18 16:51:46 +02:00 committed by GitHub
commit 67fe3e07b2

View file

@ -103,12 +103,9 @@ static void update(const StringSet & channelNames)
auto unpacked = false; auto unpacked = false;
if (std::regex_search(filename, std::regex("\\.tar\\.(gz|bz2|xz)$"))) { 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> "
runProgram(settings.nixBinDir + "/nix-build", false, { "--no-out-link", "--expr", "import <nix/unpack-channel.nix> " "{ name = \"" + cname + "\"; channelName = \"" + name + "\"; src = builtins.storePath \"" + filename + "\"; }" });
"{ name = \"" + cname + "\"; channelName = \"" + name + "\"; src = builtins.storePath \"" + filename + "\"; }" }); unpacked = true;
unpacked = true;
} catch (ExecError & e) {
}
} }
if (!unpacked) { if (!unpacked) {