From 2505ebda673bf73ef057540d8165f76eee2c3081 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 1 Sep 2011 19:09:21 -0500 Subject: fetch: fix '--force' for pathnames `brew fetch --force` was a no-op for formula pathnames when that formula did not exist in Library/Formula, because `brew --cache #{f.name}` results in an error for that case. Fix it by always using f.cached_download. Signed-off-by: Jack Nagel --- Library/Homebrew/cmd/fetch.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index 6099ddf5c..de3efe124 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -20,8 +20,8 @@ module Homebrew extend self bucket.each do |f| if ARGV.include? "--force" or ARGV.include? "-f" - where_to = `brew --cache #{f.name}`.strip - FileUtils.rm_rf where_to unless where_to.empty? + where_to = f.cached_download + FileUtils.rm_rf where_to if File.exist? where_to end the_tarball = f.downloader.fetch -- cgit v1.2.3