Comments (10)
Suggest modifying brew upgrade --cask to judge the current installed version number. For example, by using defaults read /Applications/Google\ Chrome.app/Contents/Info.plist CFBundleShortVersionString to determine if the installed version
This sounds like a decent solution.
Regarding the general behaviour of brew upgrade
.
I would note that calling brew upgrade
without explicitly referencing google-chrome
, will not upgrade casks that have the auto_updates true
flag set. Calling brew upgrade google-chrome
directly implies that you would like to upgrade Google Chrome regardless of whether it has an auto-update mechanism.
from brew.
Suggest modifying brew upgrade --cask to judge the current installed version number. For example, by using defaults read /Applications/Google\ Chrome.app/Contents/Info.plist CFBundleShortVersionString to determine if the installed version
This sounds like a decent solution.
Regarding the general behaviour of
brew upgrade
. I would note that callingbrew upgrade
without explicitly referencinggoogle-chrome
, will not upgrade casks that have theauto_updates true
flag set. Callingbrew upgrade google-chrome
directly implies that you would like to upgrade Google Chrome regardless of whether it has an auto-update mechanism.
I think we should check for the existence of automatic update mechanism before performing the update operation.
For example, when executing brew upgrade google-chrome --cask
, if the automatic update mechanism has already updated Chrome to the latest version, there is no need for Homebrew to redownload and reinstall it. Only updating the version number in the brew database is sufficient.
from brew.
Only updating the version number in the brew database is sufficient.
The only challenge with a cask such as google-chrome
is that the download is actually unversioned, so although the cask has been updated to a newer version, the version that is downloaded may be different. So a true comparison cannot be completed without downloading the files.
from brew.
~ defaults read /Applications/Google\ Chrome.app/Contents/Info.plist CFBundleShortVersionString
123.0.6312.107
It seems that I can accurately get the version number of Chrome, and of course, the situation you mentioned may indeed occur.
from brew.
Calling
brew upgrade google-chrome
directly implies that you would like to upgrade Google Chrome regardless of whether it has an auto-update mechanism.
Agreed, and this makes sense to me.
Only updating the version number in the brew database is sufficient.
There is no database here. The version is stored in a folder name on disk e.g. /opt/homebrew/Caskroom/google-chrome/123.0.6312.107/
. Updating the contents of this folder will require pretty much the same time as all but downloading the existing change.
I'm also not necessarily convinced that the version in the plist should mean that an upgrade should not happen. This would not upgrade based on e.g. actual changes to the Cask file contents, potentially ever.
brew info --json=v2 google-chrome | jq '.casks[0]'.bundle_short_version
will output this short version and we are able to query it with Cask internals, I'm just not sure it should be tied to the brew upgrade
case specifically.
Leaving this open for other Cask folks to chip in but, personally, I'm 👎🏻 on the changes described here.
from brew.
I would note that calling brew upgrade without explicitly referencing google-chrome, will not upgrade casks that have the auto_updates true flag set. Calling brew upgrade google-chrome directly implies that you would like to upgrade Google Chrome regardless of whether it has an auto-update mechanism.
I think our current approach here is reasonable and not sure if adding an additional layer of complexity here makes sense. Casks do not have consistent versioning schemes and occasionally, the scheme will be completely unrelated to CFBundleShortVersionString
. This is a great idea in theory, but not super feasible IMO. Personally, I would pass on this. Sorry!
from brew.
Thank you for considering this idea. Thank you for your contributions.
from brew.
Thanks for your understanding @missuo!
from brew.
Casks do not have consistent versioning schemes and occasionally, the scheme will be completely unrelated to
CFBundleShortVersionString
.
@razvanazamfirei @Homebrew/cask Relatedly: I do think making versions either the short version string or version string where possible (and a DSL to indicate which one is used) would make life much better around these sort of issues in future.
from brew.
It's always the goal, but we basically need to collect whatever is required to assemble the url
dynamically as the "version". Alternative would be to split the version dsl, to have the actual version, and then any additional dynamic url parts.
from brew.
Related Issues (20)
- Allow macos 11 to be used HOT 1
- Allow formulae to set an env for their completion generation HOT 4
- Show disk space in info command HOT 3
- Fine-grained PATs do not work when used as $HOMEBREW_GITHUB_API_TOKEN HOT 3
- `brew upgrade -g` sometime will install old version app HOT 3
- `brew upgrade -g` sometime will install old version app
- @PizzaShift @ligi Hello.
- Support GitHub App installation access tokens HOT 2
- Command "brew update" shows "/dev/stdin: No such file or directory - /tmp/sh-thd-2853475760 (deleted) (Errno::ENOENT)" HOT 8
- How should we store installed cask information? HOT 18
- Integrating attestation verification into `brew install` (and `brew verify`) HOT 17
- `brew bump --open-pr` fails to fetch repology data HOT 5
- Add a RuboCop rule for sorting EnvConfig keys
- Make `update <formula>` actually `upgrade formula` HOT 2
- `brew info` should always print whether formula installed HOT 5
- `brew log` regression after port to `abstract_command` HOT 1
- option to install package to home directory or a custom directory HOT 1
- Running the macOS installer changes permissions on `~/.gitconfig` HOT 5
- Introduce additional versioning information for casks HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brew.