1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Drop remaining uses of external "tar"

Also, fetchGit now runs in O(1) memory since we pipe the output of
'git archive' directly into unpackTarball() (rather than first reading
it all into memory).
This commit is contained in:
Eelco Dolstra 2019-09-11 15:25:43 +02:00
parent f2bd847092
commit 8918bae098
7 changed files with 43 additions and 24 deletions

View file

@ -9,6 +9,7 @@
#include "legacy.hh"
#include "finally.hh"
#include "progress-bar.hh"
#include "tarfile.hh"
#include <iostream>
@ -192,8 +193,7 @@ static int _main(int argc, char * * argv)
if (hasSuffix(baseNameOf(uri), ".zip"))
runProgram("unzip", true, {"-qq", tmpFile, "-d", unpacked});
else
// FIXME: this requires GNU tar for decompression.
runProgram("tar", true, {"xf", tmpFile, "-C", unpacked});
unpackTarfile(tmpFile, unpacked, baseNameOf(uri));
/* If the archive unpacks to a single file/directory, then use
that as the top-level. */