aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2012-04-24 18:10:08 +1000
committerMike McQuaid2012-04-24 18:10:08 +1000
commit4138d30428be9028cd223313631587187fc7d276 (patch)
tree4fc88b17433eb10e61b45e115b627e2b976bd07d /Library
parent47b2eedddc8cd6844b63953277602ddfa272cd50 (diff)
downloadbrew-4138d30428be9028cd223313631587187fc7d276.tar.bz2
Revert "Change versioned bottle syntax and fix issues."
This reverts commit f80908bead8b620ebcc5cdde9de65e70598002b6.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/bottles.rb20
-rw-r--r--Library/Homebrew/download_strategy.rb2
-rw-r--r--Library/Homebrew/extend/pathname.rb1
-rw-r--r--Library/Homebrew/test/test_versions.rb19
4 files changed, 13 insertions, 29 deletions
diff --git a/Library/Homebrew/bottles.rb b/Library/Homebrew/bottles.rb
index 2b796aabf..739f601c5 100644
--- a/Library/Homebrew/bottles.rb
+++ b/Library/Homebrew/bottles.rb
@@ -5,7 +5,8 @@ def bottle_filename f, bottle_version=nil
name = f.name.downcase
version = f.version || f.standard.detect_version
bottle_version = bottle_version || f.bottle_version
- "#{name}-#{version}#{bottle_native_suffix(bottle_version)}"
+ bottle_version_tag = bottle_version > 0 ? "-#{bottle_version}" : ""
+ "#{name}-#{version}#{bottle_version_tag}#{bottle_native_suffix}"
end
def bottles_supported?
@@ -14,7 +15,7 @@ end
def install_bottle? f
return true if ARGV.include? '--install-bottle'
- not ARGV.build_from_source? && bottle_current?(f)
+ !ARGV.build_from_source? && bottle_current?(f)
end
def built_bottle? f
@@ -30,25 +31,24 @@ def bottle_new_version f
f.bottle_version + 1
end
-def bottle_native_suffix version=nil
- ".#{MacOS.cat}#{bottle_suffix(version)}"
+def bottle_native_suffix
+ ".#{MacOS.cat}#{bottle_suffix}"
end
-def bottle_suffix version=nil
- version = version.to_i > 0 ? ".#{version}" : ""
- ".bottle#{version}.tar.gz"
+def bottle_suffix
+ ".bottle.tar.gz"
end
def bottle_native_regex
- /(\.#{MacOS.cat}\.bottle\.((\d+)?\.tar\.gz))$/
+ /((-\d+)?\.#{MacOS.cat}\.bottle\.tar\.gz)$/
end
def bottle_regex
- /(\.[a-z]+\.bottle\.(\d+\.)?tar\.gz)$/
+ /((-\d+)?\.[a-z]+\.bottle\.tar\.gz)$/
end
def old_bottle_regex
- /((\.[a-z]+)?[\.-]bottle\.tar\.gz)$/
+ /(-bottle\.tar\.gz)$/
end
def bottle_base_url
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 3a68a2541..4c510db99 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -194,10 +194,8 @@ class CurlBottleDownloadStrategy < CurlDownloadStrategy
@tarball_path = HOMEBREW_CACHE/"#{name}-#{version}#{ext}"
unless @tarball_path.exist?
- # Stop people redownloading bottles just because I (Mike) was stupid.
old_bottle_path = HOMEBREW_CACHE/"#{name}-#{version}-bottle.tar.gz"
old_bottle_path = HOMEBREW_CACHE/"#{name}-#{version}.#{MacOS.cat}.bottle-bottle.tar.gz" unless old_bottle_path.exist?
- old_bottle_path = HOMEBREW_CACHE/"#{name}-#{version}-7.#{MacOS.cat}.bottle.tar.gz" unless old_bottle_path.exist? or name != "imagemagick"
FileUtils.mv old_bottle_path, @tarball_path if old_bottle_path.exist?
end
end
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index caf081f60..82202ce5a 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -119,6 +119,7 @@ class Pathname
# extended to support common double extensions
def extname
return $1 if to_s =~ bottle_regex
+ # old brew bottle style
return $1 if to_s =~ old_bottle_regex
/(\.(tar|cpio)\.(gz|bz2|xz|Z))$/.match to_s
return $1 if $1
diff --git a/Library/Homebrew/test/test_versions.rb b/Library/Homebrew/test/test_versions.rb
index 4c9b70045..44058b70a 100644
--- a/Library/Homebrew/test/test_versions.rb
+++ b/Library/Homebrew/test/test_versions.rb
@@ -169,11 +169,6 @@ class VersionTests < Test::Unit::TestCase
'4.8.0'
end
- def test_versioned_bottle_style
- check 'https://downloads.sf.net/project/machomebrew/Bottles/qt-4.8.1.lion.bottle.1.tar.gz',
- '4.8.1'
- end
-
def test_erlang_bottle_style
check 'https://downloads.sf.net/project/machomebrew/Bottles/erlang-R15B.lion.bottle.tar.gz',
'R15B'
@@ -189,19 +184,9 @@ class VersionTests < Test::Unit::TestCase
'R15B'
end
- def test_imagemagick_style
- check 'http://downloads.sf.net/project/machomebrew/mirror/ImageMagick-6.7.5-7.tar.bz2',
- '6.7.5-7'
- end
-
def test_imagemagick_bottle_style
- check 'https://downloads.sf.net/project/machomebrew/Bottles/imagemagick-6.7.5-7.lion.bottle.tar.gz',
- '6.7.5-7'
- end
-
- def test_imagemagick_versioned_bottle_style
- check 'https://downloads.sf.net/project/machomebrew/Bottles/imagemagick-6.7.5-7.lion.bottle.1.tar.gz',
- '6.7.5-7'
+ check 'http://downloads.sf.net/project/machomebrew/Bottles/imagemagick-6.7.1-1-bottle.tar.gz',
+ '6.7.1-1'
end
def test_dash_version_dash_style