class Drupid::DownloadStrategy::Bazaar

Public Class Methods

new(url, dest, name, download_specs = {}) click to toggle source
Calls superclass method Drupid::DownloadStrategy::Base::new
    # File lib/drupid/download_strategy.rb
500 def initialize  url, dest, name, download_specs = {}
501   super
502   @clone = @dest + @name
503 end

Public Instance Methods

fetch() click to toggle source
    # File lib/drupid/download_strategy.rb
505 def fetch
506   blah "Cloning #{@url}"
507   unless @clone.exist?
508     url=@url.sub(%r[^bzr://], '')
509     # 'lightweight' means history-less
510     bzr 'checkout', '--lightweight', url, @clone
511   else
512     blah "Updating #{@clone}"
513     Dir.chdir(@clone) { bzr 'update' }
514   end
515 end
stage() click to toggle source
    # File lib/drupid/download_strategy.rb
517 def stage
518   # FIXME: The export command doesn't work on checkouts
519   # See https://bugs.launchpad.net/bzr/+bug/897511
520   FileUtils.cp_r Dir[(@clone+"{.}").to_s], Dir.pwd
521   FileUtils.rm_r Dir[Dir.pwd+"/.bzr"]
522     
523   #dst=Dir.getwd
524   #Dir.chdir @clone do
525   #  if @spec and @ref
526   #    ohai "Checking out #{@spec} #{@ref}"
527   #    Dir.chdir @clone do
528   #      safe_system 'bzr', 'export', '-r', @ref, dst
529   #    end
530   #  else
531   #    safe_system 'bzr', 'export', dst
532   #  end
533   #end
534 end