aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Formula/mat.rb2
-rw-r--r--Library/Formula/rpm.rb2
-rw-r--r--Library/Homebrew/download_strategy.rb36
3 files changed, 20 insertions, 20 deletions
diff --git a/Library/Formula/mat.rb b/Library/Formula/mat.rb
index df36ab2fa..b2bb67ea2 100644
--- a/Library/Formula/mat.rb
+++ b/Library/Formula/mat.rb
@@ -5,7 +5,7 @@ require "formula"
# into "mat-cli" here.
class MatDownloadStrategy < CurlDownloadStrategy
def stage
- with_system_path { safe_system "#{xzpath} -dc \"#{tarball_path}\" | tar xf - -s ',/mat$,/mat-cli,'" }
+ with_system_path { safe_system "#{xzpath} -dc \"#{cached_location}\" | tar xf - -s ',/mat$,/mat-cli,'" }
chdir
end
end
diff --git a/Library/Formula/rpm.rb b/Library/Formula/rpm.rb
index b07263d7c..0d685c9c4 100644
--- a/Library/Formula/rpm.rb
+++ b/Library/Formula/rpm.rb
@@ -7,7 +7,7 @@ class RpmDownloadStrategy < CurlDownloadStrategy
end
def stage
- safe_system "rpm2cpio.pl <#{tarball_path} | cpio -vi #{@tarball_name}"
+ safe_system "rpm2cpio.pl <#{cached_location} | cpio -vi #{@tarball_name}"
safe_system "/usr/bin/tar -xzf #{@tarball_name} && rm #{@tarball_name}"
chdir
end
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index c4fe88173..84cbf3778 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -156,12 +156,12 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
super
@mirrors = resource.mirrors.dup
@tarball_path = HOMEBREW_CACHE.join("#{name}-#{resource.version}#{ext}")
- @temporary_path = Pathname.new("#{tarball_path}.incomplete")
+ @temporary_path = Pathname.new("#{cached_location}.incomplete")
end
def fetch
ohai "Downloading #{@url}"
- unless tarball_path.exist?
+ unless cached_location.exist?
had_incomplete_download = temporary_path.exist?
begin
_fetch
@@ -182,9 +182,9 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
raise CurlDownloadStrategyError, msg
end
end
- ignore_interrupts { temporary_path.rename(tarball_path) }
+ ignore_interrupts { temporary_path.rename(cached_location) }
else
- puts "Already downloaded: #{tarball_path}"
+ puts "Already downloaded: #{cached_location}"
end
rescue CurlDownloadStrategyError
raise if mirrors.empty?
@@ -194,9 +194,9 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
end
def stage
- case tarball_path.compression_type
+ case cached_location.compression_type
when :zip
- with_system_path { quiet_safe_system 'unzip', {:quiet_flag => '-qq'}, tarball_path }
+ with_system_path { quiet_safe_system 'unzip', {:quiet_flag => '-qq'}, cached_location }
chdir
when :gzip_only
with_system_path { buffered_write("gunzip") }
@@ -204,22 +204,22 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
with_system_path { buffered_write("bunzip2") }
when :gzip, :bzip2, :compress, :tar
# Assume these are also tarred
- with_system_path { safe_system 'tar', 'xf', tarball_path }
+ with_system_path { safe_system 'tar', 'xf', cached_location }
chdir
when :xz
- with_system_path { safe_system "#{xzpath} -dc \"#{tarball_path}\" | tar xf -" }
+ with_system_path { safe_system "#{xzpath} -dc \"#{cached_location}\" | tar xf -" }
chdir
when :lzip
- with_system_path { safe_system "#{lzippath} -dc \"#{tarball_path}\" | tar xf -" }
+ with_system_path { safe_system "#{lzippath} -dc \"#{cached_location}\" | tar xf -" }
chdir
when :xar
- safe_system "/usr/bin/xar", "-xf", tarball_path
+ safe_system "/usr/bin/xar", "-xf", cached_location
when :rar
- quiet_safe_system 'unrar', 'x', {:quiet_flag => '-inul'}, tarball_path
+ quiet_safe_system 'unrar', 'x', {:quiet_flag => '-inul'}, cached_location
when :p7zip
- safe_system '7zr', 'x', tarball_path
+ safe_system '7zr', 'x', cached_location
else
- cp tarball_path, basename_without_params
+ cp cached_location, basename_without_params
end
end
@@ -260,9 +260,9 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
# file regardless of the current working directory, so we need to write it to
# the correct location ourselves.
def buffered_write(tool)
- target = File.basename(basename_without_params, tarball_path.extname)
+ target = File.basename(basename_without_params, cached_location.extname)
- Utils.popen_read(tool, "-f", tarball_path.to_s, "-c") do |pipe|
+ Utils.popen_read(tool, "-f", cached_location.to_s, "-c") do |pipe|
File.open(target, "wb") do |f|
buf = ""
f.write(buf) while pipe.read(1024, buf)
@@ -340,7 +340,7 @@ end
# Useful for installing jars.
class NoUnzipCurlDownloadStrategy < CurlDownloadStrategy
def stage
- cp tarball_path, basename_without_params
+ cp cached_location, basename_without_params
end
end
@@ -362,7 +362,7 @@ class CurlBottleDownloadStrategy < CurlDownloadStrategy
end
def stage
- ohai "Pouring #{tarball_path.basename}"
+ ohai "Pouring #{cached_location.basename}"
super
end
end
@@ -375,7 +375,7 @@ class LocalBottleDownloadStrategy < CurlDownloadStrategy
end
def stage
- ohai "Pouring #{tarball_path.basename}"
+ ohai "Pouring #{cached_location.basename}"
super
end
end