5 Commits

Author SHA1 Message Date
Xu Cheng
4db3e51c8e test_pkg_version: remove illegal testcase
`Version` will not end with /_\d+/.

Closes Homebrew/homebrew#38822.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-04-23 12:25:08 +08:00
Jack Nagel
27092cabc4 Switch PkgVersion to use composition
Comparing PkgVersion and Version objects can produce nonsensical
results. For example, equality is not symmetric:

irb(main):002:0> PkgVersion.new("1.0", 0) == Version.new("1.0")
=> false
irb(main):003:0> Version.new("1.0") == PkgVersion.new("1.0", 0)
=> true

Rather than attempt to deal with subclass-superclass equality, let's use
composition and punt on the problem altogether.
2015-04-02 20:22:12 -04:00
Jack Nagel
1ee4cd94ba Fix PkgVersion#<=> 2014-07-03 16:37:43 -05:00
Jack Nagel
982e9239b8 Use a custom test class so we can avoid monkeypatching 2014-06-18 20:32:51 -05:00
Jack Nagel
6008187d5f Encode formula revision in installation prefix
In order to allow kegs built with the same version but differing formula
revisions to coexist, we must encode the revision as part of the keg's
name. This is necessary to actually perform an upgrade, as we cannot
upgrade a keg in-place, and temporarily moving it pending the result of
the upgrade is error-prone and potentially slow.

To accomplish this, we introduce a new Formula#pkg_version method that
concatenates the active_spec version with the formula revision. An
exception is made for a formula that has no revision: the tag is
omitted. This preserves compatibility with existing installations.
2014-03-05 20:12:51 -06:00