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
commitb408b192083d58e57491fbd4b0121c22173ed6dc (patch)
treee382741ea839642ad30d164ac9e56dfd7b850f4f /Library
parenta7a35efff4369122db9fa0cb10332303ca0f81ad (diff)
downloadbrew-b408b192083d58e57491fbd4b0121c22173ed6dc.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