Skip to content
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

Update eclecticlight casks livecheck and zap #172292

Merged
merged 15 commits into from May 5, 2024
Merged

Conversation

TheMDev
Copy link
Contributor

@TheMDev TheMDev commented Apr 27, 2024

I was going through the process of adding a new cask for an app by eclectic light and noticed several were pulling updates from a 3rd party gist, needed zaps, wrong depends_on version, etc.

Comment on lines 12 to 16
url :homepage
regex(%r{href=.*?/(\d+)/(\d+)/dintch(\d+)\.zip}i)
strategy :page_match do |page, regex|
page.scan(regex).map do |match|
"#{match[2].split("", 2).join(".")},#{match[0]}.#{match[1]}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
url :homepage
regex(%r{href=.*?/(\d+)/(\d+)/dintch(\d+)\.zip}i)
strategy :page_match do |page, regex|
page.scan(regex).map do |match|
"#{match[2].split("", 2).join(".")},#{match[0]}.#{match[1]}"
url "https://eclecticlight.co/downloads/"
regex(%r{href=.*?/(\d+)/(\d+)/dintch[^"' >]*?\.zip[^>]*?>\s*Dintch\s+v?(\d+(?:\.\d+)*)[^a-z)]}i)
strategy :page_match do |page, regex|
page.scan(regex).map { |match| "#{match[2]},#{match[0]}.#{match[1]}" }

It looks like we can check the Downloads page for these casks, unless there's a particular benefit to checking the homepage.

The downloads page also provides the version with dots in the a element's inner text, so we're better off matching that instead of naively trying to insert dots into the [dotless] filename version. Some of the software already has a two digit major or minor, so we can't safely make assumptions about where to insert dots.

@samford samford added the livecheck Issues or PRs related to livecheck label Apr 29, 2024
@p-linnane
Copy link
Member

The livechecks are checking the developer's official update list he hosts on GitHub. Why do we need to change them?

@p-linnane p-linnane added the awaiting user reply Issue needs response from a user. label Apr 29, 2024
@TheMDev
Copy link
Contributor Author

TheMDev commented Apr 29, 2024

@p-linnane I could not find any references on his site or GitHub that the repo was the official update list, although his username is close enough I guess. Also, going through the update list, it seems incomplete from the casks already added both silnite and viable are not included. Alifix and Sparsity, which I was planning on adding, are also missing from the update list. There are also several more on his website that are missing from the update list as well. I can revert the links to GitHub for those in the list if that's what you'd prefer. However, would it still make sense to use @samford suggestion and then utilize the Version Key for the regex instead of trying to assume where the dots go?

@p-linnane
Copy link
Member

I could not find any references on his site or GitHub that the repo was the official update list, although his username is close enough I guess.

This is the location where Howard's apps that have in-app update mechanisms check for updates. It's coded into the app to check there, so it doesn't get more official than that.

both silnite and viable are not included.

Neither silnite nor viable have in-app update mechanisms.

Alifix and Sparsity, which I was planning on adding, are also missing from the update list.

Neither of them have in-app update mechanisms either.

There are also several more on his website that are missing from the update list as well.

He has many applications that have not been updated for a number of years. We do not accept new casks for software that has not been updated in over a year.

Copy link
Member

@samford samford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the location where Howard's apps that have in-app update mechanisms check for updates. It's coded into the app to check there, so it doesn't get more official than that.

With that in mind, I agree that continuing to check the plist for relevant apps makes sense (I was focused on the implementation, so thanks for the sanity check). We can use the approach in the suggestion above for silnite, since it's not in the plist file.

It would be nice to use the Version value in the plist checks instead of naively inserting dots into the dotless version but that's a bit tricky. We can technically use a lengthy regex to extract the version parts but it would fail if the order of the dict elements changes or if additional elements are added.

Using the Xml strategy to properly parse the XML and work with the dict values [regardless of order] would be ideal. It's a little more involved than the regex approach but it should hold up better over time. I've created implementations for both approaches but using the Xml strategy feels like the right way to handle it.

@TheMDev If you update this to remove the livecheck block changes, I'll push a commit to take care of the aforementioned (updating the plist and silnite livecheck blocks accordingly).

Comment on lines 2 to 9
on_mojave :or_older do
version "1.21,2022.06"
sha256 "c1cbb734f620e073f1c08c473edaa036c2b5ccdca02baa99ca117f86c10ad505"

livecheck do
skip "Legacy version"
end
end
Copy link
Member

@samford samford May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Downloads page still lists the legacy 1.21 version. Was there a reason for removing this from the cask? If not, it seems like we should keep it as-is.

Copy link
Member

@samford samford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the interest of moving this forward, I rebased the branch and pushed commits to update the livecheck blocks. I made a couple of reversions in the process:

  • Restored the legacy version in the silentknight cask (moving the depends_on calls into their respective blocks), as that version is still linked on the download page.
  • Restored the alternative "T2M2" name in thetimemachinemechanic, unless there's a clear reason for dropping it.

One thing to note is that I had to add a temporary version override to the silentknight strategy block (version = "2.07" if version == "2.7"), since the plist Version is 2.7 but the filename is silentknight207.zip. Other software in the plist that uses zero padding accounts for it in the Version value (e.g., T2M22 has a 2.02 Version and the filename is t2m2202.zip).

Copy link
Member

@p-linnane p-linnane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks!

@p-linnane p-linnane merged commit 6383a14 into Homebrew:master May 5, 2024
35 checks passed
@TheMDev TheMDev deleted the main branch May 9, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge-skip awaiting user reply Issue needs response from a user. livecheck Issues or PRs related to livecheck
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants