Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Compact index case collisions #4864

Closed
indirect opened this issue Aug 9, 2016 · 0 comments
Closed

Compact index case collisions #4864

indirect opened this issue Aug 9, 2016 · 0 comments
Assignees

Comments

@indirect
Copy link
Member

indirect commented Aug 9, 2016

Related to rubygems/rubygems.org#1356, there is a problem compact index clients: if you install the gem Rack, Bundler will download the file from /info/Rack and save it to the filesystem. If you later install the gem rack, Bundler will download the file from /info/rack and save it to the filesystem. But most filesystems are not case-sensitive. So this means that the compact index client will be overwriting the cache file /info/rack back and forth every time one of these conflicting gems is installed. :/ We can fix this in the client by changing the filename for caching capitalized gem names.

I propose that we add a hash to the end of the cache file for any gem name that contains any characters that can't be represented on the filesystem:

info_file = [info_file.gsub(/[^a-z0-9_-]/, ''), md5(info_file)].join("-") if info_file =~ /[^a-z0-9_-]/
homu added a commit that referenced this issue Aug 11, 2016
Add resiliency against case conflicts on a case-insensitive FS

Closes #4864
homu added a commit that referenced this issue Aug 11, 2016
Add resiliency against case conflicts on a case-insensitive FS

Closes #4864
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants