| ... | ... | @@ -167,10 +167,12 @@ pub const CacheHash = struct { |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | var iter = mem.tokenize(line, " "); |
| 170 | const inode = iter.next() orelse return error.InvalidFormat; |
| 170 | 171 | const mtime_nsec_str = iter.next() orelse return error.InvalidFormat; |
| 171 | 172 | const digest_str = iter.next() orelse return error.InvalidFormat; |
| 172 | 173 | const file_path = iter.rest(); |
| 173 | 174 | |
| 175 | cache_hash_file.stat.inode = fmt.parseInt(os.ino_t, mtime_nsec_str, 10) catch return error.InvalidFormat; |
| 174 | 176 | cache_hash_file.stat.mtime = fmt.parseInt(i64, mtime_nsec_str, 10) catch return error.InvalidFormat; |
| 175 | 177 | base64_decoder.decode(&cache_hash_file.bin_digest, digest_str) catch return error.InvalidFormat; |
| 176 | 178 | |
| ... | ... | @@ -189,10 +191,10 @@ pub const CacheHash = struct { |
| 189 | 191 | defer this_file.close(); |
| 190 | 192 | |
| 191 | 193 | const actual_stat = try this_file.stat(); |
| 192 | | const mtime_matches = actual_stat.mtime == cache_hash_file.stat.mtime; |
| 194 | const mtime_match = actual_stat.mtime == cache_hash_file.stat.mtime; |
| 195 | const inode_match = actual_stat.inode == cache_hash_file.stat.inode; |
| 193 | 196 | |
| 194 | | // TODO: check inode |
| 195 | | if (!mtime_matches) { |
| 197 | if (!mtime_match or !inode_match) { |
| 196 | 198 | self.manifest_dirty = true; |
| 197 | 199 | |
| 198 | 200 | cache_hash_file.stat = actual_stat; |
| ... | ... | @@ -279,7 +281,7 @@ pub const CacheHash = struct { |
| 279 | 281 | |
| 280 | 282 | for (self.files.toSlice()) |file| { |
| 281 | 283 | base64_encoder.encode(encoded_digest[0..], &file.bin_digest); |
| 282 | | try outStream.print("{} {} {}\n", .{ file.stat.mtime, encoded_digest[0..], file.path }); |
| 284 | try outStream.print("{} {} {} {}\n", .{ file.stat.inode, file.stat.mtime, encoded_digest[0..], file.path }); |
| 283 | 285 | } |
| 284 | 286 | |
| 285 | 287 | try self.manifest_file.?.seekTo(0); |