Closed chdiza closed 7 years ago
This is definitely a bug. Think I know what's going on; should have a fix shortly. Thanks for the lovely detailed report @chdiza.
The problem comes from the "_1" being stripped in one part of the code, but not in another, which messes up as comparison.
@chdiza Homebrew treats underscores in versions a bit specially, and I think that's what's causing the problem here. I'm interested to know where the version scheme with underscores is coming from? Is there a reason it has to use underscores?
There are at least a few of them
gnu-cobol.rb:25: version "2.0_nightly_r658"
tbb.rb:5: version "2017_U6"
tmpreaper.rb:6: version "1.6.13_nmu1"
vbindiff.rb:5: version "3.0_beta4"
Not at computer now so can't confirm, but I think it's only a problem when it's an underscore followed exclusively by digits.
I'm interested to know where the version scheme with underscores is coming from? Is there a reason it has to use underscores?
It comes from me :) There's no reason why it has to use underscores. It just looks better, and I know that there are other formulas that use underscores so I thought those are allowed.
Yeah, Homebrew expresses versions ending in /_\d+\Z/ as Homebrew-specific revisions to formulae, so '1.0.0_2' would be 'revision 2 of the formula for 1.0.0'.
It would probably be possible to make Homebrew handle this correctly, but since it doesn't affect any of our formulae (I checked) it probably isn't something we're going to work on ourselves. We'd definitely accept a PR though!
brew
command and justbrew install
ing one or more formulae? If it's a formulae-specific problem please file this issue at https://github.com/Homebrew/homebrew-core/issues/newbrew update
and retried your prior step?brew doctor
, fixed all issues and retried your prior step?brew config
andbrew doctor
and included their output with your issue?I have a custom formula
foo
in a local tap. Theversion
is "2.1.20_1". Only one version offoo
is installed in the cellar, andbrew outdated
keeps giving me:which is wrong. Also,
brew cleanup -n
gives:which is also wrong: that's not an old version of anything.
I only noticed this problem because I just bumped to "2.1.20_1" from "2.1.20_0". Apparently the latter gets transformed by
brew
internals into "2.1.20", which failed to foolbrew
internals.The formula
foo.rb
, by the way, looks like this (shrunken to show a minimally reproducible test case):Here's the relevant stuff: