aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/download_strategy.rb8
-rw-r--r--Library/Homebrew/formula.rb4
2 files changed, 8 insertions, 4 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 5453645a2..6a7ee5e35 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -18,14 +18,18 @@
class AbstractDownloadStrategy
def initialize url, name, version
@url=url
- @unique_token="#{name}-#{version}"
+ @unique_token="#{name}-#{version}" unless name.to_s.empty? or name == '__UNKNOWN__'
end
end
class HttpDownloadStrategy <AbstractDownloadStrategy
def fetch
ohai "Downloading #{@url}"
- @dl=HOMEBREW_CACHE+(@unique_token+ext)
+ if @unique_token
+ @dl=HOMEBREW_CACHE+(@unique_token+ext)
+ else
+ @dl=HOMEBREW_CACHE+File.basename(@url)
+ end
unless @dl.exist?
curl @url, '-o', @dl
else
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index a898944ee..2cff1fc36 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -254,8 +254,8 @@ private
end
def validate_variable name
- v=eval("@#{name}")
- raise "Invalid @#{name}" if v.nil? or v.empty? or v =~ /\s/
+ v=eval "@#{name}"
+ raise "Invalid @#{name}" if v.to_s.empty? or v =~ /\s/
end
def method_added method