aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-08-14 20:11:11 -0500
committerJack Nagel2013-08-14 20:11:11 -0500
commit12d321f6c628e16012f845043e4fd4c98129dba3 (patch)
tree030b3b820395019228f3e986f01520c001abd7b8 /Library
parent0b269c3af72d67c3582f96d833b99a09b5c71557 (diff)
downloadhomebrew-12d321f6c628e16012f845043e4fd4c98129dba3.tar.bz2
unpack: ensure $VERBOSE is restored
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/cmd/brew-unpack.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/Library/Contributions/cmd/brew-unpack.rb b/Library/Contributions/cmd/brew-unpack.rb
index f97ac5e7a..a61bf8164 100755
--- a/Library/Contributions/cmd/brew-unpack.rb
+++ b/Library/Contributions/cmd/brew-unpack.rb
@@ -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