[ARVADOS] updated: 9f52191b13196b1926f7b8b0c7c35aac56e02198
git at public.curoverse.com
git at public.curoverse.com
Tue Nov 18 11:33:19 EST 2014
Summary of changes:
services/api/app/models/collection.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
via 9f52191b13196b1926f7b8b0c7c35aac56e02198 (commit)
from 69fae522bf6fe6dbaa64ce7d75ef4ce5616ced72 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 9f52191b13196b1926f7b8b0c7c35aac56e02198
Author: Tom Clegg <tom at curoverse.com>
Date: Tue Nov 18 11:33:15 2014 -0500
4363: Fix size hints for multi-byte manifests (backported from f78caf9).
diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb
index 2f81dc0..d2d674e 100644
--- a/services/api/app/models/collection.rb
+++ b/services/api/app/models/collection.rb
@@ -77,7 +77,7 @@ class Collection < ArvadosModel
def set_portable_data_hash
if (self.portable_data_hash.nil? or (self.portable_data_hash == "") or (manifest_text_changed? and !portable_data_hash_changed?))
- self.portable_data_hash = "#{Digest::MD5.hexdigest(manifest_text)}+#{manifest_text.length}"
+ self.portable_data_hash = "#{Digest::MD5.hexdigest(manifest_text)}+#{manifest_text.bytesize}"
elsif portable_data_hash_changed?
begin
loc = Keep::Locator.parse!(self.portable_data_hash)
@@ -85,7 +85,7 @@ class Collection < ArvadosModel
if loc.size
self.portable_data_hash = loc.to_s
else
- self.portable_data_hash = "#{loc.hash}+#{self.manifest_text.length}"
+ self.portable_data_hash = "#{loc.hash}+#{self.manifest_text.bytesize}"
end
rescue ArgumentError => e
errors.add(:portable_data_hash, "#{e}")
@@ -97,7 +97,7 @@ class Collection < ArvadosModel
def ensure_hash_matches_manifest_text
if manifest_text_changed? or portable_data_hash_changed?
- computed_hash = "#{Digest::MD5.hexdigest(manifest_text)}+#{manifest_text.length}"
+ computed_hash = "#{Digest::MD5.hexdigest(manifest_text)}+#{manifest_text.bytesize}"
unless computed_hash == portable_data_hash
logger.debug "(computed) '#{computed_hash}' != '#{portable_data_hash}' (provided)"
errors.add(:portable_data_hash, "does not match hash of manifest_text")
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list