download_strategy: style nits
This commit is contained in:
parent
c790a4f45e
commit
3d7de0065b
@ -161,10 +161,10 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def chdir
|
def chdir
|
||||||
entries=Dir['*']
|
entries = Dir['*']
|
||||||
case entries.length
|
case entries.length
|
||||||
when 0 then raise "Empty archive"
|
when 0 then raise "Empty archive"
|
||||||
when 1 then Dir.chdir entries.first rescue nil
|
when 1 then Dir.chdir entries.first rescue nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -331,9 +331,10 @@ class SubversionDownloadStrategy < AbstractDownloadStrategy
|
|||||||
@co.rmtree
|
@co.rmtree
|
||||||
end
|
end
|
||||||
|
|
||||||
if @ref_type == :revision
|
case @ref_type
|
||||||
|
when :revision
|
||||||
fetch_repo @co, @url, @ref
|
fetch_repo @co, @url, @ref
|
||||||
elsif @ref_type == :revisions
|
when :revisions
|
||||||
# nil is OK for main_revision, as fetch_repo will then get latest
|
# nil is OK for main_revision, as fetch_repo will then get latest
|
||||||
main_revision = @ref.delete :trunk
|
main_revision = @ref.delete :trunk
|
||||||
fetch_repo @co, @url, main_revision, true
|
fetch_repo @co, @url, main_revision, true
|
||||||
@ -429,7 +430,7 @@ class GitDownloadStrategy < AbstractDownloadStrategy
|
|||||||
|
|
||||||
if @clone.exist? && repo_valid?
|
if @clone.exist? && repo_valid?
|
||||||
puts "Updating #@clone"
|
puts "Updating #@clone"
|
||||||
Dir.chdir(@clone) do
|
@clone.cd do
|
||||||
config_repo
|
config_repo
|
||||||
update_repo
|
update_repo
|
||||||
checkout
|
checkout
|
||||||
@ -447,7 +448,7 @@ class GitDownloadStrategy < AbstractDownloadStrategy
|
|||||||
|
|
||||||
def stage
|
def stage
|
||||||
dst = Dir.getwd
|
dst = Dir.getwd
|
||||||
Dir.chdir @clone do
|
@clone.cd do
|
||||||
if @ref_type and @ref
|
if @ref_type and @ref
|
||||||
ohai "Checking out #@ref_type #@ref"
|
ohai "Checking out #@ref_type #@ref"
|
||||||
else
|
else
|
||||||
@ -579,13 +580,13 @@ class CVSDownloadStrategy < AbstractDownloadStrategy
|
|||||||
mod, url = split_url(@url)
|
mod, url = split_url(@url)
|
||||||
|
|
||||||
unless @co.exist?
|
unless @co.exist?
|
||||||
Dir.chdir HOMEBREW_CACHE do
|
HOMEBREW_CACHE.cd do
|
||||||
safe_system '/usr/bin/cvs', '-d', url, 'login'
|
safe_system '/usr/bin/cvs', '-d', url, 'login'
|
||||||
safe_system '/usr/bin/cvs', '-d', url, 'checkout', '-d', checkout_name("cvs"), mod
|
safe_system '/usr/bin/cvs', '-d', url, 'checkout', '-d', checkout_name("cvs"), mod
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
puts "Updating #{@co}"
|
puts "Updating #{@co}"
|
||||||
Dir.chdir(@co) { safe_system '/usr/bin/cvs', 'up' }
|
@co.cd { safe_system '/usr/bin/cvs', 'up' }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -654,8 +655,8 @@ class MercurialDownloadStrategy < AbstractDownloadStrategy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def stage
|
def stage
|
||||||
dst=Dir.getwd
|
dst = Dir.getwd
|
||||||
Dir.chdir @clone do
|
@clone.cd do
|
||||||
if @ref_type and @ref
|
if @ref_type and @ref
|
||||||
ohai "Checking out #{@ref_type} #{@ref}"
|
ohai "Checking out #{@ref_type} #{@ref}"
|
||||||
safe_system hgpath, 'archive', '--subrepos', '-y', '-r', @ref, '-t', 'files', dst
|
safe_system hgpath, 'archive', '--subrepos', '-y', '-r', @ref, '-t', 'files', dst
|
||||||
|
Loading…
x
Reference in New Issue
Block a user