facter 1.5.8 → 1.5.9

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of facter might be problematic. Click here for more details.

Files changed (119) hide show
  1. data/CHANGELOG +94 -0
  2. data/INSTALL +1 -1
  3. data/README +1 -1
  4. data/README.rst +3 -3
  5. data/Rakefile +9 -6
  6. data/bin/facter +18 -123
  7. data/conf/redhat/facter.spec +21 -3
  8. data/conf/solaris/pkginfo +2 -2
  9. data/install.rb +18 -10
  10. data/lib/facter.rb +27 -1
  11. data/lib/facter/application.rb +123 -0
  12. data/lib/facter/arp.rb +28 -0
  13. data/lib/facter/ec2.rb +32 -11
  14. data/lib/facter/hardwareisa.rb +1 -1
  15. data/lib/facter/id.rb +2 -9
  16. data/lib/facter/interfaces.rb +1 -1
  17. data/lib/facter/ipaddress.rb +2 -33
  18. data/lib/facter/ipaddress6.rb +68 -0
  19. data/lib/facter/lsb.rb +5 -5
  20. data/lib/facter/lsbmajdistrelease.rb +1 -1
  21. data/lib/facter/macaddress.rb +4 -14
  22. data/lib/facter/manufacturer.rb +9 -0
  23. data/lib/facter/memory.rb +110 -6
  24. data/lib/facter/netmask.rb +1 -1
  25. data/lib/facter/operatingsystem.rb +17 -2
  26. data/lib/facter/operatingsystemrelease.rb +34 -0
  27. data/lib/facter/processor.rb +8 -5
  28. data/lib/facter/selinux.rb +37 -4
  29. data/lib/facter/uniqueid.rb +1 -1
  30. data/lib/facter/util/#uptime.rb# +64 -0
  31. data/lib/facter/util/ip.rb +23 -15
  32. data/lib/facter/util/loader.rb +2 -2
  33. data/lib/facter/util/macaddress.rb +28 -0
  34. data/lib/facter/util/manufacturer.rb +39 -2
  35. data/lib/facter/util/memory.rb +43 -0
  36. data/lib/facter/util/netmask.rb +1 -1
  37. data/lib/facter/util/resolution.rb +7 -0
  38. data/lib/facter/util/uptime.rb +11 -1
  39. data/lib/facter/util/virtual.rb +13 -2
  40. data/lib/facter/util/vlans.rb +2 -2
  41. data/lib/facter/util/xendomains.rb +10 -0
  42. data/lib/facter/virtual.rb +45 -13
  43. data/lib/facter/xendomains.rb +10 -0
  44. data/spec/fixtures/ifconfig/bsd_ifconfig_all_with_multiple_interfaces +18 -0
  45. data/spec/fixtures/ifconfig/centos_5_5 +17 -0
  46. data/spec/fixtures/ifconfig/centos_5_5_eth0 +8 -0
  47. data/spec/fixtures/ifconfig/darwin_10_3_0 +26 -0
  48. data/spec/fixtures/ifconfig/darwin_10_3_0_en0 +6 -0
  49. data/spec/fixtures/ifconfig/darwin_10_6_4 +28 -0
  50. data/spec/fixtures/ifconfig/darwin_10_6_4_en1 +6 -0
  51. data/spec/fixtures/ifconfig/darwin_10_6_6_dualstack +8 -0
  52. data/spec/fixtures/ifconfig/darwin_10_6_6_dualstack_en1 +7 -0
  53. data/spec/fixtures/ifconfig/darwin_9_8_0 +26 -0
  54. data/spec/fixtures/ifconfig/darwin_9_8_0_en0 +6 -0
  55. data/spec/fixtures/ifconfig/darwin_ifconfig_all_with_multiple_interfaces +23 -0
  56. data/spec/fixtures/ifconfig/fedora_10 +36 -0
  57. data/spec/fixtures/ifconfig/fedora_10_eth0 +9 -0
  58. data/spec/fixtures/ifconfig/fedora_13 +18 -0
  59. data/spec/fixtures/ifconfig/fedora_13_eth0 +9 -0
  60. data/spec/fixtures/ifconfig/fedora_8 +38 -0
  61. data/spec/fixtures/ifconfig/fedora_8_eth0 +9 -0
  62. data/spec/fixtures/ifconfig/freebsd_6_0 +12 -0
  63. data/spec/fixtures/ifconfig/linux_ifconfig_all_with_multiple_interfaces +19 -0
  64. data/spec/fixtures/ifconfig/open_solaris_10 +12 -0
  65. data/spec/fixtures/ifconfig/open_solaris_b132 +20 -0
  66. data/spec/fixtures/ifconfig/sunos_ifconfig_all_with_multiple_interfaces +10 -0
  67. data/spec/fixtures/ifconfig/ubuntu_7_04 +38 -0
  68. data/spec/fixtures/ifconfig/ubuntu_7_04_eth0 +9 -0
  69. data/spec/fixtures/netstat/centos_5_5 +5 -0
  70. data/spec/fixtures/netstat/darwin_10_3_0 +35 -0
  71. data/spec/fixtures/netstat/darwin_10_6_4 +29 -0
  72. data/spec/fixtures/netstat/darwin_10_6_6_dualstack +34 -0
  73. data/spec/fixtures/netstat/darwin_9_8_0 +28 -0
  74. data/spec/fixtures/netstat/fedora_10 +7 -0
  75. data/spec/fixtures/netstat/open_solaris_10 +16 -0
  76. data/spec/fixtures/netstat/open_solaris_b132 +17 -0
  77. data/spec/fixtures/netstat/ubuntu_7_04 +7 -0
  78. data/spec/fixtures/uptime/kstat_boot_time +1 -0
  79. data/spec/fixtures/virtual/proc_self_status/vserver_2_1/guest +37 -0
  80. data/spec/fixtures/virtual/proc_self_status/vserver_2_1/host +36 -0
  81. data/spec/fixtures/virtual/proc_self_status/vserver_2_3/guest +39 -0
  82. data/spec/fixtures/virtual/proc_self_status/vserver_2_3/host +39 -0
  83. data/spec/integration/{facter.rb → facter_spec.rb} +1 -1
  84. data/spec/spec_helper.rb +8 -3
  85. data/spec/unit/data/debian_kfreebsd_ifconfig +40 -0
  86. data/spec/unit/data/hpux_netstat_all_interfaces +3 -6
  87. data/spec/unit/data/selinux_sestatus +6 -0
  88. data/spec/unit/data/xendomains +4 -0
  89. data/spec/unit/{facter.rb → facter_spec.rb} +28 -1
  90. data/spec/unit/id_spec.rb +27 -0
  91. data/spec/unit/{interfaces.rb → interfaces_spec.rb} +1 -1
  92. data/spec/unit/ipaddress6_spec.rb +36 -0
  93. data/spec/unit/memory_spec.rb +45 -0
  94. data/spec/unit/{operatingsystem.rb → operatingsystem_spec.rb} +22 -8
  95. data/spec/unit/operatingsystemrelease_spec.rb +49 -0
  96. data/spec/unit/selinux_spec.rb +89 -0
  97. data/spec/unit/{uptime.rb → uptime_spec.rb} +4 -4
  98. data/spec/unit/util/{collection.rb → collection_spec.rb} +1 -1
  99. data/spec/unit/util/{confine.rb → confine_spec.rb} +1 -1
  100. data/spec/unit/util/{fact.rb → fact_spec.rb} +1 -1
  101. data/spec/unit/util/{ip.rb → ip_spec.rb} +47 -12
  102. data/spec/unit/util/{loader.rb → loader_spec.rb} +51 -1
  103. data/spec/unit/util/macaddress_spec.rb +68 -0
  104. data/spec/unit/util/{macosx.rb → macosx_spec.rb} +1 -1
  105. data/spec/unit/util/{manufacturer.rb → manufacturer_spec.rb} +15 -4
  106. data/spec/unit/util/{resolution.rb → resolution_spec.rb} +1 -1
  107. data/spec/unit/util/uptime_spec.rb +73 -0
  108. data/spec/unit/util/{virtual.rb → virtual_spec.rb} +37 -3
  109. data/spec/unit/util/{vlans.rb → vlans_spec.rb} +1 -1
  110. data/spec/unit/util/xendomains_spec.rb +23 -0
  111. data/spec/unit/virtual_spec.rb +196 -0
  112. metadata +149 -98
  113. data/spec/Rakefile +0 -18
  114. data/spec/unit/data/hpux_ifconfig +0 -3
  115. data/spec/unit/data/hpux_netscan +0 -4
  116. data/spec/unit/operatingsystemrelease.rb +0 -39
  117. data/spec/unit/selinux.rb +0 -48
  118. data/spec/unit/util/uptime.rb +0 -53
  119. data/spec/unit/virtual.rb +0 -71
data/CHANGELOG CHANGED
@@ -1,3 +1,97 @@
1
+ 1.5.9
2
+ =====
3
+ 4de8b20 Updated CHANGELOG for 1.5.9rc6
4
+ cc67a01 Removed inappropriately uncredited Ohai method from ec2 fact
5
+ 69f98da Add facter test for ticket 7039
6
+ f91c120 downcase arp output so that the ec2 arp is matched
7
+ a75f0f9 (#7039) Pre-load all facts when requesting a single fact
8
+ 6b97242 Update CHANGELOG for 1.5.9rc5
9
+ acf0bb2 Ensures that ARP facts are returned only on EC2 hosts
10
+ 76f544b Updated CHANGELOG for 1.5.9rc4
11
+ 09b9f9b (#6795) Update tests to reflect changed exec
12
+ 3db1cd0 Updated CHANGELOG for 1.5.9rc3
13
+ def3322 (#6795) xendomains: Ignore error output from xm list
14
+ f39d487 (#6763) Use Facter::Util::Resolution.exec for arp
15
+ 3eb9410 arp: Cleanup indendation
16
+ 50b9b3f Updated CHANGELOG for 1.5.9rc2
17
+ 2fb8316 Clean up indentation, and alignment in macaddress_spec.rb
18
+ 3f0a340 (#6716) fix facter issues on OSX with ipv6 in macaddress.rb.
19
+ 43f82ef Update CHANGELOG for 1.5.9rc1
20
+ d62e079 Fixed #2346 - A much cleverer EC2 fact
21
+ 0411d2e Fixed #2346 - Part 1: Added arp fact for Linux
22
+ 5b6f4fa Discussion on ec2 facts - #2346
23
+ e917e1a Fixed #3087 - Identify VMWare
24
+ d0f0f63 (#6327) Memory facts should be available on Mac Darwin
25
+ 458a22d Incremented release to 1.5.9
26
+ 4eb64fe Fixed #6719 Typo
27
+ ffd80ac (#5011) Adds swap statistics for OSX
28
+ 1207765 (#6719) Restricts virtualization types for zones
29
+ 8d71db3 Fixed #6616 - Stubbing in VMware tests on Linux
30
+ aa959df Remove Solaris from the list of confined systems. It won't get the original lsb facts, and it's nonsensical too.
31
+ 2e48e18 Fixed #6695 - Updated id fact for Darwin et al
32
+ d718af4 Fix #6679 - Added Scientific Linux to operatingsystem fact
33
+ dea6f78 Further fix to #5485 - SELinux facts
34
+ 6d6d8da (#2721) Merged patch from Brane GraAnar
35
+ 868e7ba (#5485) Made selinux_mode fact work
36
+ 214da73 Fixed #5485 - Updated selinux_mode fact
37
+ ba2601f Fix for #6495 - Updated interface detection
38
+ 93461d9 Fixed #5950 - Solaris ipaddress incorrect after bonding failure
39
+ 2e06cdc (#6615) fix missing stub calls in loader specs
40
+ 3c7841e (#5666) windows support for facter/id.rb
41
+ dd5d5bf (#4925) - MS Windows doesn't do man pages
42
+ 52026ee Fixed #5699 - Added processorcount support for S390x
43
+ 7dd730d Fixed #5699 - Added virtual support for s390x/Zlinux
44
+ d6ce08a Fixed #6611 - Fixed broken HPVM test and rationalised test structure
45
+ 84fa3c4 (#6525) change semicolons to 'then' in case statement for ruby 1.9.2 compatibility
46
+ 3e6217d Fixes #6521 and other Ruby 1.9 issues
47
+ eb5d6fc Fixed #6525 - Test failures on Ruby 1.9.x
48
+ cb25119 (#2270) add testing for the new ipaddress6 feature
49
+ ea29483 (#2270) add IPv6 support to facter core.
50
+ 77eb512 (#2270) Remove DWIM code from ipaddress on Darwin.
51
+ f5bf0f5 (#6360) Flush Facter top level cache before every test case.
52
+ 0d7a2e6 Fix #4755: add support for GNU/kFreeBSD platform where missing.
53
+ b88a088 (#5510) Facter should load custom fact definitions in filename order.
54
+ 7a8be16 Refactor #6044 -- use _spec.rb as the pattern for spec tests.
55
+ b39f892 Refactor #6044 -- require spec_helper with a consistent path.
56
+ a4fe459 Refactor #6044 -- port testing to rspec2
57
+ af9134c (#5086) Try using kstat before falling back to 'who -b' to determine uptime.
58
+ cbbfe55 Refactor util/uptime.rb tests to reduce duplication using contexts
59
+ f0cc2c0 (#4575) win32 support for manufacturer, productname, & serialnumber
60
+ c40fc07 (#1423) Memory facts for Solaris
61
+ 1985528 (#4754) Change is_virtual logic to not enumerate virtual types
62
+ 739040f (#4754) Add support for Darwin and Parallels VM to "virtual" fact
63
+ 9332f8a (#5325) Add tests for SPARC manufacturer and product name
64
+ 5b561e3 (#5325) Manufacturer and product name on SPARC
65
+ 9d99079 maint: Fix spec failures caused by having a space in the path to facter's source
66
+ 89da001 maint: require rubygems so hudson can run the specs
67
+ 1eef842 Maint: add "Local-branch:" info to mails sent by "rake mail_patches"
68
+ f007a9d (#4989) Add xendomains fact
69
+ 1fa87a9 JSON support. Works in 1.9.1. Warnings in 1.9.2. LoadError on 1.8.7 for some reason
70
+ 43e203c (#5040) fact virtual should detect hpvm
71
+ 7cec60a (#5016) is_virtual should be true on solaris zones
72
+ f2e66b6 (#5031) Remove redundant puts from RDoc.usage
73
+ f4da528 maint: Fix merge error
74
+ d62b013 Issue #4889 Fact values should all be strings
75
+ 07f186d [#4552] Updating --timing to report in milliseconds instead of seconds
76
+ 1f387a5 [#4552] Apply patch from Dean Wilson
77
+ 244d2f1 Better fix for Bug 4569: Uptime Fact is incorrect on Windows
78
+ 11544c1 [#4289] operatingsystemrelease fact for oel, ovs
79
+ e6bfdf9 Fix for bug #4569
80
+ 8c4d0cd (#4558) Fail with message on --help errors
81
+ 7210429 [#4558] Refactor facter binary using optparse
82
+ b5c85de [#4563] Add a --trace option to the binary
83
+ ebcb81b [#4558] Refactor facter binary using optparse
84
+ b8b7123 (#4567) Remove unnecessary or non-portable redirects
85
+ 7ecba71 (#4567) Retain detached HEAD state
86
+ 1125e1e Make sure FreeBSD spec also works on systems that have /proc/cpuinfo.
87
+ 889e150 Sync rpm spec file from Fedora/EPEL
88
+ 725dce0 Rename Reductive Labs to Puppet Labs
89
+ ff473ef Updated signing rake task
90
+ a85f2b0 [#2865] Fix reporting of virtual facts
91
+ f67ec05 [#4567] Add ext/facter-diff to compare output of 2 versions
92
+ 4050acc Removing stupid .DS_Store files :(
93
+ 016cf03 [#3703] Fix macaddress fact for Darwin
94
+
1
95
  1.5.8
2
96
  =====
3
97
  ca2da36 Updated install.rb and created man page
data/INSTALL CHANGED
@@ -1,5 +1,5 @@
1
1
  Run 'ruby install.rb' or use one of the distributed gem files at
2
- http://reductivelabs.com/downloads/gems .
2
+ http://puppetlabs.com/downloads/gems .
3
3
 
4
4
  install.rb should successfully install; let me know if it doesn't.
5
5
 
data/README CHANGED
@@ -5,4 +5,4 @@ processors, etc.
5
5
 
6
6
  See bin/facter for an example of the interface.
7
7
 
8
- See http://reductivelabs.com/projects/facter/ for more details.
8
+ See http://www.puppetlabs.com/puppet/related-projects/facter for more details.
data/README.rst CHANGED
@@ -16,11 +16,11 @@ Run the ``facter`` binary on the command for a full list of facts supported on y
16
16
  Adding your own facts
17
17
  +++++++++++++++++++++
18
18
 
19
- See the `Adding Facts`_ wiki page for details of how to add your own custom facts to Facter.
19
+ See the `Adding Facts`_ page for details of how to add your own custom facts to Facter.
20
20
 
21
21
  Further Information
22
22
  +++++++++++++++++++
23
23
 
24
- See http://reductivelabs.com/projects/facter/ for more details.
24
+ See http://www.puppetlabs.com/puppet/related-projects/facter for more details.
25
25
 
26
- .. _Adding Facts: http://reductivelabs.com/trac/puppet/wiki/AddingFacts
26
+ .. _Adding Facts: http://docs.puppetlabs.com/guides/custom_facts.html
data/Rakefile CHANGED
@@ -3,8 +3,9 @@
3
3
  $: << File.expand_path('lib')
4
4
  $LOAD_PATH << File.join(File.dirname(__FILE__), 'tasks')
5
5
 
6
- require 'spec'
7
- require 'spec/rake/spectask'
6
+ require 'rubygems'
7
+ require 'rspec'
8
+ require 'rspec/core/rake_task'
8
9
  begin
9
10
  require 'rcov'
10
11
  rescue LoadError
@@ -61,12 +62,14 @@ task :default do
61
62
  sh %{rake -T}
62
63
  end
63
64
 
64
- Spec::Rake::SpecTask.new(:spec) do |t|
65
- t.spec_files = FileList['spec/**/*.rb']
65
+ RSpec::Core::RakeTask.new do |t|
66
+ t.pattern ='spec/{unit,integration}/**/*_spec.rb'
67
+ t.fail_on_error = false
66
68
  end
67
69
 
68
- Spec::Rake::SpecTask.new('spec:rcov') do |t|
69
- t.spec_files = FileList['spec/**/*.rb']
70
+ RSpec::Core::RakeTask.new('spec:rcov') do |t|
71
+ t.pattern ='spec/{unit,integration}/**/*_spec.rb'
72
+ t.fail_on_error = false
70
73
  if defined?(Rcov)
71
74
  t.rcov = true
72
75
  t.rcov_opts = ['--exclude', 'spec/*,test/*,results/*,/usr/lib/*,/usr/local/lib/*,gems/*']
data/bin/facter CHANGED
@@ -6,7 +6,7 @@
6
6
  #
7
7
  # = Usage
8
8
  #
9
- # facter [-d|--debug] [-h|--help] [-p|--puppet] [-v|--version] [-y|--yaml] [fact] [fact] [...]
9
+ # facter [-d|--debug] [-h|--help] [-p|--puppet] [-v|--version] [-y|--yaml] [-j|--json] [fact] [fact] [...]
10
10
  #
11
11
  # = Description
12
12
  #
@@ -18,11 +18,11 @@
18
18
  #
19
19
  # = Options
20
20
  #
21
- # debug::
22
- # Enable debugging.
21
+ # yaml::
22
+ # Emit facts in YAML format.
23
23
  #
24
- # help::
25
- # Print this help message
24
+ # json::
25
+ # Emit facts in JSON format.
26
26
  #
27
27
  # puppet::
28
28
  # Load the Puppet libraries, thus allowing Facter to load Puppet-specific facts.
@@ -30,8 +30,17 @@
30
30
  # version::
31
31
  # Print the version and exit.
32
32
  #
33
- # yaml::
34
- # Emit facts in YAML format.
33
+ # help::
34
+ # Print this help message.
35
+ #
36
+ # debug::
37
+ # Enable debugging.
38
+ #
39
+ # trace::
40
+ # Enable backtraces.
41
+ #
42
+ # timing::
43
+ # Enable timing.
35
44
  #
36
45
  # = Example
37
46
  #
@@ -46,120 +55,6 @@
46
55
  # Copyright (c) 2006 Reductive Labs, LLC
47
56
  # Licensed under the GNU Public License
48
57
 
49
- require 'getoptlong'
50
- require 'facter'
51
-
52
- $haveusage = true
53
-
54
- begin
55
- require 'rdoc/ri/ri_paths'
56
- require 'rdoc/usage'
57
- rescue Exception
58
- $haveusage = false
59
- end
60
-
61
- def load_puppet
62
- require 'puppet'
63
- Puppet.parse_config
64
-
65
- # If you've set 'vardir' but not 'libdir' in your
66
- # puppet.conf, then the hook to add libdir to $:
67
- # won't get triggered. This makes sure that it's setup
68
- # correctly.
69
- unless $LOAD_PATH.include?(Puppet[:libdir])
70
- $LOAD_PATH << Puppet[:libdir]
71
- end
72
- end
73
-
74
- $debug = 0
75
-
76
- config = nil
77
-
78
- result = GetoptLong.new(
79
- [ "--version", "-v", GetoptLong::NO_ARGUMENT ],
80
- [ "--help", "-h", GetoptLong::NO_ARGUMENT ],
81
- [ "--debug", "-d", GetoptLong::NO_ARGUMENT ],
82
- [ "--yaml", "-y", GetoptLong::NO_ARGUMENT ],
83
- [ "--config", "-c", GetoptLong::REQUIRED_ARGUMENT ],
84
- [ "--puppet", "-p", GetoptLong::NO_ARGUMENT ]
85
- )
86
-
87
- options = {
88
- :yaml => false
89
- }
90
-
91
- begin
92
- result.each { |opt,arg|
93
- case opt
94
- when "--version"
95
- puts "%s" % Facter.version
96
- exit
97
- when "--puppet"
98
- begin
99
- load_puppet()
100
- rescue LoadError => detail
101
- $stderr.puts "Could not load Puppet: %s" % detail
102
- end
103
- when "--yaml"
104
- options[:yaml] = true
105
- when "--debug"
106
- Facter.debugging(1)
107
- when "--help"
108
- if $haveusage
109
- RDoc::usage && exit
110
- else
111
- puts "No help available unless you have RDoc::usage installed"
112
- exit
113
- end
114
- else
115
- $stderr.puts "Invalid option '#{opt}'"
116
- exit(12)
117
- end
118
- }
119
- rescue
120
- exit(12)
121
- end
122
-
123
- names = []
124
-
125
- unless config.nil?
126
- File.open(config) { |file|
127
- names = file.readlines.collect { |line|
128
- line.chomp
129
- }
130
- }
131
- end
132
-
133
- ARGV.each { |item|
134
- names.push item
135
- }
136
-
137
- facts = Facter.to_hash
138
-
139
- unless names.empty?
140
- facts = {}
141
- names.each { |name|
142
- begin
143
- facts[name] = Facter.value(name)
144
- rescue => error
145
- STDERR.puts "Could not retrieve %s: #{error}" % name
146
- exit 10
147
- end
148
- }
149
- end
150
-
151
- if options[:yaml]
152
- require 'yaml'
153
- puts YAML.dump(facts)
154
- exit(0)
155
- end
58
+ require 'facter/application'
156
59
 
157
- facts.sort { |a, b| a[0].to_s <=> b[0].to_s }.each { |name,value|
158
- if facts.length == 1
159
- unless value.nil?
160
- puts value
161
- end
162
- else
163
- puts "%s => %s" % [name,value]
164
- end
165
- }
60
+ Facter::Application.run(ARGV)
@@ -5,12 +5,14 @@
5
5
 
6
6
  Summary: Ruby module for collecting simple facts about a host operating system
7
7
  Name: facter
8
- Version: 1.5.5
8
+ Version: 1.5.8
9
9
  Release: 1%{?dist}
10
10
  License: GPLv2+
11
11
  Group: System Environment/Base
12
- URL: http://reductivelabs.com/projects/facter
13
- Source0: http://reductivelabs.com/downloads/facter/%{name}-%{version}.tar.gz
12
+ URL: http://www.puppetlabs.com/puppet/related-projects/%{name}/
13
+ Source0: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}.tar.gz
14
+ Source1: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}.tar.gz.sign
15
+
14
16
  BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
15
17
  %if %has_ruby_noarch
16
18
  BuildArch: noarch
@@ -50,6 +52,19 @@ rm -rf %{buildroot}
50
52
 
51
53
 
52
54
  %changelog
55
+ * Sat Aug 28 2010 Todd Zullinger <tmz@pobox.com> - 1.5.8-1
56
+ - Update to 1.5.8
57
+
58
+ * Fri Sep 25 2009 Todd Zullinger <tmz@pobox.com> - 1.5.7-1
59
+ - Update to 1.5.7
60
+ - Update #508037 patch from upstream ticket
61
+
62
+ * Wed Aug 12 2009 Jeroen van Meeuwen <j.van.meeuwen@ogd.nl> - 1.5.5-3
63
+ - Fix #508037 or upstream #2355
64
+
65
+ * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.5-2
66
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
67
+
53
68
  * Fri May 22 2009 Todd Zullinger <tmz@pobox.com> - 1.5.5-1
54
69
  - Update to 1.5.5
55
70
  - Drop upstreamed libperms patch
@@ -58,6 +73,9 @@ rm -rf %{buildroot}
58
73
  - New version
59
74
  - Use upstream install script
60
75
 
76
+ * Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-2
77
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
78
+
61
79
  * Tue Sep 09 2008 Todd Zullinger <tmz@pobox.com> - 1.5.2-1
62
80
  - New version
63
81
  - Simplify spec file checking for Fedora and RHEL versions
@@ -2,6 +2,6 @@ PKG=CSWfacter
2
2
  NAME=facter - System Fact Gatherer
3
3
  VERSION=1.3.5
4
4
  CATEGORY=application
5
- VENDOR=http://reductivelabs.com/projects/facter
6
- HOTLINE=http://reductivelabs.com/cgi-bin/facter.cgi
5
+ VENDOR=http://www.puppetlabs.com/puppet/related-projects/facter
6
+ HOTLINE=http://puppetlabs.com/cgi-bin/facter.cgi
7
7
  EMAIL=luke@madstop.com
data/install.rb CHANGED
@@ -97,16 +97,20 @@ def do_libs(libs, strip = 'lib/')
97
97
  end
98
98
 
99
99
  def do_man(man, strip = 'man/')
100
+ if (InstallOptions.man == true)
100
101
  man.each do |mf|
101
- omf = File.join(InstallOptions.man_dir, mf.gsub(/#{strip}/, ''))
102
- om = File.dirname(omf)
103
- FileUtils.makedirs(om, {:mode => 0755, :verbose => true})
104
- FileUtils.chmod(0755, om)
105
- FileUtils.install(mf, omf, {:mode => 0644, :verbose => true})
106
- gzip = %x{which gzip}
107
- gzip.chomp!
108
- %x{#{gzip} -f #{omf}}
102
+ omf = File.join(InstallOptions.man_dir, mf.gsub(/#{strip}/, ''))
103
+ om = File.dirname(omf)
104
+ FileUtils.makedirs(om, {:mode => 0755, :verbose => true})
105
+ FileUtils.chmod(0755, om)
106
+ FileUtils.install(mf, omf, {:mode => 0644, :verbose => true})
107
+ gzip = %x{which gzip}
108
+ gzip.chomp!
109
+ %x{#{gzip} -f #{omf}}
109
110
  end
111
+ else
112
+ puts "Skipping Man Page Generation"
113
+ end
110
114
  end
111
115
 
112
116
  # Verify that all of the prereqs are installed
@@ -121,6 +125,10 @@ def check_prereqs
121
125
  }
122
126
  end
123
127
 
128
+ def is_windows?
129
+ RUBY_PLATFORM.to_s.match(/mswin|win32|dos|cygwin|mingw/)
130
+ end
131
+
124
132
  ##
125
133
  # Prepare the file installation.
126
134
  #
@@ -128,7 +136,7 @@ def prepare_installation
128
136
  # Only try to do docs if we're sure they have rdoc
129
137
  if $haverdoc
130
138
  InstallOptions.rdoc = true
131
- if RUBY_PLATFORM == "i386-mswin32"
139
+ if is_windows?
132
140
  InstallOptions.ri = false
133
141
  else
134
142
  InstallOptions.ri = true
@@ -141,7 +149,7 @@ def prepare_installation
141
149
 
142
150
  if $haveman
143
151
  InstallOptions.man = true
144
- if RUBY_PLATFORM == "i386-mswin32"
152
+ if is_windows?
145
153
  InstallOptions.man = false
146
154
  end
147
155
  else
@@ -27,7 +27,7 @@ module Facter
27
27
  include Comparable
28
28
  include Enumerable
29
29
 
30
- FACTERVERSION = '1.5.8'
30
+ FACTERVERSION = '1.5.9'
31
31
  # = Facter
32
32
  # Functions as a hash of 'facts' you might care about about your
33
33
  # system, such as mac address, IP address, Video card, etc.
@@ -48,6 +48,7 @@ module Facter
48
48
  GREEN = ""
49
49
  RESET = ""
50
50
  @@debug = 0
51
+ @@timing = 0
51
52
 
52
53
  # module methods
53
54
 
@@ -77,6 +78,15 @@ module Facter
77
78
  @@debug != 0
78
79
  end
79
80
 
81
+ # show the timing information
82
+ def self.show_time(string)
83
+ puts "#{GREEN}#{string}#{RESET}" if string and Facter.timing?
84
+ end
85
+
86
+ def self.timing?
87
+ @@timing != 0
88
+ end
89
+
80
90
  # Return a fact object by name. If you use this, you still have to call
81
91
  # 'value' on it to retrieve the actual value.
82
92
  def self.[](name)
@@ -177,6 +187,22 @@ module Facter
177
187
  end
178
188
  end
179
189
 
190
+ # Set timing on or off.
191
+ def self.timing(bit)
192
+ if bit
193
+ case bit
194
+ when TrueClass; @@timing = 1
195
+ when Fixnum
196
+ if bit > 0
197
+ @@timing = 1
198
+ else
199
+ @@timing = 0
200
+ end
201
+ end
202
+ else
203
+ @@timing = 0
204
+ end
205
+ end
180
206
 
181
207
  def self.warn(msg)
182
208
  if Facter.debugging? and msg and not msg.empty?