about summary refs log tree commit diff
path: root/src/libstore/s3-binary-cache-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/s3-binary-cache-store.cc')
-rw-r--r--src/libstore/s3-binary-cache-store.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc
index 5ecf3996d7eb..3804e0b0fb8f 100644
--- a/src/libstore/s3-binary-cache-store.cc
+++ b/src/libstore/s3-binary-cache-store.cc
@@ -267,9 +267,9 @@ struct S3BinaryCacheStoreImpl : public S3BinaryCacheStore
     void upsertFile(const std::string & path, const std::string & data,
         const std::string & mimeType) override
     {
-        if (path.find(".narinfo") != std::string::npos)
+        if (textCompression != "" && (hasSuffix(path, ".narinfo") || hasSuffix(path, ".ls")))
             uploadFile(path, *compress(textCompression, data), mimeType, textCompression);
-        else if (path.find("/log") != std::string::npos)
+        else if (logCompression != "" && hasPrefix(path, "log/"))
             uploadFile(path, *compress(logCompression, data), mimeType, logCompression);
         else
             uploadFile(path, data, mimeType, "");