Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes uninstall if formula is unavailable #7565

Merged
merged 1 commit into from
May 14, 2020

Conversation

sl4m
Copy link
Contributor

@sl4m sl4m commented May 14, 2020

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Encountered an issue where a brewed binary does not have an associated formula.

Error: undefined method `pkgetc' for nil:NilClass
Please report this issue:
  https://docs.brew.sh/Troubleshooting
/usr/local/Homebrew/Library/Homebrew/cmd/uninstall.rb:84:in `block (3 levels) in uninstall'
/usr/local/Homebrew/Library/Homebrew/keg.rb:363:in `block in lock'
/usr/local/Homebrew/Library/Homebrew/lock_file.rb:31:in `with_lock'
/usr/local/Homebrew/Library/Homebrew/keg.rb:359:in `lock'
/usr/local/Homebrew/Library/Homebrew/cmd/uninstall.rb:71:in `block (2 levels) in uninstall'
/usr/local/Homebrew/Library/Homebrew/cmd/uninstall.rb:60:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/uninstall.rb:60:in `block in uninstall'
/usr/local/Homebrew/Library/Homebrew/cmd/uninstall.rb:46:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/uninstall.rb:46:in `uninstall'
/usr/local/Homebrew/Library/Homebrew/brew.rb:110:in `<main>'

#7526 seems to have introduced an issue where uninstall will error if the formula is unavailable (exception raised via FormulaUnavailableError). This fix simply ignores the new code in #7526 unless f is defined.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @sl4m!

@MikeMcQuaid MikeMcQuaid merged commit e5a6a11 into Homebrew:master May 14, 2020
@sl4m sl4m deleted the fixes-brew-uninstall branch May 14, 2020 15:37
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 30, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants