Prune LinkedKegs relative to correct path
Fixes Homebrew/homebrew#16948.
This commit is contained in:
parent
c2fd7856d2
commit
e3068f631a
@ -202,7 +202,7 @@ end
|
|||||||
def check_for_broken_symlinks
|
def check_for_broken_symlinks
|
||||||
require 'keg'
|
require 'keg'
|
||||||
broken_symlinks = []
|
broken_symlinks = []
|
||||||
Keg::PRUNEABLE_DIRECTORIES.map { |d| HOMEBREW_PREFIX/d }.each do |d|
|
Keg::PRUNEABLE_DIRECTORIES.each do |d|
|
||||||
next unless d.directory?
|
next unless d.directory?
|
||||||
d.find do |pn|
|
d.find do |pn|
|
||||||
broken_symlinks << pn if pn.symlink? and pn.readlink.expand_path.to_s =~ /^#{HOMEBREW_PREFIX}/ and not pn.exist?
|
broken_symlinks << pn if pn.symlink? and pn.readlink.expand_path.to_s =~ /^#{HOMEBREW_PREFIX}/ and not pn.exist?
|
||||||
|
|||||||
@ -9,7 +9,7 @@ module Homebrew extend self
|
|||||||
$d = 0
|
$d = 0
|
||||||
dirs = []
|
dirs = []
|
||||||
|
|
||||||
Keg::PRUNEABLE_DIRECTORIES.map{ |d| HOMEBREW_PREFIX/d }.each do |path|
|
Keg::PRUNEABLE_DIRECTORIES.each do |path|
|
||||||
next unless path.directory?
|
next unless path.directory?
|
||||||
path.find do |path|
|
path.find do |path|
|
||||||
path.extend ObserverPathnameExtension
|
path.extend ObserverPathnameExtension
|
||||||
|
|||||||
@ -11,7 +11,9 @@ class Keg < Pathname
|
|||||||
LOCALEDIR_RX = /(locale|man)\/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?/
|
LOCALEDIR_RX = /(locale|man)\/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?/
|
||||||
INFOFILE_RX = %r[info/([^.].*?\.info|dir)$]
|
INFOFILE_RX = %r[info/([^.].*?\.info|dir)$]
|
||||||
TOP_LEVEL_DIRECTORIES = %w[bin etc include lib sbin share var Frameworks]
|
TOP_LEVEL_DIRECTORIES = %w[bin etc include lib sbin share var Frameworks]
|
||||||
PRUNEABLE_DIRECTORIES = %w[bin etc include lib sbin share Frameworks Library/LinkedKegs]
|
PRUNEABLE_DIRECTORIES = %w[bin etc include lib sbin share Frameworks LinkedKegs].map do |d|
|
||||||
|
case d when 'LinkedKegs' then HOMEBREW_LIBRARY/d else HOMEBREW_PREFIX/d end
|
||||||
|
end
|
||||||
|
|
||||||
# if path is a file in a keg then this will return the containing Keg object
|
# if path is a file in a keg then this will return the containing Keg object
|
||||||
def self.for path
|
def self.for path
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user