1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 16:51:15 +02:00

BinaryCacheStore: Support bzip2 compression

This commit is contained in:
Eelco Dolstra 2016-04-29 17:43:37 +02:00
parent 6963de2091
commit 4dde0b0562
3 changed files with 130 additions and 45 deletions

View file

@ -87,7 +87,10 @@ void BinaryCacheStore::addToCache(const ValidPathInfo & info, ref<std::string> n
% duration);
/* Atomically write the NAR file. */
narInfo->url = "nar/" + printHash32(narInfo->fileHash) + ".nar.xz";
narInfo->url = "nar/" + printHash32(narInfo->fileHash) + ".nar"
+ (compression == "xz" ? ".xz" :
compression == "bzip2" ? ".bz2" :
"");
if (!fileExists(narInfo->url)) {
stats.narWrite++;
upsertFile(narInfo->url, *narCompressed);