Skip to content

Conversation

@alyssais
Copy link
Contributor

  • 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 tests with your changes locally?

Previously, trying to resolve the dependencies of a keg would raise an exception if the formulae for any of the dependencies could not be found (e.g. if it had been moved to another tap).

This commit updates the dependency finding logic to catch these exceptions, and fall back to comparing names and taps of formulae, which should give the correct behaviour.

Fixes #1586.

Previously, trying to resolve the dependencies of a keg would raise an
exception if the formulae for any of the dependencies could not be found
(e.g. if it had been moved to another tap).

This commit updates the dependency finding logic to catch these
exceptions, and fall back to comparing names and taps of formulae, which
should give the correct behaviour.

Fixes Homebrew#1586.
@alyssais
Copy link
Contributor Author

I had to cherry-pick 0a20edf from #1527 to work around #1526.

@alyssais
Copy link
Contributor Author

To test this:

  1. Install formula X with a non-core-tap dependency
  2. Untap that tap
  3. brew uninstall X

Previously, this would give you an error. Now, it shouldn't.

dep_formula = Formulary.factory(dep["full_name"])
next false unless dep_formula == to_formula
rescue FormulaUnavailableError
next false unless my_tab["full_name"] = dep["full_name"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Single equals… oops

Because of an accidental use of `=` instead of `==`, the source formula
check would be skipped when determining if a keg depended on another one
(so only the versions would be compared).

Fixed that comparison, and updated the corresponding test.

Glad I caught that!
@MikeMcQuaid MikeMcQuaid merged commit 577bf62 into Homebrew:master Dec 29, 2016
@MikeMcQuaid
Copy link
Member

Thanks @alyssais!

@alyssais alyssais deleted the tap_dependents branch December 29, 2016 17:24
@Homebrew Homebrew locked and limited conversation to collaborators May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot uninstall dependents unless the dependencies' formulae still exist

2 participants