Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Implementing a livecheck mechanism to find out outdated formulas. #33433

Closed
youtux opened this issue Oct 21, 2014 · 10 comments
Closed

Implementing a livecheck mechanism to find out outdated formulas. #33433

youtux opened this issue Oct 21, 2014 · 10 comments

Comments

@youtux
Copy link
Contributor

youtux commented Oct 21, 2014

I was reading #12564 and I thought that it would be nice to have a feature to check if a formula is outdated w.r.t. the upstream, just like macports does with port livecheck.

I thought about having this kind of syntax:
brew livecheck <formula> to find out what is the latest version of the formula in the upstream;
brew livecheck outdated to list all the outdated formulas (yes, it could be a very long process);
brew livecheck installed to list all the outdated formulas that are installed;
brew livecheck to list all the outdated formulas maintained by the user (maybe they could be into an ENV variable, like HOMEBREW_WATCH).
I'd really like to help to implement such thing, but I'm trying to understand the internals of homebrew without much success. Furthermore, I don't have a good ruby-style programming experience.
Of course the syntax of a formula must be updated, but since a good number of the formulas are "github-based", we could just rely on the list of tags from git.

Let me know if I missed some sources where I can find how to contribute.

@MikeMcQuaid
Copy link
Member

You shouldn't actually need to use much of the internals of Homebrew here. Do you have any more specific questions on something you've struggled with? I suggest just trying to implement brew livecheck as an external command for a single formula first.

@youtux
Copy link
Contributor Author

youtux commented Oct 21, 2014

Well, the problem is that the command would work only with the specific formula you're considering. I would like to make it available for all the formulas, but then it would be necessary to have some additional fields in the formula syntax, like

check_updated do
  # code that returns the list of available version from the upstream
end

and then the command brew livecheck <formula> would actually run that method and find if there is a version newer than the formula's one.

@MikeMcQuaid
Copy link
Member

We won't be adding code to formulae until we have a tool that handles most of them without it, I'm afraid.

@youtux
Copy link
Contributor Author

youtux commented Oct 21, 2014

If I (unlikely) come up with a solution that needs just one method more (like check_updated) to be added to the formula syntax, is it possible that you accept it?

EDIT: Of course it is not mandatory, but those formulas that implement it are enabled to this function.

@MikeMcQuaid
Copy link
Member

@youtux I don't think this needs something added to the formula syntax so currently: probably not, sorry.

@jacknagel
Copy link
Contributor

I agree, adding something to the formula syntax is one of the last steps in developing a feature. It should be straightforward to implement this without touching internals. If the feature proves useful, then we can discuss adding it to core.

@youtux
Copy link
Contributor Author

youtux commented Oct 22, 2014

Ok, I made a basic external command at https://github.com/youtux/homebrew-livecheck.
It is very basic, but it already can check for updates for those formulae that uses git (for example, sqlmap). For the others, it is possible to extend the formula by implementing a method get_latest_version and then just merge it into my repository.

Let me know if you think it's a good idea and any other suggestion are well appreciated.

@MikeMcQuaid
Copy link
Member

Yeh, this looks like a good approach. I'll close this out for now but might be interesting to make a note/blog/wiki for this noting which formulae you've testing it with and where it works/doesn't currently.

@youtux
Copy link
Contributor Author

youtux commented Oct 23, 2014

FYI the command I wrote now can display the version of all the installed formulae.
Of course most of the time it fails since not all formulae use git and there are only a few formulae that implement the livecheck functionality in my project.
Is there any way it can go on the homebrew's wiki to get some attention?

@MikeMcQuaid
Copy link
Member

@youtux If you tweet asking for help building it and mention @MacHomebrew I'll RT you. Probably worth posting to the mailing list (homebrew@librelist.com) too.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants