Always keep info files

Closes Homebrew/homebrew#26659.
This commit is contained in:
Adam Vandenberg 2014-02-22 09:20:09 -08:00
parent 311dd6f5e8
commit bb5a2b587e
3 changed files with 8 additions and 12 deletions

View File

@ -13,15 +13,11 @@ class Cleaner
@f = f
[f.bin, f.sbin, f.lib].select{ |d| d.exist? }.each{ |d| clean_dir d }
if ENV['HOMEBREW_KEEP_INFO']
# Get rid of the directory file, so it no longer bother us at link stage.
info_dir_file = f.info + 'dir'
if info_dir_file.file? and not f.skip_clean? info_dir_file
puts "rm #{info_dir_file}" if ARGV.verbose?
info_dir_file.unlink
end
else
f.info.rmtree if f.info.directory? and not f.skip_clean? f.info
# Get rid of the directory file, so it no longer bother us at link stage.
info_dir_file = f.info + 'dir'
if info_dir_file.file? and not f.skip_clean? info_dir_file
puts "rm #{info_dir_file}" if ARGV.verbose?
info_dir_file.unlink
end
prune

View File

@ -12,7 +12,7 @@ module Homebrew extend self
path.extend(ObserverPathnameExtension)
if path.symlink?
unless path.resolved_path_exists?
if ENV['HOMEBREW_KEEP_INFO'] and path.to_s =~ Keg::INFOFILE_RX
if path.to_s =~ Keg::INFOFILE_RX
path.uninstall_info unless ARGV.dry_run?
end

View File

@ -49,7 +49,7 @@ class Keg < Pathname
# check whether the file to be unlinked is from the current keg first
next if !dst.symlink? || !dst.exist? || src != dst.resolved_path
dst.uninstall_info if dst.to_s =~ INFOFILE_RX and ENV['HOMEBREW_KEEP_INFO']
dst.uninstall_info if dst.to_s =~ INFOFILE_RX
dst.unlink
Find.prune if src.directory?
end
@ -130,7 +130,7 @@ class Keg < Pathname
link_dir('share', mode) do |path|
case path.to_s
when 'locale/locale.alias' then :skip_file
when INFOFILE_RX then ENV['HOMEBREW_KEEP_INFO'] ? :info : :skip_file
when INFOFILE_RX then :info
when LOCALEDIR_RX then :mkpath
when *share_mkpaths then :mkpath
when /^icons\/.*\/icon-theme\.cache$/ then :skip_file