Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

homebrew-tap
Clone

Read only, no credentials:

https://rodent.software/homebrew-tap.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/homebrew-tap.git

Homebrew tap for Rodent Software.

#1

Fix livecheck regex and make autobump's tag discovery portable

merged · by keenan 3d ago · merged into main at c7d7b6e4 by keenan 3d ago

keenan opened this 3d ago

The formula’s livecheck block has never matched anything, and scripts/autobump.sh cannot discover a tag on macOS. Both are fixed here; the second one was hiding a third bug that broke discovery on Linux too.

1. livecheck never found a version

regex(%r{href=["']?[^"' >]*?/releases/v?(\d+(?:\.\d+)+)/}i)

Two independent reasons it fails against the real homepage:

  • The homepage links a release without a trailing slash — <a href="/vole/releases/v0.1.0-rc4"> — and the regex demands / after the version.
  • (\d+(?:\.\d+)+) cannot span a -rcN suffix, so no pre-release is ever captured.

brew livecheck rodent-software/tap/vole on the current formula:

Error: vole: Unable to get versions

The regex now admits an optional trailing slash and an optional pre-release suffix, while still capturing a plain numeric release.

2. autobump used a GNU sed extension

v\? is a GNU extension. BSD sed (macOS /bin/sed) has no \?: it matches nothing, so the script stopped with no release tag found. Replaced with the portable BRE interval \{0,1\}.

3. discovery stripped the v, so the artifact URL 404’d

This one only surfaced after fixing (2). Discovery captured the bare number (0.1.0-rc4), but the rest of the script uses the tag verbatim to build /releases/<tag>/artifacts/..., so the no-argument form asked for /releases/0.1.0-rc4/artifacts/SHA256SUMS and got a 404 — on Linux as well as macOS. The v is now captured with the tag; version=${tag#v} still drops it for the formula.

The documented workaround (passing an explicit tag) is how the rc4 bump was done, which is why this went unnoticed.

Verified

  • brew livecheck on the fixed formula: vole: 0.1.0-rc4 ==> 0.1.0-rc4 (exit 0), versus Unable to get versions (exit 1) on the original — A/B against the live homepage.
  • Livecheck regex, evaluated from the file against the live homepage, matches all four 0.1.0-rc{1..4} tags; Homebrew Version picks 0.1.0-rc4 as the maximum and treats it as current. A future final 0.1.0 still compares as newer and will be offered.
  • 7/7 regex cases pass, including plain v0.1.0, v1.2.3/, 0.2.0-beta.2, and v0.1.0-rc4/archive.tar; /releases/new and /issues/12 are correctly ignored.
  • scripts/autobump.sh vole with no tag runs end to end on macOS: discovers v0.1.0-rc4, downloads and verifies all four assets, and rewrites the formula idempotently.
  • The fail-safe still holds: autobump.sh vole v0.1.0-rc3 refuses with SHA256SUMS for v0.1.0-rc3 has no vole-darwin-arm64 entry and leaves the formula untouched (rc3 predates the macOS binaries).
  • brew audit --strict clean, brew style no offenses, ruby -c and sh -n OK.

No version or checksum changes: the formula stays pinned to v0.1.0-rc4.

Discussion (0)

No discussion yet.