diff options
| -rw-r--r-- | Library/Homebrew/bottles.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/bottle.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 9 |
3 files changed, 10 insertions, 5 deletions
diff --git a/Library/Homebrew/bottles.rb b/Library/Homebrew/bottles.rb index b1638286a..454fb02b0 100644 --- a/Library/Homebrew/bottles.rb +++ b/Library/Homebrew/bottles.rb @@ -6,7 +6,7 @@ require 'bottle_version' def bottle_filename f, options={} options = { :tag => bottle_tag }.merge(options) name = f.name.downcase - version = f.stable.version + version = PkgVersion.new(f.stable.version, f.revision) options[:revision] ||= f.bottle.revision.to_i if f.bottle "#{name}-#{version}#{bottle_native_suffix(options)}" end diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb index de4c7da96..5d09164e2 100644 --- a/Library/Homebrew/cmd/bottle.rb +++ b/Library/Homebrew/cmd/bottle.rb @@ -115,7 +115,7 @@ module Homebrew extend self if ARGV.include? '--no-revision' bottle_revision = 0 else - max = f.bottle_version_map('origin/master')[f.version].max + max = f.bottle_version_map('origin/master')[f.pkg_version].max bottle_revision = max ? max + 1 : 0 end @@ -143,7 +143,7 @@ module Homebrew extend self HOMEBREW_CELLAR.cd do # Use gzip, faster to compress than bzip2, faster to uncompress than bzip2 # or an uncompressed tarball (and more bandwidth friendly). - safe_system 'tar', 'czf', bottle_path, "#{f.name}/#{f.version}" + safe_system 'tar', 'czf', bottle_path, "#{f.name}/#{f.pkg_version}" end if File.size?(bottle_path) > 1*1024*1024 diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 07fcc5a67..6b057dcaa 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -49,14 +49,19 @@ class Formula unless bottle.checksum.nil? || bottle.checksum.empty? @bottle = bottle bottle.url ||= bottle_url(self, bottle.current_tag) - bottle.version = stable.version + bottle.version = PkgVersion.new(stable.version, revision) end end @active_spec = determine_active_spec validate_attributes :url, :name, :version @build = determine_build_options - @pkg_version = PkgVersion.new(version, revision) + + # TODO: @pkg_version is already set for bottles, since constructing it + # requires passing in the active_spec version. This should be fixed by + # making the bottle an attribute of SoftwareSpec rather than a separate + # spec itself. + @pkg_version = PkgVersion.new(version, revision) unless active_spec == bottle @pin = FormulaPin.new(self) |
