ObserverPathnameExtension: only puts first 100 operations
Fixes https://github.com/Homebrew/homebrew/issues/44320#issuecomment-143951973 Closes Homebrew/homebrew#44440. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
ee332c4550
commit
235c5b6bfa
@ -473,6 +473,7 @@ module ObserverPathnameExtension
|
|||||||
|
|
||||||
def reset_counts!
|
def reset_counts!
|
||||||
@n = @d = 0
|
@n = @d = 0
|
||||||
|
@put_verbose_trimmed_warning = false
|
||||||
end
|
end
|
||||||
|
|
||||||
def total
|
def total
|
||||||
@ -482,33 +483,50 @@ module ObserverPathnameExtension
|
|||||||
def counts
|
def counts
|
||||||
[n, d]
|
[n, d]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
MAXIMUM_VERBOSE_OUTPUT = 100
|
||||||
|
|
||||||
|
def verbose?
|
||||||
|
return ARGV.verbose? unless ENV["TRAVIS"]
|
||||||
|
return false unless ARGV.verbose?
|
||||||
|
|
||||||
|
if total < MAXIMUM_VERBOSE_OUTPUT
|
||||||
|
true
|
||||||
|
else
|
||||||
|
unless @put_verbose_trimmed_warning
|
||||||
|
puts "Only the first #{MAXIMUM_VERBOSE_OUTPUT} operations were output."
|
||||||
|
@put_verbose_trimmed_warning = true
|
||||||
|
end
|
||||||
|
false
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def unlink
|
def unlink
|
||||||
super
|
super
|
||||||
puts "rm #{self}" if ARGV.verbose?
|
puts "rm #{self}" if ObserverPathnameExtension.verbose?
|
||||||
ObserverPathnameExtension.n += 1
|
ObserverPathnameExtension.n += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
def rmdir
|
def rmdir
|
||||||
super
|
super
|
||||||
puts "rmdir #{self}" if ARGV.verbose?
|
puts "rmdir #{self}" if ObserverPathnameExtension.verbose?
|
||||||
ObserverPathnameExtension.d += 1
|
ObserverPathnameExtension.d += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
def make_relative_symlink(src)
|
def make_relative_symlink(src)
|
||||||
super
|
super
|
||||||
puts "ln -s #{src.relative_path_from(dirname)} #{basename}" if ARGV.verbose?
|
puts "ln -s #{src.relative_path_from(dirname)} #{basename}" if ObserverPathnameExtension.verbose?
|
||||||
ObserverPathnameExtension.n += 1
|
ObserverPathnameExtension.n += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
def install_info
|
def install_info
|
||||||
super
|
super
|
||||||
puts "info #{self}" if ARGV.verbose?
|
puts "info #{self}" if ObserverPathnameExtension.verbose?
|
||||||
end
|
end
|
||||||
|
|
||||||
def uninstall_info
|
def uninstall_info
|
||||||
super
|
super
|
||||||
puts "uninfo #{self}" if ARGV.verbose?
|
puts "uninfo #{self}" if ObserverPathnameExtension.verbose?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user