buo / homebrew-cask-upgrade

A command line tool for upgrading every outdated app installed by Homebrew Cask
MIT License
2.39k stars 89 forks source link

`--no-brew-update` overrides `--all` #238

Open wickles opened 9 months ago

wickles commented 9 months ago
❯ brew cu --report-only --quiet --all
==> Updating Homebrew
Already up-to-date.
==> Finding outdated apps
==> Found outdated apps
       Cask                Current           Latest            A/U    Result    
...
 6/15  firefox             108.0             117.0.1            Y   [ FORCED ]  
 7/15  obsidian            1.4.11            1.4.12             Y   [ FORCED ]  
 8/15  onedrive            22.141.0703.0002  23.153.0724.0003   Y   [ FORCED ]  
 9/15  ppsspp              1.16              1.16.1                 [OUTDATED]  
10/15  spotify             1.2.10.760        1.2.19.941         Y   [ FORCED ]  
...
❯ brew cu --report-only --quiet --all --no-brew-update
==> Finding outdated apps
==> Found outdated apps
     Cask    Current  Latest  A/U    Result    
1/1  ppsspp  1.16     1.16.1       [OUTDATED]  

Not sure how this is happening. Only difference is:

https://github.com/buo/homebrew-cask-upgrade/blob/9cfd04381733b6d39c35cfbd95b382fb2c533376/lib/bcu/command/upgrade.rb#L28

wickles commented 9 months ago

Personally I would prefer brew cu to inherit from environment variables HOMEBREW_NO_AUTO_UPDATE and HOMEBREW_AUTO_UPDATE_SECS as documented in man brew.

ondrejfuhrer commented 9 months ago

That's interesting. However I can't seem to be able to reproduce that.

❯ brew cu --report-only --quiet --all
==> Updating Homebrew
Already up-to-date.
==> Finding outdated apps
==> Found outdated apps
     Cask        Current  Latest   A/U    Result
1/5  discord     0.0.277  0.0.278   Y   [ FORCED ]
2/5  duckduckgo  1.55.0   1.57.0    Y   [ FORCED ]
3/5  github      3.3.1    3.3.2     Y   [ FORCED ]
4/5  tutanota    3.118.7  3.118.8   Y   [ FORCED ]
5/5  visualvm    2.1.6    2.1.7         [OUTDATED]

Comparing to

brew cu --report-only --quiet --all --no-brew-update
==> Finding outdated apps
==> Found outdated apps
     Cask        Current  Latest   A/U    Result
1/5  discord     0.0.277  0.0.278   Y   [ FORCED ]
2/5  duckduckgo  1.55.0   1.57.0    Y   [ FORCED ]
3/5  github      3.3.1    3.3.2     Y   [ FORCED ]
4/5  tutanota    3.118.7  3.118.8   Y   [ FORCED ]
5/5  visualvm    2.1.6    2.1.7         [OUTDATED]

I wonder what's going on.

ondrejfuhrer commented 9 months ago

Personally I would prefer brew cu to inherit from environment variables HOMEBREW_NO_AUTO_UPDATE and HOMEBREW_AUTO_UPDATE_SECS as documented in man brew.

I agree, that's a valid feature request. Maybe we could separate that to a separate issue and let the community build that 🙂 The --no-brew-update was built before those options were present so it's just a historical reason why this is not yet respecting it.

wickles commented 9 months ago

However I can't seem to be able to reproduce that.

Appears to be related to another configuration flag I use. Try setting environment variable HOMEBREW_NO_INSTALL_FROM_API=1. When I unset that they produce the same output. However we should prefer to get the same output either way.

ondrejfuhrer commented 6 months ago

However I can't seem to be able to reproduce that.

Appears to be related to another configuration flag I use. Try setting environment variable HOMEBREW_NO_INSTALL_FROM_API=1. When I unset that they produce the same output. However we should prefer to get the same output either way.

We don't actually do anything with this flag and it seems that it's actually a development command so therefore not really to be used by "general public". The issue is that when the flag is set, then Cask::version doesn't report installed version for most of the casks and therefore we don't know that they are outdated. I'm not sure if it's worth trying to support and try to find a different way for getting current version then this official API.