aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2010-07-06 13:12:29 -0700
committerAdam Vandenberg2010-07-06 13:17:50 -0700
commiteab7053dda2afdc2e277a46b04fe7ad27ddd0533 (patch)
tree858d480ca2545cbe2f43d099c2818f9b8fac4d05
parentfe2014feb7023ac4e684d7f3a43f6abbfc033738 (diff)
downloadhomebrew-eab7053dda2afdc2e277a46b04fe7ad27ddd0533.tar.bz2
Add debian style names to version checker.
-rw-r--r--Library/Homebrew/extend/pathname.rb4
-rw-r--r--Library/Homebrew/test/test_versions.rb10
2 files changed, 14 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 4cda5697d..78734677a 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -146,6 +146,10 @@ class Pathname
/-((\d+\.)+\d+[abc]?)[-.](bin|stable|src|sources?)$/.match stem
return $1 if $1
+ # Debian style eg dash_0.5.5.1.orig.tar.gz
+ /_((\d+\.)+\d+[abc]?)[.]orig$/.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|
diff --git a/Library/Homebrew/test/test_versions.rb b/Library/Homebrew/test/test_versions.rb
index 2930276ef..c726d2596 100644
--- a/Library/Homebrew/test/test_versions.rb
+++ b/Library/Homebrew/test/test_versions.rb
@@ -140,4 +140,14 @@ class VersionTests < Test::Unit::TestCase
check 'http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz',
'1.4.14b'
end
+
+ def test_debian_style_1
+ check 'http://ftp.de.debian.org/debian/pool/main/s/sl/sl_3.03.orig.tar.gz',
+ '3.03'
+ end
+
+ def test_debian_style_2
+ check 'http://ftp.de.debian.org/debian/pool/main/m/mmv/mmv_1.01b.orig.tar.gz',
+ '1.01b'
+ end
end