aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-12-12 15:07:31 +0100
committerEelco Dolstra <edolstra@gmail.com>2019-12-12 15:07:31 +0100
commita045f93396a676bf5510700c9ac19f5c16bd69e8 (patch)
treefc5e1b09f621d391339101f86da773bbda13792f /src/libstore
parentecb3a1afa2395c46c4ba2ec9da550f45414dbe6d (diff)
Temporarily revert to using 'tar' until we have gzip support
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/download.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index 2eb39af3a..762b7c303 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -910,6 +910,7 @@ CachedDownloadResult Downloader::downloadCached(
printInfo("unpacking '%s'...", url);
Path tmpDir = createTempDir();
AutoDelete autoDelete(tmpDir, true);
+#if 0
unpackTarfile(store->toRealPath(store->printStorePath(*storePath)), tmpDir, std::string(baseNameOf(url)));
auto members = readDirectory(tmpDir);
if (members.size() != 1)
@@ -917,6 +918,12 @@ CachedDownloadResult Downloader::downloadCached(
auto topDir = tmpDir + "/" + members.begin()->name;
result.lastModified = lstat(topDir).st_mtime;
unpackedStorePath = store->addToStore(name, topDir, true, htSHA256, defaultPathFilter, NoRepair);
+#else
+ // FIXME: this requires GNU tar for decompression.
+ runProgram("tar", true, {"xf", store->toRealPath(store->printStorePath(*storePath)), "-C", tmpDir, "--strip-components", "1"});
+ result.lastModified = lstat(tmpDir).st_mtime;
+ unpackedStorePath = store->addToStore(name, tmpDir, true, htSHA256, defaultPathFilter, NoRepair);
+#endif
}
// Store the last-modified date of the tarball in the symlink
// mtime. This saves us from having to store it somewhere