SIGN IN SIGN UP
Homebrew / brew UNCLAIMED

🍺 The missing package manager for macOS (or Linux)

0 0 185 Ruby

bump: handle simple arch-specific version bumps

We have casks with separate ARM/Intel versions where livecheck is
skipped for Intel and this prevents autobump from updating the ARM
version because `brew bump` naively treats the "skipped" text for
Intel as a new version and this predictably fails. In this type of
scenario, `bump` should only update the version for the unskipped
arch. Addressing this issue also surfaced a shortcoming in duplicate
PR checking, where we didn't have proper guards for the ARM version
for multi-arch packages, so `bump` would check for duplicate PRs even
if the version wasn't newer.

These changes should address the aforementioned issues, though it
results in even more repeated conditional logic due to how errors and
skips are handled in `bump` (there has to be a better way of doing
this).

Lastly, this sorts `arch_values` in `generate_system_options`, so
they're ordered from the highest new version to the lowest when the
upstream versions are arch-specific. The `OnSystem::ARCH_OPTIONS`
array puts Intel before ARM, so version replacement for Intel happens
before the version replacement for ARM. However, in homebrew/cask, the
ARM version is almost always newer than the Intel version, so this
order can result in inaccurate version replacements (e.g., if the
Intel version is 1.2.3 and the ARM version is 1.2.4, bumping Intel to
1.2.4 and ARM to 1.2.5 would result in Intel being updated to 1.2.4
and then the ARM version replacement would naively update the version
for both archs to 1.2.5). This is an issue that needs a proper fix but
sorting the `arch_values` is a workaround to mitigate the issue in the
interim time.
S
Sam Ford committed
0119685d3abde53226d03e43c8a35cac27bd53fd
Parent: 91ac6c8