diff options
| author | Jack Nagel | 2013-02-10 15:26:07 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-02-10 15:26:07 -0600 |
| commit | 18ff8a67fb9a05c440af321baebc9c40d33a5522 (patch) | |
| tree | 3012260b9b9dc91c871c28c5dcaeb011f958b07d /Library | |
| parent | 9571b91744f9b54cd726396ee7e42791f34df11b (diff) | |
| download | homebrew-18ff8a67fb9a05c440af321baebc9c40d33a5522.tar.bz2 | |
Fix Regexp encoding under 1.9/2.0
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/sbcl.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 19 |
2 files changed, 9 insertions, 12 deletions
diff --git a/Library/Formula/sbcl.rb b/Library/Formula/sbcl.rb index 4e80d97b1..52356ed0d 100644 --- a/Library/Formula/sbcl.rb +++ b/Library/Formula/sbcl.rb @@ -59,7 +59,7 @@ class Sbcl < Formula # Remove non-ASCII values from environment as they cause build failures # More information: http://bugs.gentoo.org/show_bug.cgi?id=174702 ENV.delete_if do |key, value| - value =~ /[\x80-\xff]/ + value =~ /[\x80-\xff]/n end SbclBootstrapBinaries.new.brew do diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 7453f647b..dbed1cf22 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -179,18 +179,15 @@ class Pathname # Get enough of the file to detect common file types # POSIX tar magic has a 257 byte offset - magic_bytes = nil - File.open(self) { |f| magic_bytes = f.read(262) } - # magic numbers stolen from /usr/share/file/magic/ - case magic_bytes - when /^PK\003\004/ then :zip - when /^\037\213/ then :gzip - when /^BZh/ then :bzip2 - when /^\037\235/ then :compress - when /^.{257}ustar/ then :tar - when /^\xFD7zXZ\x00/ then :xz - when /^Rar!/ then :rar + case open { |f| f.read(262) } + when /^PK\003\004/n then :zip + when /^\037\213/n then :gzip + when /^BZh/n then :bzip2 + when /^\037\235/n then :compress + when /^.{257}ustar/n then :tar + when /^\xFD7zXZ\x00/n then :xz + when /^Rar!/n then :rar else # This code so that bad-tarballs and zips produce good error messages # when they don't unarchive properly. |
