diff options
author | James Turnbull <james@lovedthanlost.net> | 2009-03-01 09:09:16 +1100 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-03-01 09:09:16 +1100 |
commit | ba2e470ab5f6ee767c1b0d3016627e3838006e44 (patch) | |
tree | 40fee61f0b6ddf6f62acde87dad232698151c99c | |
parent | 77fa46babc4150eb90f3fe3f9ea0e84ed8d0c9e2 (diff) | |
download | facter-ba2e470ab5f6ee767c1b0d3016627e3838006e44.tar.gz facter-ba2e470ab5f6ee767c1b0d3016627e3838006e44.tar.xz facter-ba2e470ab5f6ee767c1b0d3016627e3838006e44.zip |
Fixed #2040 - Facter should provide a macosx_productversion_major fact
-rw-r--r-- | CHANGELOG | 2 | ||||
-rw-r--r-- | lib/facter/util/macosx.rb | 5 |
2 files changed, 7 insertions, 0 deletions
@@ -1,4 +1,6 @@ 1.6.x: + Fixed #2040 - Facter should provide a macosx_productversion_major fact + Fixed #2003 - Added is_virtual fact Fixed #2035 - Missing brace for OSX preflight diff --git a/lib/facter/util/macosx.rb b/lib/facter/util/macosx.rb index 6e7986e..f5f83f3 100644 --- a/lib/facter/util/macosx.rb +++ b/lib/facter/util/macosx.rb @@ -58,6 +58,11 @@ module Facter::Util::Macosx [ "productName", "productVersion", "buildVersion" ].each do |option| ver["macosx_#{option}"] = %x{sw_vers -#{option}}.strip end + productversion = ver["macosx_productVersion"] + if not productversion.nil? + ver["macosx_productversion_major"] = productversion.scan(/(\d+\.\d+)/)[0][0] + ver["macosx_productversion_minor"] = productversion.scan(/(\d+)\.(\d+)\.(\d+)/)[0].last + end ver end end |