mxcl/homebrew — pull request #15914 by manphiz (2012-11-08 10:42:15+00:00)
Title: `brew cleanup` shouldn't remove higher version kegs.

* Use version compare to only remove kegs with lower version than the
current one, not higher version which might be from someone's
branch.
* Do the same for cache cleanup.
- Be conservative so that if a name detected from cache file is not
the same as its formula then don't clean it.

This closes https://github.com/mxcl/homebrew/issues/15907.