Skip to content

Commit

Permalink
fix(install): use full names for linked and keg_only checks
Browse files Browse the repository at this point in the history
Minimal repro:

```console
❯ brew bundle --file - <<<'tap "gibfahn/tap", "https://github.com/gibfahn/homebrew-tap"
tap "gibfahn/tap2", "https://github.com/gibfahn/homebrew-tap"

brew "gibfahn/tap/check-sieve"'

Using gibfahn/tap
Using gibfahn/tap2
Using gibfahn/tap/check-sieve
Error: Formulae found in multiple taps:
       * gibfahn/tap/check-sieve
       * gibfahn/tap2/check-sieve

Please use the fully-qualified name (e.g. gibfahn/tap/check-sieve) to refer to a specific formula.
```

If you run with `HOMEBREW_DEBUG=1` you can see that the cause of this is
using the `@name` rather than the `@full_name` in the checks run after
the installation is complete.
  • Loading branch information
gibfahn committed Jan 3, 2025
1 parent 4bb232b commit 9dfc103
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bundle/brew_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ def installed?
end

def linked?
Formula[@name].linked?
Formula[@full_name].linked?
end

def keg_only?
Formula[@name].keg_only?
Formula[@full_name].keg_only?
end

def unlinked_and_keg_only?
Expand Down

0 comments on commit 9dfc103

Please sign in to comment.