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

autoremove: skip formulae where installed_on_request is nil #17589

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Jun 29, 2024

  • 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 typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Fixes #17572

This PR modifies the autoremove formula detection logic to only include formulae who's tab installed_on_request value is false. This is to prevent autoremove from removing formulae that have malformed install receipts which make us unsure whether they were actually installed on request or not. Instead, let's err on the side of caution and not remove the formula.

Copy link
Contributor

@apainintheneck apainintheneck left a comment

Choose a reason for hiding this comment

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

Better safe than sorry. It'd be great to figure out why the installed_on_request field would be null though. Is this still something that can happen with new install receipts or is it legacy behavior that's been fixed in the meantime?

@Rylan12 Rylan12 merged commit fda555d into master Jun 29, 2024
25 checks passed
@Rylan12 Rylan12 deleted the autoremove-skip-nil branch June 29, 2024 14:39
@Rylan12
Copy link
Member Author

Rylan12 commented Jun 29, 2024

Yeah, it would be good to find how it happened, but my initial attempt wasn't fruitful. Do you have any ideas?

@MikeMcQuaid
Copy link
Member

Is this still something that can happen with new install receipts or is it legacy behavior that's been fixed in the meantime?

This is something that can just happen with very old tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removing a cask triggers autoremove and removes lots of unrelated formulas
4 participants