mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
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.
This commit is contained in:
parent
486e76c1f2
commit
7c56fa9caf
@ -193,7 +193,9 @@ class Keg
|
|||||||
# @param path if this is a file in a keg, returns the containing {Keg} object.
|
# @param path if this is a file in a keg, returns the containing {Keg} object.
|
||||||
def self.for(path)
|
def self.for(path)
|
||||||
original_path = 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?
|
until path.root?
|
||||||
return Keg.new(path) if path.parent.parent == HOMEBREW_CELLAR.realpath
|
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 "Broken dependencies", @broken_deps, puts_output: puts_output
|
||||||
display_items "Unwanted system libraries", @unwanted_system_dylibs, 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
|
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."
|
|
||||||
else
|
|
||||||
puts "Unexpected missing library linkage detected"
|
|
||||||
end
|
|
||||||
|
|
||||||
puts "Unexpected non-missing linkage detected" if unexpected_present_dylibs.present?
|
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user