about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-29T15·43+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-29T15·43+0200
commit4dde0b0562115525f76943653357410835910a99 (patch)
tree3074cf437558175048fe087654c04ec1aa6e96ab /src/libstore
parent6963de209135d191bdb67cf126df4dda9b19d44e (diff)
BinaryCacheStore: Support bzip2 compression
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/binary-cache-store.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc
index ff717a5dc103..411d10130a31 100644
--- a/src/libstore/binary-cache-store.cc
+++ b/src/libstore/binary-cache-store.cc
@@ -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);