unpack: ensure $VERBOSE is restored

This commit is contained in:
Jack Nagel 2013-08-14 20:11:11 -05:00
parent a7a35efff4
commit b408b19208

View File

@ -34,10 +34,13 @@ class Formula
alias do_patch patch
def patch
if ARGV.flag? '--patch'
# Yes Ruby, we are about to redefine a constant. Just breathe.
orig_v = $VERBOSE; $VERBOSE = nil
Formula.const_set 'DATA', ScriptDataReader.load(path)
$VERBOSE = orig_v
begin
old_verbose = $VERBOSE
$VERBOSE = nil
Formula.const_set 'DATA', ScriptDataReader.load(path)
ensure
$VERBOSE = old_verbose
end
do_patch
end