aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorPiotr Usewicz2009-09-16 11:28:50 +0100
committerMax Howell2009-09-25 01:24:05 +0100
commitc81a1d33ff7480420025d2cc19ea64feab07e60a (patch)
tree047478acd0a93c61918eb738bebde3191c0dc72f /Library
parente60e1d7b7ad0edb2401cc038efe8b516fddde83b (diff)
downloadhomebrew-c81a1d33ff7480420025d2cc19ea64feab07e60a.tar.bz2
Add full version and build numbers to user agent
Signed-off-by: Max Howell <max@methylblue.com> I adapted it slightly based on the user agent that Safari gives.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brewkit.rb4
-rw-r--r--Library/Homebrew/global.rb14
2 files changed, 10 insertions, 8 deletions
diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb
index 91ea9fa64..a6fb58aba 100644
--- a/Library/Homebrew/brewkit.rb
+++ b/Library/Homebrew/brewkit.rb
@@ -33,9 +33,7 @@ require 'hardware'
# build systems we support to do it.
-`/usr/bin/sw_vers -productVersion` =~ /(10\.\d+)(\.\d+)?/
-MACOS_VERSION=$1.to_f
-ENV['MACOSX_DEPLOYMENT_TARGET']=$1
+ENV['MACOSX_DEPLOYMENT_TARGET']=MACOS_VERSION.to_s
# ignore existing build vars, thus we should have less bugs to deal with
ENV['LDFLAGS']=""
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index 3feec1c8c..95e4c9ded 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -34,8 +34,12 @@ else
HOMEBREW_CACHE=Pathname.new("~/Library/Caches/Homebrew").expand_path
end
-HOMEBREW_PREFIX=(Pathname.getwd+__FILE__).dirname.parent.parent.cleanpath
-HOMEBREW_CELLAR=HOMEBREW_PREFIX+'Cellar'
-HOMEBREW_VERSION='0.4'
-HOMEBREW_WWW='http://bit.ly/Homebrew'
-HOMEBREW_USER_AGENT="Homebrew #{HOMEBREW_VERSION} (Ruby #{VERSION}; Mac OS X 10.5 Leopard)"
+HOMEBREW_PREFIX = (Pathname.getwd+__FILE__).dirname.parent.parent.cleanpath
+HOMEBREW_CELLAR = HOMEBREW_PREFIX+'Cellar'
+HOMEBREW_VERSION = 0.4
+HOMEBREW_WWW = 'http://bit.ly/Homebrew'
+
+MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp
+MACOS_VERSION = /(10\.\d+)(\.\d+)?/.match(MACOS_FULL_VERSION).captures.first.to_f
+
+HOMEBREW_USER_AGENT = "Homebrew #{HOMEBREW_VERSION} (Ruby #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}; Mac OS X #{MACOS_FULL_VERSION})"