aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/brewkit.rb
diff options
context:
space:
mode:
authorMax Howell2009-06-15 00:54:58 +0100
committerMax Howell2009-06-15 00:54:58 +0100
commitb3b78eceeb53bb84402507d65308ca5bf30afb24 (patch)
tree6c9a14ce5c16e33594a5c4488557b54408ac61a1 /Library/Homebrew/brewkit.rb
parent92154225dc6b821caadc129625f2d887c5fef352 (diff)
downloadbrew-b3b78eceeb53bb84402507d65308ca5bf30afb24.tar.bz2
Test for astyle versioning
Diffstat (limited to 'Library/Homebrew/brewkit.rb')
-rw-r--r--Library/Homebrew/brewkit.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb
index 1bd250e77..d0a59b888 100644
--- a/Library/Homebrew/brewkit.rb
+++ b/Library/Homebrew/brewkit.rb
@@ -77,9 +77,11 @@ def extract_version basename
/((\d+\.)*\d+)$/.match basename
return $1 if $1
- # eg. (erlang) otp_src_R13B
- /^.*[-_.](.*)$/.match basename
- return $1 if $1
+ # eg. otp_src_R13B (this is erlang's style)
+ # eg. astyle_1.23_macosx.tar.gz
+ basename.scan /_([^_]+)/ do |match|
+ return match.first if /\d/.match $1
+ end
end