formula: ensure that kegs with `version_scheme == -1` are outdated
- [x] Have you followed the guidelines in our Contributing document?
- [x] Have you checked to ensure there aren't other open Pull Requests for the same change?
- [x] Have you added an explanation of what your changes do and why you'd like us to include them?
- [ ] Have you written new tests for your changes? Here's an example.
- [x] Have you successfully run
brew stylewith your changes locally? - [x] Have you successfully run
brew typecheckwith your changes locally? - [ ] Have you successfully run
brew testswith your changes locally?
Fixes Homebrew/discussions#3500. A version_scheme of -1 alone is not sufficient to mark a keg as outdated.
Apologies for missing this earlier -- my earlier testing had rewriting the version scheme to -1 as resulting in the formula becoming outdated. However, I was also moving the HEAD of my repository around to try to simulate a gcc update, and I must've done that wrong.
Review period skipped due to critical label.
Can you check and make sure brew upgrade between identical pkg_versions works correctly?
Can you check and make sure
brew upgradebetween identical pkg_versions works correctly?
As in brew upgrade when pkg_version does not change should be a no-op, right? Or do we also want it to take version_scheme into account?
I thought the whole point of setting version_scheme to be -1 was so that brew upgrade would reinstall those formulae?
I'm asking to check if that works given the Cellar/keg directory it'll install to will be unchanged, which is not typical in an upgrade.
Yes, that was my understanding too, and based on my (apparently mistaken) testing, how it worked. Looking at it now, that doesn't seem to be how the code works.
I don't understand why we wouldn't want to upgrade a formula when the installed version_scheme is older than the formula's version_scheme but the pkg_version is the same across the two, but I assume that was put in there for a reason.
Ok, gotcha. Let me give it a try.
It does not work:
❯ brew outdated
hello (2.12.1) < 2.12.1
❯ brew upgrade hello
==> Upgrading 1 outdated package:
hello 2.12.1 -> 2.12.1
==> Downloading https://ghcr.io/v2/homebrew/core/hello/manifests/2.12.1
Already downloaded: /Users/chisquared/Library/Caches/Homebrew/downloads/1ea4c3c37828c1113de2100e5188b954c72e9c25fcbc67c76cc55cfeec2d4ab6--hello-2.12.1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/hello/blobs/sha256:62534bceb8f7074827fa2146dd13603018aaf07c82e22cfef96571c8133ce8a1
Already downloaded: /Users/chisquared/Library/Caches/Homebrew/downloads/9e19602a7efcf3694bfc4341bb710d68b297a5031a86e806c2f68de4c3131a3f--hello--2.12.1.monterey.bottle.tar.gz
==> Upgrading hello
2.12.1 -> 2.12.1
==> Pouring hello--2.12.1.monterey.bottle.tar.gz
cp: /usr/local/Cellar/hello/./2.12.1/bin/hello: Permission denied
Error: Failure while executing; `cp -pR /private/tmp/d20220806-2667-1kbhagp/hello/. /usr/local/Cellar/hello` exited with 1. Here's the output:
cp: /usr/local/Cellar/hello/./2.12.1/bin/hello: Permission denied
Probably why it excludes the case where the pkg_version is the same.
A
version_schemeof-1alone is not sufficient to mark a keg as outdated
Yes.
Probably why it excludes the case where the
pkg_versionis the same.
Yes.
Might even need a new DSL for this or have some disgusting hack like a version_scheme of -123456 trigger a reinstall.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.