From 3541b4989fdb3fd8a86711831564baaedafb271b Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Mon, 8 Sep 2025 10:21:38 -0400 Subject: [PATCH] bump: use LivecheckVersion for comparison I recently modified `bump` to show the upstream version even when the formula/cask version is newer (instead of an opaque `Unable to get versions` error) but I noticed an issue while reviewing output from a recent autobump run in homebrew/cask. This change works as expected for versions with only one part (e.g., 1.2.3) but some multipart cask versions (e.g., 1.5,15039) aren't being handled like they should (where we split on commas and compare the version parts separately). As a result, a cask version like 1.5,15039 is incorrectly seen as newer than an upstream version like 1.5.1,15145 because 15039 from the cask version is being compared to 1 in the upstream version. This addresses the issue by using `LivecheckVersion` objects in the related comparison, so versions will be handled as expected. This was an oversight on my part but it only affects one cask at the moment (`ia-presenter`), so it wasn't a widespread issue. --- Library/Homebrew/dev-cmd/bump.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/bump.rb b/Library/Homebrew/dev-cmd/bump.rb index 5545654fec..20c88e625a 100644 --- a/Library/Homebrew/dev-cmd/bump.rb +++ b/Library/Homebrew/dev-cmd/bump.rb @@ -399,7 +399,8 @@ module Homebrew newer_than_upstream[version_type] = (current_version_value = current_version.send(version_type)).is_a?(Version) && - (current_version_value > new_version_value) + (Livecheck::LivecheckVersion.create(formula_or_cask, current_version_value) > + Livecheck::LivecheckVersion.create(formula_or_cask, new_version_value)) end if !args.no_pull_requests? &&