Merge pull request #8339 from rolandwalker/remove_homebrew_download_stage

remove homebrew-fork staging logic
This commit is contained in:
Roland Walker 2014-12-20 15:56:04 -05:00
commit 8b7936ff41
2 changed files with 0 additions and 71 deletions

View file

@ -30,7 +30,6 @@ class AbstractDownloadStrategy
# All download strategies are expected to implement these methods
def fetch; end
def stage; end
def cached_location; end
def clear_cache; end
end
@ -146,37 +145,6 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
end
end
def stage
case tarball_path.compression_type
when :zip
with_system_path { quiet_safe_system 'unzip', {:quiet_flag => '-qq'}, tarball_path }
chdir
when :gzip_only
with_system_path { buffered_write("gunzip") }
when :bzip2_only
with_system_path { buffered_write("bunzip2") }
when :gzip, :bzip2, :compress, :tar
# Assume these are also tarred
# TODO check if it's really a tar archive
with_system_path { safe_system 'tar', 'xf', tarball_path }
chdir
when :xz
with_system_path { safe_system "#{xzpath} -dc \"#{tarball_path}\" | tar xf -" }
chdir
when :lzip
with_system_path { safe_system "#{lzippath} -dc \"#{tarball_path}\" | tar xf -" }
chdir
when :xar
safe_system "/usr/bin/xar", "-xf", tarball_path
when :rar
quiet_safe_system 'unrar', 'x', {:quiet_flag => '-inul'}, tarball_path
when :p7zip
safe_system '7zr', 'x', tarball_path
else
FileUtils.cp tarball_path, basename_without_params
end
end
private
def curl(*args)
@ -184,14 +152,6 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
super
end
def xzpath
"#{HOMEBREW_PREFIX}/opt/xz/bin/xz"
end
def lzippath
"#{HOMEBREW_PREFIX}/opt/lzip/bin/lzip"
end
def chdir
entries = Dir['*']
case entries.length
@ -264,10 +224,6 @@ class SubversionDownloadStrategy < VCSDownloadStrategy
end
end
def stage
quiet_safe_system 'svn', 'export', '--force', @clone, Dir.pwd
end
def shell_quote str
# Oh god escaping shell args.
# See http://notetoself.vrensk.com/2008/08/escaping-single-quotes-in-ruby-harder-than-expected/

View file

@ -70,27 +70,6 @@ class Resource
downloader.clear_cache
end
# Fetch, verify, and unpack the resource
def stage(target=nil, &block)
verify_download_integrity(fetch)
unpack(target, &block)
end
# If a target is given, unpack there; else unpack to a temp folder
# If block is given, yield to that block
# A target or a block must be given, but not both
def unpack(target=nil)
mktemp(download_name) do
downloader.stage
if block_given?
yield self
elsif target
target = Pathname.new(target) unless target.is_a? Pathname
target.install Dir['*']
end
end
end
Partial = Struct.new(:resource, :files)
def files(*files)
@ -150,10 +129,4 @@ class Resource
raise TypeError, "version '#{val.inspect}' should be a string"
end
end
class Go < Resource
def stage target
super(target/name)
end
end
end