Use version attribute directly in cache comparisons

The bug that prompted the two relevant commits has since been addressed.

Squashed commit of the following:

commit ecca17ede8324efd1175a42300ace8e1e2df30fa
Author: Jack Nagel <jacknagel@gmail.com>
Date:   Sat Dec 27 16:16:12 2014 -0500

    Revert "Don't use pkg_version when cleaning the cache"

    This reverts commit 4d511b5169d78a5d44bbf6c36c17f0c28014a614.

commit e8935de08f6440ae1874ce523f93b19da6b68df3
Author: Jack Nagel <jacknagel@gmail.com>
Date:   Sat Dec 27 16:16:12 2014 -0500

    Revert "Fix cleanup for head-only formulae"

    This reverts commit 510267ffd314c296c0b0969dd27d130a249f16e2.
This commit is contained in:
Jack Nagel 2014-12-27 16:16:16 -05:00
parent e1c6a4614f
commit ba48d8c5b9

View File

@ -86,8 +86,7 @@ module Homebrew
next
end
spec = f.stable || f.devel || f.head
if spec.version > version || ARGV.switch?('s') && !f.installed? || bottle_file_outdated?(f, file)
if f.version > version || ARGV.switch?('s') && !f.installed? || bottle_file_outdated?(f, file)
cleanup_cached_file(file)
end
end