facter 1.5.7 → 1.5.8
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.
- data/CHANGELOG +105 -28
- data/Rakefile +23 -20
- data/bin/facter +3 -3
- data/conf/osx/createpackage.sh +12 -1
- data/conf/osx/preflight +4 -0
- data/install.rb +7 -14
- data/lib/facter.rb +14 -2
- data/lib/facter/architecture.rb +10 -2
- data/lib/facter/domain.rb +0 -3
- data/lib/facter/ipaddress.rb +18 -21
- data/lib/facter/kernel.rb +4 -2
- data/lib/facter/macaddress.rb +21 -8
- data/lib/facter/memory.rb +47 -6
- data/lib/facter/operatingsystem.rb +4 -0
- data/lib/facter/operatingsystemrelease.rb +15 -3
- data/lib/facter/processor.rb +16 -0
- data/lib/facter/uptime.rb +17 -14
- data/lib/facter/uptime_days.rb +7 -0
- data/lib/facter/uptime_hours.rb +7 -0
- data/lib/facter/uptime_seconds.rb +10 -0
- data/lib/facter/util/ip.rb +17 -5
- data/lib/facter/util/manufacturer.rb +13 -7
- data/lib/facter/util/resolution.rb +34 -11
- data/lib/facter/util/uptime.rb +45 -23
- data/lib/facter/util/virtual.rb +23 -1
- data/lib/facter/util/vlans.rb +24 -0
- data/lib/facter/virtual.rb +11 -3
- data/lib/facter/vlans.rb +8 -0
- data/spec/fixtures/uptime/sysctl_kern_boottime +0 -0
- data/spec/fixtures/uptime/ubuntu_proc_uptime +1 -0
- data/spec/fixtures/uptime/who_b_boottime +1 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/unit/data/freebsd_dmidecode +42 -0
- data/spec/unit/data/hpux_ifconfig +3 -0
- data/spec/unit/data/hpux_ifconfig_single_interface +3 -0
- data/spec/unit/data/hpux_netscan +4 -0
- data/spec/unit/data/hpux_netstat_all_interfaces +6 -0
- data/spec/unit/data/linux_dmidecode_with_spaces +60 -0
- data/spec/unit/data/linux_vlan_config +6 -0
- data/spec/unit/data/opensolaris_smbios +33 -0
- data/spec/unit/facter.rb +73 -0
- data/spec/unit/operatingsystemrelease.rb +39 -0
- data/spec/unit/uptime.rb +112 -0
- data/spec/unit/util/ip.rb +59 -2
- data/spec/unit/util/manufacturer.rb +121 -0
- data/spec/unit/util/resolution.rb +44 -11
- data/spec/unit/util/uptime.rb +53 -0
- data/spec/unit/util/virtual.rb +24 -1
- data/spec/unit/util/vlans.rb +14 -0
- data/spec/unit/virtual.rb +20 -0
- metadata +115 -91
- data/ChangeLog +0 -1727
data/CHANGELOG
CHANGED
@@ -1,9 +1,78 @@
|
|
1
|
+
1.5.8
|
2
|
+
=====
|
3
|
+
ca2da36 Updated install.rb and created man page
|
4
|
+
3671c9f [#4583] Refactor uptime to use Resolution.exec
|
5
|
+
fca8861 [#4594] Reintroduce fix for #1291 from original patch
|
6
|
+
32c0cb0 [#4594] Revert "fixes #2573, #2085, #1291..."
|
7
|
+
e7df4c0 Updated CHANGELOG for 1.5.8rc2
|
8
|
+
9c9cabd Better fix for Bug 4569: Uptime Fact is incorrect on Windows
|
9
|
+
01a515f [#4289] operatingsystemrelease fact for oel, ovs
|
10
|
+
b6c0a6b Fix for bug #4569
|
11
|
+
51bcebe Fixed Rakefile package task version detection
|
12
|
+
81ccb48 Removed references to Reductive Labs in the Rakefile
|
13
|
+
|
14
|
+
1.5.8rc1
|
15
|
+
========
|
16
|
+
f280703 Incremented version to 1.5.8
|
17
|
+
98ef5e8 Updated CHANGELOG for 1.5.8rc1
|
18
|
+
4398b36 Updated CHANGELOG rake task
|
19
|
+
e02be1d [#4156] Updating spec to match Kai's change
|
20
|
+
bff84c2 [#4156] Applying patch by Kai
|
21
|
+
b7fe989 [#2330] Update uptime calculation to use /bin/cat
|
22
|
+
e9a60bc Facter::Manufacturer - sunos test + simplified regex
|
23
|
+
be411c0 Facter::Manufacturer - test for SunOS and FreeBSD
|
24
|
+
67f6604 [#4062] Implement operating system facts for MeeGo
|
25
|
+
a2bcacd [#2330] Uptime should not make redundant system calls
|
26
|
+
ce7bd9f Refactor rakefile to use spec.ops, separate rcov task
|
27
|
+
faaa169 Fix #4352 - Support for detecting KVM virtuals on FreeBSD
|
28
|
+
82286e4 Fix #4352 - Support for detecting virtuals (jails) on FreeBSD
|
29
|
+
b2c2114 Properly wrapped the windows ipaddress fact in a setcode block.
|
30
|
+
1bd2ca2 Fixed #3929 - Added user confine to AIX memory facts
|
31
|
+
8106bc3 Adding HP-UX support to Facter's IP facts
|
32
|
+
83b3ea6 Fixed #3393 - Updates to Facter for MS Windows
|
33
|
+
ffcae46 Fixed #3403 - Added fact to query vlans; added spec test
|
34
|
+
d4b8401 Merged Jos Backus patch to remove requirement for ftools altogether
|
35
|
+
73dcbb9 Fixed #2355 read hang on /proc/xen/capabilties on RHEL 4.7
|
36
|
+
d109def Fix #1365 - load all facts via cli
|
37
|
+
6c87917 Fixed failing test introduced by previous commit
|
38
|
+
c5b8d3b Fixes #3740 - split dmi output on regex
|
39
|
+
25bf5c2 Fix virtual unit test on non-linux by stubbing kernel
|
40
|
+
9a00eae Fixed #2313 - Somewhat essential hardware facts not available on OpenBSD, patch included
|
41
|
+
e19024b Fixed #2938 - interfaces that don't match ^\w+[.:]?\d+ are ignored
|
42
|
+
97879f9 Added support for Slackware in operatingsystem and operatingsystemrelease
|
43
|
+
802e6c2 Fixed #3542 - Ruby 1.9: broken unittest, String#each no longer exists
|
44
|
+
2f016f3 Fixed #3541 - Ruby 1.9: broken unittest, unexpected invocation: Process.waitall()
|
45
|
+
84d3d9f Fixed #3445 - Facter does not handle solaris branded zones properly
|
46
|
+
b5a8de0 Fix for #3411 install.rb should not put "." first in the tmp_dirs
|
47
|
+
8ea33eb Fixed #3447 - OVS and OEL not matching in operatingsystemrelease
|
48
|
+
aeee83c Fixed #3410 - Warnings in rake spec
|
49
|
+
8bf8cb5 Fixes #3397 - is_virtual fact does not detect Linux-VServer
|
50
|
+
62b6773 Add kvm support to virtual fact
|
51
|
+
dca615c fixes #2573, #2085, #1291 - fixes domain and fqdn facts resolution
|
52
|
+
86447c8 Revert "use popen3 in Resolution.exec"
|
53
|
+
7750f03 Fix #2341 - stricter handling of dmidecode split
|
54
|
+
f4269d9 Fix #2746 - add architecture support for GNU/kFreeBSD
|
55
|
+
50cef83 Fix missing error case
|
56
|
+
356cf15 Remove whitespace in DMI facts (#3008, #3011)
|
57
|
+
feecd39 Only ignore IPs starting with 127.
|
58
|
+
68fc123 Added package signing task
|
59
|
+
33fb770 use popen3 in Resolution.exec to catch stderr
|
60
|
+
8109806 introduce a warn mechanism for debugging
|
61
|
+
b2c1ca5 Add docs to Mac OS X package creation script and clean out old docs in the preflight
|
62
|
+
5412eab Fixed : 2788 - ftools missing in Ruby 1.9
|
63
|
+
5b95a12 Fixes #2704. Problem finding install.rb three levels up
|
64
|
+
9aef69e Removed all ChangeLog
|
65
|
+
|
1
66
|
1.5.7
|
2
67
|
=====
|
68
|
+
3a39dd8 Updated ChangeLog and task
|
3
69
|
07dca60 Added additional exclusion to rcov process
|
4
70
|
8398238 Added rcov support to spec task
|
5
71
|
7194454 Updated CI Rake task
|
6
72
|
2472048 Clarify licensing as GPLv2 (or any later version)
|
73
|
+
|
74
|
+
1.5.7rc1
|
75
|
+
========
|
7
76
|
4bc05e9 Added new format ChangeLog
|
8
77
|
5bc8db3 Incremented version and updated CHANGELOG
|
9
78
|
eb3a8a7 Issue #2414 - add unit test
|
@@ -17,7 +86,7 @@ bfe8a2a Fix 2455 - improve error handling on fact load
|
|
17
86
|
5982deb Added default Rake task
|
18
87
|
0e0483a Fix bug where you'd get an 'undefined method' error if trying to access a fact's value when collection has not being yet initialized.
|
19
88
|
fe41fb8 Fix #2470 - duplicate entries in interfaces fact
|
20
|
-
be9e484 Update OS X minor version fact to cope with '10.x' values and provide test coverage
|
89
|
+
be9e484 Update OS X minor version fact to cope with '10.x' values and provide test coverage switch %x{} call to Facter::Util::Resolution.exec for better testing
|
21
90
|
f3ad66f Update install.rb to cope with all OS X versions, not just 10.5
|
22
91
|
c02d3b6 Issue #2292 Add tests for virtual facts
|
23
92
|
6c9fec5 Added path fact
|
@@ -36,29 +105,21 @@ ba44f08 Removed --no-thread and --no-chain-reply-to from rake mail_patches task
|
|
36
105
|
806f49f Added facter branding to format patch command
|
37
106
|
96c015c Added spec.executables to Facter gemspec in Rakefile
|
38
107
|
d97a63e Sync rpm spec file with latest from Fedora/EPEL
|
108
|
+
|
109
|
+
1.5.5
|
110
|
+
=====
|
39
111
|
dad4569 Added path to Rakefile
|
40
112
|
365cb8e CHANGELOG updates
|
41
113
|
68e0b24 Fix #2278 Revert fix for 2120
|
42
114
|
b533e78 Tighten operatingsystemrelease regex on CentOS < 5
|
43
115
|
48aa135 Fix operatingsystemrelease for CentOS < 5
|
44
|
-
253fef1 Added spec files to package list
|
116
|
+
253fef1 Added spec files to package list Fixed CI rake tasks
|
45
117
|
b37d683 Added install.rb to Rakefile package task
|
46
118
|
7995d05 Bumped release to 1.5.5rc2
|
47
119
|
|
48
120
|
1.5.5rc2
|
49
121
|
========
|
50
122
|
1de8891 Bumped release to 1.5.5rc2
|
51
|
-
|
52
|
-
1.5.5
|
53
|
-
=====
|
54
|
-
dad4569 Added path to Rakefile
|
55
|
-
365cb8e CHANGELOG updates
|
56
|
-
68e0b24 Fix #2278 Revert fix for 2120
|
57
|
-
b533e78 Tighten operatingsystemrelease regex on CentOS < 5
|
58
|
-
48aa135 Fix operatingsystemrelease for CentOS < 5
|
59
|
-
253fef1 Added spec files to package list
|
60
|
-
b37d683 Added install.rb to Rakefile package task
|
61
|
-
7995d05 Bumped release to 1.5.5rc2
|
62
123
|
56760d3 Facter #2120 - Solaris support for Facter[virtual]
|
63
124
|
2fb91ca Tests for #2227 - multiple interfaces on Darwin
|
64
125
|
00b192a Added SELinux tests
|
@@ -98,14 +159,6 @@ b6f0f99 more consistent indentation and alignment. also removal of trailing whi
|
|
98
159
|
9bc174f Further fix #2032 - close IO
|
99
160
|
6b904a0 Added EC2 facts
|
100
161
|
86b01bf Fixed #2032 - file.open hanging on /proc/uptime on some platform
|
101
|
-
91d8cb7 Updated to version 1.5.4
|
102
|
-
a99d043 Fixed #1966 - Added physicalprocessorcount fact
|
103
|
-
94ea807 This commit refs #1555, #1898 and fixes #1761
|
104
|
-
04389db Added support for Oracle VM Server to operatingsystem and operatingsystemrelease
|
105
|
-
552f150 Added support for Oracle Enterprise Linux to operatingsystem
|
106
|
-
a932a69 Added README.rst for Facter
|
107
|
-
e52f962 Added Reductive Labs build library
|
108
|
-
0726437 Updated README
|
109
162
|
|
110
163
|
1.5.4
|
111
164
|
=====
|
@@ -113,10 +166,13 @@ e52f962 Added Reductive Labs build library
|
|
113
166
|
a99d043 Fixed #1966 - Added physicalprocessorcount fact
|
114
167
|
94ea807 This commit refs #1555, #1898 and fixes #1761
|
115
168
|
04389db Added support for Oracle VM Server to operatingsystem and operatingsystemrelease
|
116
|
-
552f150 Added support for Oracle Enterprise Linux to operatingsystem
|
169
|
+
552f150 Added support for Oracle Enterprise Linux to operatingsystem and operatingsystemrelease
|
117
170
|
a932a69 Added README.rst for Facter
|
118
171
|
e52f962 Added Reductive Labs build library
|
119
172
|
0726437 Updated README
|
173
|
+
|
174
|
+
1.5.4rc1
|
175
|
+
========
|
120
176
|
f4bc74d Fixing #1927 - failing facts don't kill Facter
|
121
177
|
063e4dc Fixed #1850 - Facter updates for Ruby 1.9
|
122
178
|
b85ab0a Fixed #1924 - Fixed lo / lo:0 local interface matching
|
@@ -130,7 +186,7 @@ d9eef19 Added timezone fact
|
|
130
186
|
=====
|
131
187
|
b86a1fb Updated to version 1.5.3
|
132
188
|
a73e803 Fixing the usage of the macosx util module; I somehow missed renaming it here
|
133
|
-
23289bd Fixed uptime refactor issues on non-Linux platforms
|
189
|
+
23289bd Fixed uptime refactor issues on non-Linux platforms Signed-off-by: James Turnbull <james@lovedthanlost.net>
|
134
190
|
a194c91 Adding mail_patches rake task
|
135
191
|
a82f476 Renaming Facter::Macosx to Facter::Util::Macosx
|
136
192
|
1f1fa9b Fixing #1838 - profiler failures don't throw exceptions
|
@@ -152,7 +208,7 @@ a70184a Fixed #1791 - support for virtual fact on Solaris 10
|
|
152
208
|
85b2a55 minor fix to operatingsystemversion to correctly parse /etc/release on OpenSolaris 2008.11.
|
153
209
|
8247304 Fixed errors on unrecognised option in binary
|
154
210
|
0fe4611 Added ci namespace and Rake tasks
|
155
|
-
7ddea77 Fix for #1727 - id fact should not rely on whoami on Solaris
|
211
|
+
7ddea77 Fix for #1727 - id fact should not rely on whoami on Solaris Signed-off-by: Martin Englund <martin@englund.nu>
|
156
212
|
f9a346a Sync specfile with latest from Fedora
|
157
213
|
fd07cd2 Removed EPM task
|
158
214
|
43d0aea Fixed #1697 - Typo in ipaddress.rb causes timeout under Solaris 10 SPARC
|
@@ -203,7 +259,7 @@ b91ee5e Remove duplicated code paths
|
|
203
259
|
df8fc8c fix terrible error with overwriting permissions
|
204
260
|
91ca4ab Fixed #1490 - Added virtual fact
|
205
261
|
ff45c86 Feature #1487: Package creation scripts for Mac OS X
|
206
|
-
9b42182 Modified the operatingsystem fact for Debian so it looks in
|
262
|
+
9b42182 Modified the operatingsystem fact for Debian so it looks in /etc/debian_version instead of /proc/version.
|
207
263
|
e1023de Feature #1478: Allow specification of --bindir --sbindir --sitelibdir --mandir --destdir in install.rb
|
208
264
|
845ae94 Feature #1475: CONFIG['bindir'] CONFIG['sbindir'] have undesirable defaults on OS X 10.5
|
209
265
|
a12608e Fixes #1467 - macaddress not set on Ubuntu
|
@@ -218,6 +274,9 @@ dc7363e Set macaddress on windows platform
|
|
218
274
|
ded53b0 Fixed Rakefile to include additional files including tests et al
|
219
275
|
1cf98d1 Adjusted version to be in line with previous standard
|
220
276
|
ff0e90b Adding (apparently now required) author info to the gem spec
|
277
|
+
|
278
|
+
1.5
|
279
|
+
===
|
221
280
|
7042c46 Updated to version 1.5
|
222
281
|
e98efd3 Updated to version 1.5
|
223
282
|
d49d63c Updating the changelog for 1.5
|
@@ -237,7 +296,7 @@ e22b408 Changed 'timeout' option to 'limit'
|
|
237
296
|
def18b5 Fixes #1357 - change ps syntax for OSX and BSD
|
238
297
|
ce7b74c Rejustifying all of the whitespace in the facts, yay.
|
239
298
|
2ee5d29 Refactoring how recursive searches are detected.
|
240
|
-
d322df9 Refactored so each fact resolution can specify a separate timeout,
|
299
|
+
d322df9 Refactored so each fact resolution can specify a separate timeout, but the default is still 0.5.
|
241
300
|
9a1882e Retrieve hardwaremodel for AIX from sys0 modelname.
|
242
301
|
b574c6a Refactered ipmess.rb and util/ip.rb to support separate *BSD logic for *BSD aliased interfaces.
|
243
302
|
d9bd388 Refactor of netmask fact - fixes ticket #66
|
@@ -277,7 +336,7 @@ fef9b7d fixing whitespace
|
|
277
336
|
567549b Closes #1145 - fixed bad interface names by replacing : with _
|
278
337
|
d449472 Updated CHANGELOG
|
279
338
|
bd3b316 removing .swp file
|
280
|
-
e11edfb Switching from test/unit to rspec, and fixing a couple
|
339
|
+
e11edfb Switching from test/unit to rspec, and fixing a couple of small test failures.
|
281
340
|
1a5ba71 Fixed Solaris detection of lo0 for ticket #46
|
282
341
|
92b43e0 Added require util ip.rb file
|
283
342
|
0c4ac42 Fixed #46 - refactor ipmess.rb
|
@@ -307,7 +366,7 @@ dce6245 Revert "Adjusted :kernel confine to make it more in line with others"
|
|
307
366
|
c5e6f60 Adjusted :kernel confine to make it more in line with others
|
308
367
|
a4698ce Updated CHANGELOG
|
309
368
|
8b08d5f Added support to return multiple interfaces and their IP addresses as facts. Existing ipaddress fact which returns IP address of first interface on node is still available. Currently Linux only. Closes #6
|
310
|
-
6113375 Added macaddress fact support for FreeBSD and OpenBSD - closes #37
|
369
|
+
6113375 Added macaddress fact support for FreeBSD and OpenBSD - closes #37 Added hardwareisa support for *BSD platforms - closed #38 Facter now detects the Mandriva distribution - closes #39 Facter now correctly detects ipaddress on NetBSD - closes #42
|
311
370
|
8426aaf making the install script executable
|
312
371
|
f35ee22 Drastically speeding up the lsb data retrieval, and refactoring the dmidecode data so it is a bit cleaner and does not produce extraneous output or errors
|
313
372
|
20986d9 Set operatingsystemrelease to the major release on RHEL and Fedora
|
@@ -414,6 +473,10 @@ b543152 Updated for use with latest Fedora ruby packages
|
|
414
473
|
15f2f44 Updated to version 1.3
|
415
474
|
15931ef Updated to version 1.3
|
416
475
|
261d909 Updated to version 1.3
|
476
|
+
|
477
|
+
1.3
|
478
|
+
===
|
479
|
+
92c48b9 Adding release tag REL_1_3
|
417
480
|
539d593 fixing installer so it does not install batch files on darwin
|
418
481
|
4c1d5e0 trying to fix facterbin rubylib setting
|
419
482
|
7f2504d fixing test so that it works even if rubylib is not set
|
@@ -495,3 +558,17 @@ a295c73 Fixing bug when a fact with no resolutions is asked for
|
|
495
558
|
d9c86d5 updating everything to essentially disable docs generation
|
496
559
|
64a86db Adding Release tag
|
497
560
|
|
561
|
+
1.0.2
|
562
|
+
=====
|
563
|
+
8c91fb1 adding release tag
|
564
|
+
1dc02f9 adding extra "return nil" statements, and hopefully fixing the test for cygwin
|
565
|
+
b542ec5 Updated to version 1.0.2
|
566
|
+
f1c8f10 adding changelog
|
567
|
+
7df3411 adding fixes Eric Sorenson found with cygwin
|
568
|
+
c646434 updates
|
569
|
+
fe90bf1 Updated to version 1.0.1
|
570
|
+
3f0186d Modified version
|
571
|
+
58538d2 removing filehandle-based tests
|
572
|
+
8cb9662 updating INSTALL with patch from ian
|
573
|
+
7cec936 moving things to the trunk
|
574
|
+
|
data/Rakefile
CHANGED
@@ -3,13 +3,23 @@
|
|
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'
|
8
|
+
begin
|
9
|
+
require 'rcov'
|
10
|
+
rescue LoadError
|
11
|
+
end
|
12
|
+
|
6
13
|
Dir['tasks/**/*.rake'].each { |t| load t }
|
7
14
|
|
8
|
-
require './lib/facter.rb'
|
9
15
|
require 'rake'
|
10
16
|
require 'rake/packagetask'
|
11
17
|
require 'rake/gempackagetask'
|
12
18
|
|
19
|
+
module Facter
|
20
|
+
FACTERVERSION = File.read('lib/facter.rb')[/FACTERVERSION *= *'(.*)'/,1] or fail "Couldn't find FACTERVERSION"
|
21
|
+
end
|
22
|
+
|
13
23
|
FILES = FileList[
|
14
24
|
'[A-Z]*',
|
15
25
|
'install.rb',
|
@@ -27,9 +37,9 @@ spec = Gem::Specification.new do |spec|
|
|
27
37
|
spec.executables = %w{facter}
|
28
38
|
spec.version = Facter::FACTERVERSION
|
29
39
|
spec.summary = 'Facter, a system inventory tool'
|
30
|
-
spec.author = '
|
31
|
-
spec.email = '
|
32
|
-
spec.homepage = 'http://
|
40
|
+
spec.author = 'Puppet Labs'
|
41
|
+
spec.email = 'info@puppetlabs.com'
|
42
|
+
spec.homepage = 'http://puppetlabs.com'
|
33
43
|
spec.rubyforge_project = 'facter'
|
34
44
|
spec.has_rdoc = true
|
35
45
|
spec.rdoc_options <<
|
@@ -51,21 +61,14 @@ task :default do
|
|
51
61
|
sh %{rake -T}
|
52
62
|
end
|
53
63
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
require 'spec/rake/spectask'
|
58
|
-
begin
|
59
|
-
require 'rcov'
|
60
|
-
rescue LoadError
|
61
|
-
end
|
64
|
+
Spec::Rake::SpecTask.new(:spec) do |t|
|
65
|
+
t.spec_files = FileList['spec/**/*.rb']
|
66
|
+
end
|
62
67
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
end
|
70
|
-
end
|
68
|
+
Spec::Rake::SpecTask.new('spec:rcov') do |t|
|
69
|
+
t.spec_files = FileList['spec/**/*.rb']
|
70
|
+
if defined?(Rcov)
|
71
|
+
t.rcov = true
|
72
|
+
t.rcov_opts = ['--exclude', 'spec/*,test/*,results/*,/usr/lib/*,/usr/local/lib/*,gems/*']
|
73
|
+
end
|
71
74
|
end
|
data/bin/facter
CHANGED
data/conf/osx/createpackage.sh
CHANGED
@@ -37,7 +37,7 @@ function find_installer() {
|
|
37
37
|
elif [ -f "../${INSTALLRB}" ]; then
|
38
38
|
installer="$(pwd)/../${INSTALLRB}"
|
39
39
|
elif [ -f "../../${INSTALLRB}" ]; then
|
40
|
-
installer="$(pwd)
|
40
|
+
installer="$(pwd)/../../${INSTALLRB}"
|
41
41
|
else
|
42
42
|
installer=""
|
43
43
|
fi
|
@@ -54,6 +54,17 @@ function install_facter() {
|
|
54
54
|
chown -R root:admin "${pkgroot}"
|
55
55
|
}
|
56
56
|
|
57
|
+
function install_docs() {
|
58
|
+
echo "Installing docs to ${pkgroot}"
|
59
|
+
docdir="${pkgroot}/usr/share/doc/facter"
|
60
|
+
mkdir -p "${docdir}"
|
61
|
+
for docfile in ChangeLog COPYING LICENSE README README.rst TODO; do
|
62
|
+
install -m 0644 "${facter_root}/${docfile}" "${docdir}"
|
63
|
+
done
|
64
|
+
chown -R root:wheel "${docdir}"
|
65
|
+
chmod 0755 "${docdir}"
|
66
|
+
}
|
67
|
+
|
57
68
|
function get_facter_version() {
|
58
69
|
facter_version=$(RUBYLIB="${pkgroot}/${SITELIBDIR}:${RUBYLIB}" ruby -e "require 'facter'; puts Facter.version")
|
59
70
|
}
|
data/conf/osx/preflight
CHANGED
data/install.rb
CHANGED
@@ -35,7 +35,6 @@
|
|
35
35
|
require 'rbconfig'
|
36
36
|
require 'find'
|
37
37
|
require 'fileutils'
|
38
|
-
require 'ftools' # apparently on some system ftools doesn't get loaded
|
39
38
|
require 'optparse'
|
40
39
|
require 'ostruct'
|
41
40
|
|
@@ -91,9 +90,9 @@ def do_libs(libs, strip = 'lib/')
|
|
91
90
|
libs.each do |lf|
|
92
91
|
olf = File.join(InstallOptions.site_dir, lf.gsub(/#{strip}/, ''))
|
93
92
|
op = File.dirname(olf)
|
94
|
-
|
95
|
-
|
96
|
-
|
93
|
+
FileUtils.makedirs(op, {:mode => 0755, :verbose => true})
|
94
|
+
FileUtils.chmod(0755, op)
|
95
|
+
FileUtils.install(lf, olf, {:mode => 0644, :verbose => true})
|
97
96
|
end
|
98
97
|
end
|
99
98
|
|
@@ -101,9 +100,9 @@ def do_man(man, strip = 'man/')
|
|
101
100
|
man.each do |mf|
|
102
101
|
omf = File.join(InstallOptions.man_dir, mf.gsub(/#{strip}/, ''))
|
103
102
|
om = File.dirname(omf)
|
104
|
-
|
105
|
-
|
106
|
-
|
103
|
+
FileUtils.makedirs(om, {:mode => 0755, :verbose => true})
|
104
|
+
FileUtils.chmod(0755, om)
|
105
|
+
FileUtils.install(mf, omf, {:mode => 0644, :verbose => true})
|
107
106
|
gzip = %x{which gzip}
|
108
107
|
gzip.chomp!
|
109
108
|
%x{#{gzip} -f #{omf}}
|
@@ -200,7 +199,7 @@ def prepare_installation
|
|
200
199
|
opts.parse!
|
201
200
|
end
|
202
201
|
|
203
|
-
tmpdirs = [
|
202
|
+
tmpdirs = [ENV['TMP'], ENV['TEMP'], "/tmp", "/var/tmp", "."]
|
204
203
|
|
205
204
|
version = [Config::CONFIG["MAJOR"], Config::CONFIG["MINOR"]].join(".")
|
206
205
|
libdir = File.join(Config::CONFIG["libdir"], "ruby", version)
|
@@ -317,12 +316,6 @@ def build_man(bins)
|
|
317
316
|
# Locate rst2man
|
318
317
|
rst2man = %x{which rst2man.py}
|
319
318
|
rst2man.chomp!
|
320
|
-
# Create puppet.conf.8 man page
|
321
|
-
%x{bin/puppetdoc --reference configuration > ./puppet.conf.rst}
|
322
|
-
%x{#{rst2man} ./puppet.conf.rst ./man/man8/puppet.conf.8}
|
323
|
-
File.unlink("./puppet.conf.rst")
|
324
|
-
|
325
|
-
# Create binary man pages
|
326
319
|
bins.each do |bin|
|
327
320
|
b = bin.gsub( "bin/", "")
|
328
321
|
%x{#{bin} --help > ./#{b}.rst}
|
data/lib/facter.rb
CHANGED
@@ -27,7 +27,7 @@ module Facter
|
|
27
27
|
include Comparable
|
28
28
|
include Enumerable
|
29
29
|
|
30
|
-
FACTERVERSION = '1.5.
|
30
|
+
FACTERVERSION = '1.5.8'
|
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.
|
@@ -68,11 +68,15 @@ module Facter
|
|
68
68
|
if string.nil?
|
69
69
|
return
|
70
70
|
end
|
71
|
-
if
|
71
|
+
if self.debugging?
|
72
72
|
puts GREEN + string + RESET
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
def self.debugging?
|
77
|
+
@@debug != 0
|
78
|
+
end
|
79
|
+
|
76
80
|
# Return a fact object by name. If you use this, you still have to call
|
77
81
|
# 'value' on it to retrieve the actual value.
|
78
82
|
def self.[](name)
|
@@ -173,6 +177,14 @@ module Facter
|
|
173
177
|
end
|
174
178
|
end
|
175
179
|
|
180
|
+
|
181
|
+
def self.warn(msg)
|
182
|
+
if Facter.debugging? and msg and not msg.empty?
|
183
|
+
msg = [msg] unless msg.respond_to? :each
|
184
|
+
msg.each { |line| Kernel.warn line }
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
176
188
|
# Remove them all.
|
177
189
|
def self.reset
|
178
190
|
@collection = nil
|