mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Pull USERAGENT used by curl into constant
This commit is contained in:
parent
fea89daae6
commit
cae0e78e60
@ -174,10 +174,8 @@ private
|
|||||||
tgz=File.expand_path File.basename(@url)
|
tgz=File.expand_path File.basename(@url)
|
||||||
end
|
end
|
||||||
|
|
||||||
agent="Homebrew #{HOMEBREW_VERSION} (Ruby #{VERSION}; Mac OS X 10.5 Leopard)"
|
|
||||||
|
|
||||||
unless File.exists? tgz
|
unless File.exists? tgz
|
||||||
`curl -#LA "#{agent}" #{oarg} "#{@url}"`
|
`curl -#LA "#{HOMEBREW_USER_AGENT}" #{oarg} "#{@url}"`
|
||||||
raise "Download failed" unless $? == 0
|
raise "Download failed" unless $? == 0
|
||||||
else
|
else
|
||||||
puts "File already downloaded and cached"
|
puts "File already downloaded and cached"
|
||||||
|
@ -8,10 +8,10 @@ require 'utils'
|
|||||||
|
|
||||||
# these are defined in env.rb usually, but we don't want to break our actual
|
# these are defined in env.rb usually, but we don't want to break our actual
|
||||||
# homebrew tree, and we do want to test everything :)
|
# homebrew tree, and we do want to test everything :)
|
||||||
HOMEBREW_VERSION='0.3t'
|
|
||||||
HOMEBREW_PREFIX=Pathname.new '/tmp/testbrew/prefix'
|
HOMEBREW_PREFIX=Pathname.new '/tmp/testbrew/prefix'
|
||||||
HOMEBREW_CACHE=HOMEBREW_PREFIX.parent+"cache"
|
HOMEBREW_CACHE=HOMEBREW_PREFIX.parent+"cache"
|
||||||
HOMEBREW_CELLAR=HOMEBREW_PREFIX.parent+"cellar"
|
HOMEBREW_CELLAR=HOMEBREW_PREFIX.parent+"cellar"
|
||||||
|
HOMEBREW_USER_AGENT="Homebrew"
|
||||||
|
|
||||||
HOMEBREW_CELLAR.mkpath
|
HOMEBREW_CELLAR.mkpath
|
||||||
raise "HOMEBREW_CELLAR couldn't be created!" unless HOMEBREW_CELLAR.directory?
|
raise "HOMEBREW_CELLAR couldn't be created!" unless HOMEBREW_CELLAR.directory?
|
||||||
|
1
bin/brew
1
bin/brew
@ -4,6 +4,7 @@ require 'env'
|
|||||||
require 'find'
|
require 'find'
|
||||||
|
|
||||||
PRISTINE_ARGV=ARGV.dup
|
PRISTINE_ARGV=ARGV.dup
|
||||||
|
HOMEBREW_USER_AGENT="Homebrew #{HOMEBREW_VERSION} (Ruby #{VERSION}; Mac OS X 10.5 Leopard)"
|
||||||
|
|
||||||
# often causes Ruby to throw exception ffs
|
# often causes Ruby to throw exception ffs
|
||||||
Dir.chdir '/' unless File.directory? ENV['PWD']
|
Dir.chdir '/' unless File.directory? ENV['PWD']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user