Class: BazaarDownloadStrategy

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

Constant Summary

Constants inherited from VCSDownloadStrategy

VCSDownloadStrategy::REF_TYPES

Instance Attribute Summary

Attributes inherited from AbstractDownloadStrategy

#cached_location, #meta, #name, #resource, #shutup, #version

Instance Method Summary collapse

Methods inherited from VCSDownloadStrategy

#cached_location, #commit_outdated?, #fetch, #fetch_last_commit

Methods inherited from AbstractDownloadStrategy

#clear_cache, #expand_safe_system_args, #fetch, #ohai, #puts, #quiet_safe_system, #safe_system, #shutup!

Methods included from FileUtils

#make, mkdir, mktemp, #old_mkdir, #old_ruby, #ruby, #scons, #xcodebuild

Constructor Details

#initialize(name, resource) ⇒ BazaarDownloadStrategy

Returns a new instance of BazaarDownloadStrategy



1035
1036
1037
1038
# File 'Library/Homebrew/download_strategy.rb', line 1035

def initialize(name, resource)
  super
  @url = @url.sub(%r{^bzr://}, "")
end

Instance Method Details

#last_commitObject



1051
1052
1053
# File 'Library/Homebrew/download_strategy.rb', line 1051

def last_commit
  Utils.popen_read("bzr", "revno", cached_location.to_s).chomp
end

#source_modified_timeObject



1047
1048
1049
# File 'Library/Homebrew/download_strategy.rb', line 1047

def source_modified_time
  Time.parse Utils.popen_read("bzr", "log", "-l", "1", "--timezone=utc", cached_location.to_s)[/^timestamp: (.+)$/, 1]
end

#stageObject



1040
1041
1042
1043
1044
1045
# File 'Library/Homebrew/download_strategy.rb', line 1040

def stage
  # The export command doesn't work on checkouts
  # See https://bugs.launchpad.net/bzr/+bug/897511
  cp_r File.join(cached_location, "."), Dir.pwd, preserve: true
  rm_r ".bzr"
end