aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/pathname.rb7
-rw-r--r--Library/Homebrew/test/test_versions.rb5
2 files changed, 11 insertions, 1 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 5534cd752..1436e2e8e 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -105,7 +105,12 @@ class Pathname
# directories don't have extnames
stem=basename.to_s
else
- stem=self.stem
+ # sourceforge /download
+ if %r[((?:sourceforge.net|sf.net)/.*)/download$].match to_s
+ stem=Pathname.new(dirname).stem
+ else
+ stem=self.stem
+ end
end
# github tarballs, like v1.2.3
diff --git a/Library/Homebrew/test/test_versions.rb b/Library/Homebrew/test/test_versions.rb
index 8010cf1c5..5e8783232 100644
--- a/Library/Homebrew/test/test_versions.rb
+++ b/Library/Homebrew/test/test_versions.rb
@@ -98,6 +98,11 @@ class VersionTests < Test::Unit::TestCase
check "http://example.com/foo_bar-1.21.tar.gz", '1.21'
end
+ def test_version_sourceforge_download
+ check "http://sourceforge.net/foo_bar-1.21.tar.gz/download", '1.21'
+ check "http://sf.net/foo_bar-1.21.tar.gz/download", '1.21'
+ end
+
def test_version_github
check "http://github.com/lloyd/yajl/tarball/1.0.5", '1.0.5'
end