--devel brews should be considered separately for outdated version comparision #11922

Closed
domoritz opened this Issue Apr 28, 2012 · 13 comments

Projects

None yet

3 participants

@domoritz

I installed a developer formula for open-scene-graph with brew install --devel and when I do brew outdated I get the following strange message.

open-scene-graph (3.1.1 < 3.0.1)

That does not seem right to me. Is there a way to fix that?

@Sharpie

That does not seem right to me. Is there a way to fix that?

Currently, that is the expected behavior. We have very simple version comparison code. It looks at the version value for the "main" or "stable" URL and compares it to what is installed. If there is a difference then the formula is flagged as "outdated".

@domoritz

I think it would be a good idea to also compare the version number to the dev version.

@Sharpie

Agreed---the only reason this hasn't happened is that noone has written the code yet.

@domoritz

Can you tell me where I can find the code so that I can fix it?

@Sharpie

Sure, the code that calculates the list of outdated brews lives in brew outdated:

https://github.com/mxcl/homebrew/blob/00cd16f/Library/Homebrew/cmd/outdated.rb#L15-27

This is used by brew upgrade, but you have to watch out for places where f.installed? is used as a test to throw out "up to date" formulae:

https://github.com/mxcl/homebrew/blob/cf327ae/Library/Homebrew/cmd/upgrade.rb#L37

@domoritz

@Sharpie Since I have never written a single line of ruby and you seem to be the expert I would like to ask you to write that. It does not seem to be too complicated but I just don't have the time to dig into it.

Thanks a lot.

@jacknagel

It may make more sense to wait for Homebrew 2 to do this.

@domoritz

I think that there are some Issues connected to this one: Issue #11391, and Issue #11267.

@jacknagel

#11267 is only tangentially related, and I have a upcoming refactoring of formula specs that fixes it.

@jacknagel

I should mention that my upcoming formula specs refactor will also stop flagging up-do-date devel versions as out of date.

@Sharpie

It may make more sense to wait for Homebrew 2 to do this.

Given that Homebrew 2 is still at the "nebulous idea" stage, it may make sense to take care of this. Now that --devel has worked its way into a few popular builds, it seems there is a pretty steady stream of these issues. Plus, Homebrew/homebrew-science#7 may require some more flexible handling of version numbers depending on which path we decide to go down.

If nothing else, trying to deal with this will give us more experience upon which to build Homebrew 2.

@jacknagel

The specs refactor is close to being ready, and I think I may work on this after it lands; I started on a proper Version class and it turns out that it can probably be done with minimal code churn.

@jacknagel

This has been partially addressed by the specs refactor, in that devel brews are now factored into the Formula#installed? check. The rest will be addressed by current work on version comparison in #13308.

@jacknagel jacknagel closed this Jul 10, 2012
@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.