From 32b7c9ff150c0b4bbabd75a73840a14f4ba64f80 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 29 Apr 2014 15:40:37 -0500 Subject: [PATCH] unpack: use correct constant scope for DATA Formula::DATA only worked by accident of implementation; DATA during the build is actually Object::DATA, so we should mirror that here. This reverts commit b12444ba6e1ac1d596a70ff4c777d9386d0791ac. --- Library/Contributions/cmd/brew-unpack.rb | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Library/Contributions/cmd/brew-unpack.rb b/Library/Contributions/cmd/brew-unpack.rb index b5023f1a25..4ff19b0e16 100755 --- a/Library/Contributions/cmd/brew-unpack.rb +++ b/Library/Contributions/cmd/brew-unpack.rb @@ -28,22 +28,13 @@ module UnpackPatch return unless ARGV.flag? "--patch" begin - # Silence complaints about re-setting constants. old_verbose = $VERBOSE $VERBOSE = nil - Formula.const_set "DATA", ScriptDataReader.load(path) + Object.const_set "DATA", ScriptDataReader.load(path) ensure $VERBOSE = old_verbose end - # Legacy patches are fixed by setting Formula::DATA. - # Now, handle instances of IOPatch. - patchlist.select{|p| p.is_a? IOPatch}.each do |patch| - if patch.instance_variable_get(:@io) == :DATA - patch.instance_variable_set :@io, ScriptDataReader.load(path) - end - end - super end end