Update comment (and spacing) in download_strategy.
This commit is contained in:
parent
d0d0ca0572
commit
02208387c2
@ -52,6 +52,7 @@ class CurlDownloadStrategy <AbstractDownloadStrategy
|
||||
end
|
||||
return @dl # thus performs checksum verification
|
||||
end
|
||||
|
||||
def stage
|
||||
# magic numbers stolen from /usr/share/file/magic/
|
||||
File.open(@dl) do |f|
|
||||
@ -74,6 +75,7 @@ class CurlDownloadStrategy <AbstractDownloadStrategy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def chdir
|
||||
entries=Dir['*']
|
||||
@ -82,6 +84,7 @@ private
|
||||
when 1 then Dir.chdir entries.first rescue nil
|
||||
end
|
||||
end
|
||||
|
||||
def ext
|
||||
# GitHub uses odd URLs for zip files, so check for those
|
||||
rx=%r[http://(www\.)?github\.com/.*/(zip|tar)ball/]
|
||||
@ -118,6 +121,7 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy
|
||||
puts "Repository already checked out"
|
||||
end
|
||||
end
|
||||
|
||||
def stage
|
||||
# Force the export, since the target directory will already exist
|
||||
args = [svn, 'export', '--force', @co, Dir.pwd]
|
||||
@ -126,7 +130,9 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy
|
||||
safe_system *args
|
||||
end
|
||||
|
||||
# currently only used by mplayer.rb
|
||||
# Override this method in a DownloadStrategy to force the use of a non-
|
||||
# sysetm svn binary. mplayer.rb uses this to require a svn that
|
||||
# understands externals.
|
||||
def svn
|
||||
'/usr/bin/svn'
|
||||
end
|
||||
@ -143,6 +149,7 @@ class GitDownloadStrategy <AbstractDownloadStrategy
|
||||
puts "Repository already cloned to #{@clone}"
|
||||
end
|
||||
end
|
||||
|
||||
def stage
|
||||
dst = Dir.getwd
|
||||
Dir.chdir @clone do
|
||||
@ -187,7 +194,6 @@ class CVSDownloadStrategy <AbstractDownloadStrategy
|
||||
FileUtils.cp_r(Dir[HOMEBREW_CACHE+@unique_token+"*"], Dir.pwd)
|
||||
|
||||
require 'find'
|
||||
|
||||
Find.find(Dir.pwd) do |path|
|
||||
if FileTest.directory?(path) && File.basename(path) == "CVS"
|
||||
Find.prune
|
||||
@ -230,6 +236,7 @@ class MercurialDownloadStrategy <AbstractDownloadStrategy
|
||||
puts "Repository already cloned"
|
||||
end
|
||||
end
|
||||
|
||||
def stage
|
||||
dst=Dir.getwd
|
||||
Dir.chdir @clone do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user