Repository navigation
Conversation
The legacy `uninstall_postflight` block is deprecated and prints a warning
on every uninstall:
Warning: Calling uninstall_postflight is deprecated! Use
uninstall_postflight_steps instead.
`uninstall_postflight_steps` requires structured step calls with literal
arguments — no arbitrary Ruby. This commit:
* swaps the deprecated block for `uninstall_postflight_steps`
* replaces `binaries.each` / `File.readlink().include?("redis-stack")`
with one `remove ... symlink_target_contains: "redis-stack"` per binary
* replaces `Dir[...] / File.basename / File.delete` with a single
`remove ".../lib/*.so", symlink_target_contains: "redis-stack"`
* uses the `{{HOMEBREW_PREFIX}}` template syntax (steps-DSL requires this
in place of Ruby interpolation `#{HOMEBREW_PREFIX}`)
Behavior is preserved: only symlinks whose target references the caskroom
are removed, leaving any user-installed binaries/libraries at the same
path untouched.
The `postflight` block on the install side is also deprecated for the
same reason but requires a larger refactor (Dir[] glob, File.symlink
loops, FileUtils.cp unless-exist); left for a follow-up.
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
Fixes the deprecation warning printed on every
brew uninstall --cask redis-stack-server:What changed
Replaced the deprecated
uninstall_postflightblock with the structureduninstall_postflight_stepsblock. The new DSL requires literal arguments and the curated step set — no arbitrary Ruby.binaries.each+File.exist?+File.readlink().include?("redis-stack")remove"{{HOMEBREW_PREFIX}}/bin/<name>", symlink_target_contains: "redis-stack"per binaryDir[".../*.so"].each+File.basename+File.deleteremove "{{HOMEBREW_PREFIX}}/lib/*.so", symlink_target_contains: "redis-stack"#{HOMEBREW_PREFIX}{{HOMEBREW_PREFIX}}(required inside steps blocks)Behavior is preserved: only symlinks whose target references the caskroom are removed, leaving any user-installed binaries or libraries at the same path untouched.
Follow-up (not in this PR)
The matching
postflightblock on the install side has the same deprecation:Migrating it to
postflight_stepsis a larger refactor (FileUtils.cp with an unless-exists guard, File.symlink loops, Dir[] glob → source_glob:) and would change the install-time behavior enough that it deserves its own PR + test cycle. Happy to send that as a follow-up once this lands.