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.

Fix livecheck regex and make autobump's tag discovery portable

c7d7b6e445f15e2e26751bd806818cb6d356f36e · Keenan Nemetz · 3d ago · parent cbc6b7ec

Fix livecheck regex and make autobump's tag discovery portable

The livecheck regex never matched anything: the homepage links a release
without a trailing slash (/vole/releases/v0.1.0-rc4), and the version group
could not span the -rcN suffix. livecheck found no versions at all, so it
could never report an update. Match an optional trailing slash and an
optional pre-release suffix, still capturing a plain numeric release.

The discovery step in autobump.sh used `v\?`, a GNU sed extension. BSD sed
(macOS /bin/sed) has no `\?`, matches nothing, and the script stopped with
"no release tag found" on a Mac. Use the portable BRE interval `\{0,1\}`.

Discovery also stripped the `v` from the tag, while the rest of the script
uses the tag verbatim to build the artifact URL — so even under GNU sed the
no-argument form 404'd on SHA256SUMS. Capture the `v` with the tag;
`version=${tag#v}` still drops it for the formula.

Verified: livecheck extracts all four rc tags and Homebrew's Version picks
0.1.0-rc4 as current; `scripts/autobump.sh vole` runs end to end on macOS;
and it still refuses a release whose SHA256SUMS lacks the pinned assets
(rc3, which predates the macOS binaries).

scripts/autobump.sh +8−1

@@ -59,7 +59,14 @@ assets=$(sed -n 's|.*artifacts/\([^"/][^"]*\)\".*|\1|p' "$FORMULA")
59 59 if [ -z "$tag" ]; then
60 60 # The project homepage names its current stable release. This is a discovery
61 61 # step, so a page that moves does not brick a manual bump: say so and stop.
62 tag=$(curl_with_retry "$BASE_URL" | sed -n 's|.*/releases/v\?\([0-9][^/" ]*\).*|\1|p' | head -n 1)
62 # `v\?` is a GNU extension: BSD sed (macOS's /bin/sed) has no `\?`, matches
63 # nothing, and the script stopped with "no release tag found" on a Mac. The
64 # BRE interval `\{0,1\}` means the same thing portably.
65 #
66 # The `v` stays inside the capture on purpose: the tag is used verbatim to
67 # build the artifact URL (/releases/<tag>/artifacts/...), and only `version`
68 # drops the prefix. Capturing the bare number sent that URL to a 404.
69 tag=$(curl_with_retry "$BASE_URL" | sed -n 's|.*/releases/\(v\{0,1\}[0-9][^/" ]*\).*|\1|p' | head -n 1)
63 70 [ -n "$tag" ] || fail "no release tag found on $BASE_URL; pass one explicitly"
64 71 printf 'autobump: %s: using latest release %s\n' "$project" "$tag"
65 72 fi