Skip to content

Commit 2bd74b4

Browse files
committed
homebrew: fix new brew style offense, sync formula to v5.5.0, preserve tap bottles
- Replace Formula["python@3.12"].opt_bin with formula_opt_bin("python@3.12"): Homebrew's new FormulaPathMethods cop (brew 2026-06-22) fails brew style on the old form, which broke Deploy Homebrew Tap and Homebrew Formula Test on the v5.5.0 release. - Bump the in-repo formula url/sha256 to v5.5.0 to match the tap, so the push-triggered tap deploy does not downgrade the tap back to v5.2.0. - Preserve the tap's existing bottle block in deploy-tap.yml when the release URL is unchanged, so formula-only pushes to master no longer delete bottles built for the current version.
1 parent ebde16c commit 2bd74b4

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

‎.github/workflows/deploy-tap.yml‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,19 @@ jobs:
112112
- name: Copy formula and README into tap
113113
if: github.event_name != 'pull_request'
114114
run: |
115+
set -euo pipefail
115116
mkdir -p tap-repo/Formula
116-
cp packaging/homebrew/mfc.rb tap-repo/Formula/mfc.rb
117+
# If the release URL is unchanged, keep the tap's existing bottle block so a
118+
# formula-only push to master doesn't delete bottles already built for this version.
119+
NEW_URL="$(grep -E '^ url ' packaging/homebrew/mfc.rb || true)"
120+
OLD_URL="$(grep -E '^ url ' tap-repo/Formula/mfc.rb 2>/dev/null || true)"
121+
if [[ -n "${NEW_URL}" && "${NEW_URL}" == "${OLD_URL}" ]] && grep -q '^ bottle do' tap-repo/Formula/mfc.rb; then
122+
awk '/^ bottle do/,/^ end$/' tap-repo/Formula/mfc.rb > /tmp/bottle.block
123+
awk '{ print } /^ head / { print ""; while ((getline line < "/tmp/bottle.block") > 0) print line }' \
124+
packaging/homebrew/mfc.rb > tap-repo/Formula/mfc.rb
125+
else
126+
cp packaging/homebrew/mfc.rb tap-repo/Formula/mfc.rb
127+
fi
117128
cp packaging/homebrew/README.md tap-repo/README.md
118129
119130
- name: Commit & push if changed

‎packaging/homebrew/mfc.rb‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
class Mfc < Formula
77
desc "Exascale multiphase/multiphysics compressible flow solver"
88
homepage "https://mflowcode.github.io/"
9-
url "https://github.com/MFlowCode/MFC/archive/refs/tags/v5.2.0.tar.gz"
10-
sha256 "aaee855302950cb6bd8497170a6737214ed9a47ad3d109258f5b27ee2b78fe3d"
9+
url "https://github.com/MFlowCode/MFC/archive/refs/tags/v5.5.0.tar.gz"
10+
sha256 "05499f28291654ee5cc7f4344c85b5b12707e43e8408e7a28b96e43020e42959"
1111
license "MIT"
1212
head "https://github.com/MFlowCode/MFC.git", branch: "master"
1313

@@ -28,7 +28,7 @@ class Mfc < Formula
2828
def install
2929
# Create Python virtual environment inside libexec (inside Cellar for proper bottling)
3030
venv = libexec/"venv"
31-
system Formula["python@3.12"].opt_bin/"python3.12", "-m", "venv", venv
31+
system formula_opt_bin("python@3.12")/"python3.12", "-m", "venv", venv
3232
system venv/"bin/pip", "install", "--upgrade",
3333
"pip", "setuptools", "wheel",
3434
"setuptools-scm",

0 commit comments

Comments
 (0)