applicationsonline / librarian

Librarian - A Framework for Bundlers. Librarian-Chef is at: https://github.com/applicationsonline/librarian-chef.
http://applicationsonline.com/
MIT License
655 stars 71 forks source link

shorten MD5 hexdigests from 32 to 16 chars #131

Closed tknerr closed 11 years ago

tknerr commented 11 years ago

See GH-130

Reduce the probability of Errno::ENOENT errors when the max path length limit on windows (256 chars) is exceeded by shortening the MD5 hashes from 32 to 16 characters.

This increases the probability of a hash collision to 1:1 billion but should still be good enough.

Since there are two hashes involved in the cache path for a cookbook (e.g. after this PR: tmp/librarian/cache/source/chef/site/877777683730772c/apache2/version-uri/4c32315570baa05b/package/) this saves us 32 chars compared to master.

yfeldblum commented 11 years ago

I'm thinking the caching structure may need to be redone so that everything is cached at the top-level only in tmp/librarian/cache/#{md5 composite_cache_key}.