aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/pathname.rb
diff options
context:
space:
mode:
authorMike McQuaid2012-03-07 20:44:19 -0500
committerMike McQuaid2012-03-10 18:09:35 +1300
commit4a306f32f468a0dfb1cd0faad861b3773babfa33 (patch)
treef9ba847c6b4bc1b1d8ff4247a625df10d8c6b1db /Library/Homebrew/extend/pathname.rb
parent22f908d5206bbc4184ec7686593f1f04b9c9ff2f (diff)
downloadbrew-4a306f32f468a0dfb1cd0faad861b3773babfa33.tar.bz2
Support bottles for non-Lion OSX versions.
Diffstat (limited to 'Library/Homebrew/extend/pathname.rb')
-rw-r--r--Library/Homebrew/extend/pathname.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 6d45d0b77..f05fc9f5f 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -100,7 +100,9 @@ class Pathname
# extended to support common double extensions
def extname
- return $1 if to_s =~ /(\.bottle\.tar\.gz)$/
+ return $1 if to_s =~ /(\.[a-z]+\.bottle\.tar\.gz)$/
+ # old brew bottle style
+ return $1 if to_s =~ /(-bottle\.tar\.gz)$/
/(\.(tar|cpio)\.(gz|bz2|xz|Z))$/.match to_s
return $1 if $1
return File.extname(to_s)
@@ -205,19 +207,14 @@ class Pathname
/_((\d+\.)+\d+[abc]?)[.]orig$/.match stem
return $1 if $1
- # brew bottle style e.g. qt-4.7.3-bottle.tar.gz
- /-((\d+\.)*\d+(-\d)*)-bottle$/.match stem
- return $1 if $1
-
# eg. otp_src_R13B (this is erlang's style)
# eg. astyle_1.23_macosx.tar.gz
stem.scan(/_([^_]+)/) do |match|
return match.first if /\d/.match $1
end
- # erlang bottle style, booya
- # e.g. erlang-R14B03-bottle.tar.gz
- /-([^-]+)-bottle$/.match stem
+ # old erlang bottle style e.g. erlang-R14B03-bottle.tar.gz
+ /-([^-]+)/.match stem
return $1 if $1
nil