Class: BazaarDownloadStrategy

Inherits:
VCSDownloadStrategy show all
Defined in:
brew/Library/Homebrew/download_strategy.rb

Constant Summary

Constants inherited from VCSDownloadStrategy

VCSDownloadStrategy::REF_TYPES

Instance Attribute Summary

Attributes inherited from AbstractDownloadStrategy

#cache, #cached_location, #url

Instance Method Summary collapse

Methods inherited from VCSDownloadStrategy

#commit_outdated?, #fetch, #fetch_last_commit, #head?

Methods inherited from AbstractDownloadStrategy

#basename, #clear_cache, #fetch, #ohai, #puts, #shutup!, #stage

Constructor Details

#initialize(url, name, version, **meta) ⇒ BazaarDownloadStrategy

Returns a new instance of BazaarDownloadStrategy



974
975
976
977
# File 'brew/Library/Homebrew/download_strategy.rb', line 974

def initialize(url, name, version, **meta)
  super
  @url.sub!(%r{^bzr://}, "")
end

Instance Method Details

#last_commitObject



987
988
989
990
# File 'brew/Library/Homebrew/download_strategy.rb', line 987

def last_commit
  out, = system_command("bzr", args: ["revno", cached_location])
  out.chomp
end

#source_modified_timeObject



979
980
981
982
983
984
985
# File 'brew/Library/Homebrew/download_strategy.rb', line 979

def source_modified_time
  out, = system_command("bzr", args: ["log", "-l", "1", "--timezone=utc", cached_location])
  timestamp = out.chomp
  raise "Could not get any timestamps from bzr!" if timestamp.blank?

  Time.parse(timestamp)
end