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:
parent
f2bd847092
commit
8918bae098
7 changed files with 43 additions and 24 deletions
|
@ -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. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue