file-digests 0.0.25 → 0.0.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/file-digests.rb +7 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 912b66387453e26ebd7280d7f2dbd599838098a6bcc4da70d1eabe19737ba172
|
4
|
+
data.tar.gz: 9c02352223aff8d6489892df533606bd512de3357dfb59a82513dc04aa1eddfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0380c5acf3750632a3fe49f63d93dbc7533da1389f3e8cab41addc8909f71552a280aec7e3e783e9ae20071bc94af3d70021098b1fbfba96a3e1f78967479c34'
|
7
|
+
data.tar.gz: 4b0a05a27dcb61ee405dc06688753d5eb162e3fdf513fa45aee9a1e2d946fd4697b4f2dbb45f1af57f33ee787c366665144a999c161976cd81992902bfe90fb5
|
data/lib/file-digests.rb
CHANGED
@@ -41,6 +41,10 @@ class FileDigests
|
|
41
41
|
options[:auto] = true
|
42
42
|
end
|
43
43
|
|
44
|
+
opts.on("--accept-fate", "Accept the current state of files that are likely damaged and update their digest data") do
|
45
|
+
options[:accept_fate] = true
|
46
|
+
end
|
47
|
+
|
44
48
|
opts.on(
|
45
49
|
'--digest=DIGEST',
|
46
50
|
'Select a digest algorithm to use. Default is "BLAKE2b512".',
|
@@ -193,7 +197,7 @@ class FileDigests
|
|
193
197
|
end
|
194
198
|
|
195
199
|
if get_metadata("database_version") != "2"
|
196
|
-
STDERR.puts "This version of file-digests is only compartible with the database version 2. Current database version is #{get_metadata("database_version")}. To use this database, please install appropriate version if file-digest."
|
200
|
+
STDERR.puts "This version of file-digests (#{file_digests_gem_version || 'unknown'}) is only compartible with the database version 2. Current database version is #{get_metadata("database_version")}. To use this database, please install appropriate version if file-digest."
|
197
201
|
raise "Incompatible database version"
|
198
202
|
end
|
199
203
|
end
|
@@ -234,6 +238,7 @@ class FileDigests
|
|
234
238
|
update_digest_to_new_digest new_digest, old_digest
|
235
239
|
end
|
236
240
|
set_metadata "digest_algorithm", @new_digest_algorithm
|
241
|
+
puts "Transition to a new digest algorithm complete: #{@new_digest_algorithm}"
|
237
242
|
end
|
238
243
|
end
|
239
244
|
|
@@ -312,7 +317,7 @@ class FileDigests
|
|
312
317
|
end
|
313
318
|
end
|
314
319
|
else
|
315
|
-
if found['mtime'] == mtime # Digest is different and mtime is the same
|
320
|
+
if found['mtime'] == mtime && !@options[:accept_fate] # Digest is different and mtime is the same
|
316
321
|
@counters[:likely_damaged] += 1
|
317
322
|
STDERR.puts "LIKELY DAMAGED: #{filename}"
|
318
323
|
else
|