about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-12-12T08·51+0100
committerGitHub <noreply@github.com>2018-12-12T08·51+0100
commit03ce0c3a9e1c07043445579c619eed4895647b36 (patch)
treebbbf57947752d3acc34128486b2bcad59bf52ee5
parent18ecd087ae772885fb223e1771b93a6b0eee1a31 (diff)
parent6f890531084ab6596027ce0bf6ad302864affa5b (diff)
Merge pull request #2572 from LnL7/narinfo-ca
nar-info-disk-cache: include ca in the cache entries
-rw-r--r--src/libstore/nar-info-disk-cache.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstore/nar-info-disk-cache.cc b/src/libstore/nar-info-disk-cache.cc
index 35403e5df56f..5fdd7ce89167 100644
--- a/src/libstore/nar-info-disk-cache.cc
+++ b/src/libstore/nar-info-disk-cache.cc
@@ -31,6 +31,7 @@ create table if not exists NARs (
     refs             text,
     deriver          text,
     sigs             text,
+    ca               text,
     timestamp        integer not null,
     present          integer not null,
     primary key (cache, hashPart),
@@ -72,7 +73,7 @@ public:
     {
         auto state(_state.lock());
 
-        Path dbPath = getCacheDir() + "/nix/binary-cache-v5.sqlite";
+        Path dbPath = getCacheDir() + "/nix/binary-cache-v6.sqlite";
         createDirs(dirOf(dbPath));
 
         state->db = SQLite(dbPath);
@@ -94,7 +95,7 @@ public:
 
         state->insertNAR.create(state->db,
             "insert or replace into NARs(cache, hashPart, namePart, url, compression, fileHash, fileSize, narHash, "
-            "narSize, refs, deriver, sigs, timestamp, present) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1)");
+            "narSize, refs, deriver, sigs, ca, timestamp, present) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1)");
 
         state->insertMissingNAR.create(state->db,
             "insert or replace into NARs(cache, hashPart, timestamp, present) values (?, ?, ?, 0)");
@@ -210,6 +211,7 @@ public:
                 narInfo->deriver = cache.storeDir + "/" + queryNAR.getStr(10);
             for (auto & sig : tokenizeString<Strings>(queryNAR.getStr(11), " "))
                 narInfo->sigs.insert(sig);
+            narInfo->ca = queryNAR.getStr(12);
 
             return {oValid, narInfo};
         });
@@ -243,6 +245,7 @@ public:
                     (concatStringsSep(" ", info->shortRefs()))
                     (info->deriver != "" ? baseNameOf(info->deriver) : "", info->deriver != "")
                     (concatStringsSep(" ", info->sigs))
+                    (info->ca)
                     (time(0)).exec();
 
             } else {