Closed cesarcoatl closed 3 years ago
CC @samford in case this relates to recent work
I looked into this and it was introduced in 26821301e74b3b4a559877c97ce8af1b8da8f545 and relates to the added early return conditions in PageMatch#find_versions
. I had tested this on homebrew/core without any issue but I only tested a few casks (not all of homebrew/cask).
The basic issue here is that PageMatch
requires a regex to function but a number of livecheck
blocks in casks (e.g., alfred
) don't use #regex
and inline the regex in the strategy
block instead. I've warned against this in general and some newer homebrew/cask livecheck
blocks correctly use #regex
and pass the value into the strategy
block but there are still a number of older PageMatch
strategy
blocks that don't. These are the ones that were broken by this change.
I'll open a PR to update the early return conditions to require url
and either regex
or a block, so the checks that are currently broken will work again. It wasn't my intention to break these checks and it was simply an oversight.
In the long run, a lot of the livecheck
blocks in casks with simple strategy
block like alfred
should move the regex into a #regex
call and pass it into the strategy block. This has always been the standard pattern in homebrew/core and it's starting to get picked up in homebrew/cask but there are still a lot of older strategy
blocks that need to be updated.
That said, there are some cask strategy
blocks where more than one regex is required to identify the full version and neither of the regexes can be viewed as the primary regex. Those are exceptional cases where we don't have any choice but to inline the regexes in the strategy
block and the updated early return conditions will support that scenario. [One way to improve this situation would be to allow #regex
to accept a regex array or maybe a hash with Regexp
values, so we could establish all the used regexes this way. I'll have to look into something like this, as it would allow us to standardize on always using #regex
and also allow us to surface all the used regexes in the debug and JSON output.]
brew update
. Sorry for the temporary disruption!
brew config
outputbrew doctor
outputbrew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
I tried to run
brew livecheck
and some casks are failing. All of them are using thePageMatch
strategy extracting certain fields.My
.brew_livecheck_watchlist
file looks like this:What happened (include all command output)?
I also found other casks using the same strategy:
What did you expect to happen?
I expected the command to succeed and check if the versions match or must be updated.
Step-by-step reproduction instructions (by running
brew
commands)