Conversation
Companion to redis-stack#73. The legacy `postflight` block on the install side is deprecated and prints the matching warning on every install: Warning: Calling `postflight` is deprecated! Use `postflight_steps` instead. `postflight_steps` requires structured step calls with literal arguments — no arbitrary Ruby. This commit maps each existing operation: | Original (deprecated) | Replacement (steps DSL) | | --- | --- | | `FileUtils.mkdir_p(confdir)` | `mkdir_p "{{HOMEBREW_PREFIX}}/etc"` | | `FileUtils.cp(src, conffile) unless File.exist?(conffile)` | `unless_path_exists ... do copy ... end` | | `binaries.each` + `File.symlink ... unless File.exist?(dest)` | one `symlink ... remove_on_uninstall: true` per binary | | `Dir[".../*.so"].each` + `File.basename` + `File.symlink` | `symlink ... source_glob: true, remove_on_uninstall: true` | | Ruby interpolation `#{HOMEBREW_PREFIX}` | template substitution `{{HOMEBREW_PREFIX}}` (required inside steps blocks) | | Ruby interpolation `#{caskroom_path}/#{version}` | template substitution `{{caskroom_path}}/{{version}}` | Each `symlink` carries `remove_on_uninstall: true` so Homebrew tracks and removes the symlinks it created on uninstall — preserving the original safety property of never touching user-installed files at the same paths. The matching `uninstall_postflight` block is left for redis-stack#73; once both land the install/uninstall sides use the same tracked symlink lifecycle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Companion to #73. Fixes the matching deprecation warning on the install side:
What changed
Replaced the deprecated
postflightblock with the structuredpostflight_stepsblock. Each existing operation maps cleanly onto a curated step call:FileUtils.mkdir_p(confdir)mkdir_p "{{HOMEBREW_PREFIX}}/etc"FileUtils.cp(src, conffile) unless File.exist?(conffile)unless_path_exists ... do copy ... endbinaries.each+File.symlink ... unless File.exist?(dest)symlink ... remove_on_uninstall: trueper binaryDir[".../*.so"].each+File.basename+File.symlinksymlink ... source_glob: true, remove_on_uninstall: truePaths use the
{{HOMEBREW_PREFIX}}/{{caskroom_path}}/{{version}}template syntax (steps-DSL requires this in place of Ruby interpolation).Every
symlinkcarriesremove_on_uninstall: true, so Homebrew tracks and removes the symlinks it created on uninstall — preserving the original safety property of never touching user-installed files at the same paths.Relationship to #73
The
uninstall_postflightblock on the uninstall side has the same deprecation (#73). Once both PRs land, install/uninstall use the same tracked symlink lifecycle (postflight_steps → auto-cleanup on uninstall). I left that block alone on this branch to keep the diffs small and reviewable; #73 supersedes it.