diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-11-29 19:33:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-29 19:33:31 +0100 |
commit | f102d793f12943b48bfaa13f4a906d7013e0c88c (patch) | |
tree | 615dcadc913c0b5544f1e4d4cae163e0c1f2bd71 /src/libexpr | |
parent | 895ed4cef09729609d9f1c0b0abe1cc86356c086 (diff) | |
parent | 39954a958623431acb8642372f881cbdb7bb789d (diff) |
Merge pull request #2748 from edolstra/rust
Make nix/unpack-channel.nix a builtin builder
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/primops/fetchGit.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libexpr/primops/fetchGit.cc b/src/libexpr/primops/fetchGit.cc index 7ef3b3823..9d0c64291 100644 --- a/src/libexpr/primops/fetchGit.cc +++ b/src/libexpr/primops/fetchGit.cc @@ -4,6 +4,7 @@ #include "store-api.hh" #include "pathlocks.hh" #include "hash.hh" +#include "tarfile.hh" #include <sys/time.h> @@ -164,14 +165,16 @@ GitInfo exportGit(ref<Store> store, const std::string & uri, if (e.errNo != ENOENT) throw; } - // FIXME: should pipe this, or find some better way to extract a - // revision. - auto tar = runProgram("git", true, { "-C", cacheDir, "archive", gitInfo.rev }); + auto source = sinkToSource([&](Sink & sink) { + RunOptions gitOptions("git", { "-C", cacheDir, "archive", gitInfo.rev }); + gitOptions.standardOut = &sink; + runProgram2(gitOptions); + }); Path tmpDir = createTempDir(); AutoDelete delTmpDir(tmpDir, true); - runProgram("tar", true, { "x", "-C", tmpDir }, tar); + unpackTarfile(*source, tmpDir); gitInfo.storePath = store->addToStore(name, tmpDir); |