aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/pathname.rb4
-rw-r--r--Library/Homebrew/test/test_bucket.rb5
2 files changed, 7 insertions, 2 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 018547ff8..a83ef31af 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -62,9 +62,9 @@ class Pathname
return dst
end
- # extended to support the double extensions .tar.gz, .tar.bz2, and .tar.xz
+ # extended to support common double extensions
def extname
- /(\.tar\.(gz|bz2|xz))$/.match to_s
+ /(\.(tar|cpio)\.(gz|bz2|xz))$/.match to_s
return $1 if $1
return File.extname(to_s)
end
diff --git a/Library/Homebrew/test/test_bucket.rb b/Library/Homebrew/test/test_bucket.rb
index f328dacca..fda9f356f 100644
--- a/Library/Homebrew/test/test_bucket.rb
+++ b/Library/Homebrew/test/test_bucket.rb
@@ -180,6 +180,11 @@ class BeerTasting < Test::Unit::TestCase
assert_equal '.tar.gz', foo1.extname
assert_equal 'foo-0.1', foo1.stem
assert_equal '0.1', foo1.version
+
+ foo1 = HOMEBREW_CACHE/'foo-0.1.cpio.gz'
+ assert_equal '.cpio.gz', foo1.extname
+ assert_equal 'foo-0.1', foo1.stem
+ assert_equal '0.1', foo1.version
end
class MockMockFormula < Struct.new(:name); end