Closed youtux closed 10 years ago
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.
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.
We won't be adding code to formulae until we have a tool that handles most of them without it, I'm afraid.
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.
@youtux I don't think this needs something added to the formula syntax so currently: probably not, sorry.
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.
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.
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.
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?
@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.
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 withport 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, likeHOMEBREW_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.