Unverified Commit 7c56fa9c authored by Mike McQuaid's avatar Mike McQuaid
Browse files

linkage: correctly detect missing kegs.

- manually `raise Errno::ENOENT` to ensure that a keg that doesn't exist
  isn't flagged as a system dependency.
- remove the inconsistent and incorrect summary messaging.
parent 486e76c1
......@@ -193,7 +193,9 @@ class Keg
# @param path if this is a file in a keg, returns the containing {Keg} object.
def self.for(path)
original_path = path
if original_path.exist? && (path = original_path.realpath)
raise Errno::ENOENT, original_path.to_s unless original_path.exist?
if (path = original_path.realpath)
until path.root?
return Keg.new(path) if path.parent.parent == HOMEBREW_CELLAR.realpath
......@@ -68,16 +68,6 @@ class LinkageChecker
display_items "Broken dependencies", @broken_deps, puts_output: puts_output
display_items "Unwanted system libraries", @unwanted_system_dylibs, puts_output: puts_output
display_items "Conflicting libraries", @version_conflict_deps, puts_output: puts_output
if @broken_dylibs.empty?
puts "No broken library linkage detected"
elsif unexpected_broken_dylibs.empty?
puts "No unexpected broken library linkage detected."
puts "Unexpected missing library linkage detected"
puts "Unexpected non-missing linkage detected" if unexpected_present_dylibs.present?
sig { returns(T::Boolean) }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment