From 1a44f1cb656557715d328818270b82c0c13d58a0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 24 Jul 2014 17:11:54 +0200 Subject: nix-copy-closure: Drop --bzip2, --xz, --show-progress MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are too difficult to implement via nix-store --serve. ‘--show-progress’ could be re-implemented fairly easily via a sink/source wrapper class. --- src/nix-store/nix-store.cc | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) (limited to 'src') diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index f2621a9954bf..932789f2c071 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -956,39 +956,8 @@ static void opServe(Strings opFlags, Strings opArgs) case cmdImportPaths: { if (!writeAllowed) throw Error("importing paths is not allowed"); - string compression = readString(in); - - if (compression != "") { - if (compression != "gzip" && compression != "bzip2" && compression != "xz") - throw Error(format("unsupported compression method `%1%'") % compression); - - Pipe fromDecompressor; - fromDecompressor.create(); - - Pid pid = startProcess([&]() { - fromDecompressor.readSide.close(); - if (dup2(fromDecompressor.writeSide, STDOUT_FILENO) == -1) - throw SysError("dupping stdout"); - // FIXME: use absolute path. - execlp(compression.c_str(), compression.c_str(), "-d", NULL); - throw SysError(format("executing `%1%'") % compression); - }); - - fromDecompressor.writeSide.close(); - - FdSource fromDecompressor_(fromDecompressor.readSide); - store->importPaths(false, fromDecompressor_); - - pid.wait(true); - } else - store->importPaths(false, in); - + store->importPaths(false, in); writeInt(1, out); // indicate success - - /* The decompressor will have left stdin in an - undefined state, so we can't continue. */ - if (compression != "") return; - break; } -- cgit 1.4.1