lib/u3d/download_validator.rb in u3d-1.0.13 vs lib/u3d/download_validator.rb in u3d-1.0.14
- old
+ new
@@ -64,9 +64,14 @@
end
end
class WindowsValidator < DownloadValidator
def validate(package, file, definition)
+ # External packages have no md5 and a false size value
+ if definition[package]['size'] % 1000 && definition[package]['md5'].nil?
+ UI.verbose "File '#{definition[package]['title']}' seems external. Validation skipped"
+ return true
+ end
rounded_size = (File.size(file).to_f / 1024).floor
size_validation(expected: definition[package]['size'], actual: rounded_size) &&
hash_validation(expected: definition[package]['md5'], actual: Utils.hashfile(file))
end
end