class Drupid::DownloadStrategy::Subversion
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 349 def initialize url, dest, name, download_specs = {} 350 super 351 @co = @dest + @name 352 end
Public Instance Methods
fetch()
click to toggle source
# File lib/drupid/download_strategy.rb 354 def fetch 355 @url.sub!(/^svn\+/, '') if @url =~ %r[^svn\+http://] 356 blah "Checking out #{@url}" 357 if @specs.has_key?('revision') 358 fetch_repo @co, @url, @specs['revision'] 359 # elsif @specs.has_key?('revisions') 360 # # nil is OK for main_revision, as fetch_repo will then get latest 361 # main_revision = @ref.delete :trunk 362 # fetch_repo @co, @url, main_revision, true 363 # 364 # get_externals do |external_name, external_url| 365 # fetch_repo @co+external_name, external_url, @ref[external_name], true 366 # end 367 else 368 fetch_repo @co, @url 369 end 370 end
fetch_repo(target, url, revision=nil, ignore_externals=false)
click to toggle source
# File lib/drupid/download_strategy.rb 388 def fetch_repo target, url, revision=nil, ignore_externals=false 389 # Use "svn up" when the repository already exists locally. 390 # This saves on bandwidth and will have a similar effect to verifying the 391 # cache as it will make any changes to get the right revision. 392 svncommand = target.exist? ? 'up' : 'checkout' 393 args = [svncommand] 394 args << '--non-interactive' unless @specs.has_key?('interactive') and 'true' == @specs.has_key?('interactive') 395 args << '--trust-server-cert' 396 # SVN shipped with XCode 3.1.4 can't force a checkout. 397 #args << '--force' unless MacOS.leopard? and svn == '/usr/bin/svn' 398 args << url if !target.exist? 399 args << target 400 args << '-r' << revision if revision 401 args << '--ignore-externals' if ignore_externals 402 svn(*args) 403 end
get_externals() { |name, url| ... }
click to toggle source
# File lib/drupid/download_strategy.rb 380 def get_externals 381 output = svn 'propget', 'svn:externals', @url 382 output.chomp.each_line do |line| 383 name, url = line.split(/\s+/) 384 yield name, url 385 end 386 end
stage(wd = @dest)
click to toggle source
# File lib/drupid/download_strategy.rb 372 def stage wd = @dest 373 fetch unless @co.exist? 374 dont_debug { wd.mkpath } 375 debug "Staging into #{wd}" 376 target = wd + @co.basename 377 svn 'export', '--force', @co, target 378 end