-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Towards an automatic update mechanism #3084
Conversation
|
Hi! Much respect to you @doits, for speaking with code! All of us want to have I see you discovered one of the fundamental problems, which is that version numbers are currently decided "artistically" by the Cask author, and may not coincide with the version number defined in the app bundle. You should know that the maintainers are working toward the same end-goal as you are here, and that there is more-or-less a plan (if not a schedule). The way we are approaching it is bottom-up, adding each needed building-block on the back end. When we finish that, you will be able to write a robust For instance, #3066 provides one of the needed puzzle-pieces for a robust uninstall and update mechanism. Similarly in #2659 and followups, I am trying to make the Cask name systematic and not "artistic". When that is accomplished, I plan to do the same thing for version numbers. If you want to help out coding up those building blocks, that would be awesome --- please get in touch on IRC and we can coordinate our efforts. If you would rather work independently within the limitations of the current codebase, check out the possibility of writing your own "external command": #2594. |
@rolandwalker thanks for the tip of the external command (missed it) - might be the shortest way for me to get this running while the safe upgrade process is being worked on. This here was just some quick hacking on an unknown codebase to see where I could go without. Nevertheless you are right about the needed changes of the DSL. My proposal with the So maybe I'll refactor the main parts of this PR into external commands (so merging changes will be easier). I'll follow the discussions about implementing a safer upgrade process and discussions about |
…asks Currently simply ignores packages where installed version cannot be determined (e.g. `latest`-Casks).
I updated the PR to be more simple (no DSL change) but to only work with versioned casks. Check for whether the version provided is a regular version and not Maybe this can be used as a base to go for a safe upgrade process. |
Yes, your updated version is way simpler and better. Because there is no DSL change, you could definitely develop both of these as external commands. If you get something going, you could think about/work on interfaces (my head isn't on interfaces now, but on plumbing). We might consider accepting an And, by the way, #3105 was submitted since I last commented here, and is also relevant to your work. PLEASE DO keep in touch. |
I already created a gem to have this run as external commands (prefixed by https://rubygems.org/gems/brew-cask-commands To install it on osx:
The this works then:
I'll keep in touch with this project and contribute code if my spare time allows it. |
Awesome! I'd like to put at least your Can I hack that together into a single file and add attribution, or would you be willing/find the time to make a PR? |
If you ask like this ;-) Sure, hack it together in one file and put it in the examples dir, no problem for me. |
👍 |
1 similar comment
👍 |
@rolandwalker what's the recommended way to use Also, are the #3066 and #2659 still the top of the iceberg for contributing to the Right Way for an update command? |
Closing as this no longer makes sense and will need to be rethought. |
Initial parts of determining the current installed version of an app and a hint whether an update is available or not.
Next step would be to implement automatic updating with
brew cask update
or hook intobrew update
. Besides this, theinstalled?
command must returntrue
even when an old version of an app is installed (might have side effects?). Tests are missing atm, too.Posting this as a PR just to discuss it and to determine whether it is going into the right direction.