-
-
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
Remove url do
blocks
#186501
Remove url do
blocks
#186501
Conversation
a04138f
to
38acfbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work for your first time working with livecheck
blocks 👍
If you agree with these comments/suggestions, I can push commits tomorrow to save you from having to commit/implement changes.
Please feel free to do that! Also, worth noting that all of these except |
Agreed 👍🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to go when you are. As mentioned: not worth spending more than the minimal possible time on anything due to be deprecated soon.
We're removing these in Homebrew/homebrew-cask#186501 so let's deprecate them too.
The directories that precede the dmg file are different for each build, so we also need to capture those and store them in the cask `version`.
All of the recent snapshot builds of `keepassxc` use a 2.8.0 version in the filename. If we use the dmg file in the `/latest/` directory and the version doesn't change between builds, then we will get a checksum mismatch when the build is updated. Instead, we have to use a fully-versioned URL that uses a build directory instead, as this will remain static between builds. Similarly, `/latest/` is an actual directory and not just a url that redirects to the latest build, so checking the dmg file in that directory won't give us the full URL with the build number in it. With this setup, we have to find the newest build directory number on the main snapshots page, then check the directory listing page for that build directory to find the version in the dmg file name.
File names for nightly `transmission` releases only include a hash but we also need the build number to be able to use a fully-versioned URL. Using a `lastSuccessfulBuild` dmg URL would result in a 404 (Not Found) response when the next build occurs, as the expected file won't be available anymore. With that in mind, we need to use a build-specific dmg URL. This updates the cask to include the build number in the `version` and to capture that information in the `livecheck` block regex. Unfortunately the dmg URL on the `lastSuccessfulBuild` page doesn't use a build number but we can identify the build number from other areas of the page.
The file name version has remained consistent from the start of this year (at least) but we should capture it in the `livecheck` regex and include it in the cask `version`, so we can easily version bump the cask if/when the version changes in the future. Besides that, this reworks the `livecheck` block's `strategy` block to better align with existing standards/patterns.
38acfbc
to
dbd43d4
Compare
Pushed some commits to incorporate the suggestions/ideas above, so these should be good to go but do check my work. Some of these had version updates in the interim time, so I updated those in the process. Considering that we were able to successfully use versioned URLs and create working |
Thanks @samford! |
We're removing these in Homebrew/homebrew-cask#186501 so let's deprecate them too.
URL stanzas are deprecated in favor of livecheck: Homebrew/homebrew-cask#186501 This pins the current latest version of `master` and adds a livecheck stanza to make updating easier. In the future if this were upstreamed to `homebrew-cask`, I believe the BrewTestBot could automatically update the version + sha256 using this livecheck. Reviewed-by: Yurii Kolesnykov <[email protected]>
This PR removes the
url do
blocks that remain in homebrew/cask. These will be disallowed in official taps soon. See Homebrew/brew#18390 for more context, but essentially we want these removed for formulae.brew.sh API generation.To be honest, this is the first time I've really played with livechecks, so let me know if those aren't correct.