@@ -92,7 +92,7 @@ def do_man(man, strip = 'man/')
92
92
FileUtils . install ( mf , omf , mode : 0644 , preserve : true , verbose : true )
93
93
# Solaris does not support gzipped man pages. When called with
94
94
# --no-check-prereqs/without facter the default gzip behavior still applies
95
- unless $operatingsystem == "Solaris"
95
+ unless $osname == "Solaris"
96
96
gzip = %x{which gzip}
97
97
gzip . chomp!
98
98
%x{#{ gzip } -f #{ omf } }
@@ -234,56 +234,56 @@ def prepare_installation
234
234
RbConfig ::CONFIG [ 'bindir' ] = "/usr/bin"
235
235
end
236
236
237
- # Here we only set $operatingsystem if we have opted to check for prereqs.
237
+ # Here we only set $osname if we have opted to check for prereqs.
238
238
# Otherwise facter won't be guaranteed to be present.
239
239
if InstallOptions . check_prereqs
240
240
check_prereqs
241
- $operatingsystem = Facter . value :operatingsystem
241
+ $osname = Facter . value ( 'os.name' )
242
242
end
243
243
244
244
if not InstallOptions . configdir . nil?
245
245
configdir = InstallOptions . configdir
246
- elsif $operatingsystem == "windows"
246
+ elsif $osname == "windows"
247
247
configdir = File . join ( ENV [ 'ALLUSERSPROFILE' ] , "PuppetLabs" , "puppet" , "etc" )
248
248
else
249
249
configdir = "/etc/puppetlabs/puppet"
250
250
end
251
251
252
252
if not InstallOptions . codedir . nil?
253
253
codedir = InstallOptions . codedir
254
- elsif $operatingsystem == "windows"
254
+ elsif $osname == "windows"
255
255
codedir = File . join ( ENV [ 'ALLUSERSPROFILE' ] , "PuppetLabs" , "code" )
256
256
else
257
257
codedir = "/etc/puppetlabs/code"
258
258
end
259
259
260
260
if not InstallOptions . vardir . nil?
261
261
vardir = InstallOptions . vardir
262
- elsif $operatingsystem == "windows"
262
+ elsif $osname == "windows"
263
263
vardir = File . join ( ENV [ 'ALLUSERSPROFILE' ] , "PuppetLabs" , "puppet" , "cache" )
264
264
else
265
265
vardir = "/opt/puppetlabs/puppet/cache"
266
266
end
267
267
268
268
if not InstallOptions . publicdir . nil?
269
269
publicdir = InstallOptions . publicdir
270
- elsif $operatingsystem == "windows"
270
+ elsif $osname == "windows"
271
271
publicdir = File . join ( ENV [ 'ALLUSERSPROFILE' ] , "PuppetLabs" , "puppet" , "public" )
272
272
else
273
273
publicdir = "/opt/puppetlabs/puppet/public"
274
274
end
275
275
276
276
if not InstallOptions . rundir . nil?
277
277
rundir = InstallOptions . rundir
278
- elsif $operatingsystem == "windows"
278
+ elsif $osname == "windows"
279
279
rundir = File . join ( ENV [ 'ALLUSERSPROFILE' ] , "PuppetLabs" , "puppet" , "var" , "run" )
280
280
else
281
281
rundir = "/var/run/puppetlabs"
282
282
end
283
283
284
284
if not InstallOptions . logdir . nil?
285
285
logdir = InstallOptions . logdir
286
- elsif $operatingsystem == "windows"
286
+ elsif $osname == "windows"
287
287
logdir = File . join ( ENV [ 'ALLUSERSPROFILE' ] , "PuppetLabs" , "puppet" , "var" , "log" )
288
288
else
289
289
logdir = "/var/log/puppetlabs/puppet"
@@ -298,7 +298,7 @@ def prepare_installation
298
298
if not InstallOptions . localedir . nil?
299
299
localedir = InstallOptions . localedir
300
300
else
301
- if $operatingsystem == "windows"
301
+ if $osname == "windows"
302
302
localedir = File . join ( ENV [ 'PROGRAMFILES' ] , "Puppet Labs" , "Puppet" , "puppet" , "share" , "locale" )
303
303
else
304
304
localedir = "/opt/puppetlabs/puppet/share/locale"
@@ -376,7 +376,7 @@ def prepare_installation
376
376
# by stripping the drive letter, but only if the basedir is not empty.
377
377
#
378
378
def join ( basedir , dir )
379
- return "#{ basedir } #{ dir [ 2 ..-1 ] } " if $operatingsystem == "windows" and basedir . length > 0 and dir . length > 2
379
+ return "#{ basedir } #{ dir [ 2 ..-1 ] } " if $osname == "windows" and basedir . length > 0 and dir . length > 2
380
380
381
381
"#{ basedir } #{ dir } "
382
382
end
@@ -398,7 +398,7 @@ def build_rdoc(files)
398
398
399
399
def build_ri ( files )
400
400
return unless $haverdoc
401
- return if $operatingsystem == "windows"
401
+ return if $osname == "windows"
402
402
begin
403
403
ri = RDoc ::RDoc . new
404
404
#ri.document(["--ri-site", "--merge"] + files)
@@ -427,14 +427,14 @@ def install_binfile(from, op_file, target)
427
427
428
428
File . open ( from ) do |ip |
429
429
File . open ( tmp_file . path , "w" ) do |op |
430
- op . puts "#!#{ ruby } " unless $operatingsystem == "windows"
430
+ op . puts "#!#{ ruby } " unless $osname == "windows"
431
431
contents = ip . readlines
432
432
contents . shift if contents [ 0 ] =~ /^#!/
433
433
op . write contents . join
434
434
end
435
435
end
436
436
437
- if $operatingsystem == "windows" && InstallOptions . batch_files
437
+ if $osname == "windows" && InstallOptions . batch_files
438
438
installed_wrapper = false
439
439
440
440
unless File . extname ( from ) =~ /\. (cmd|bat)/
@@ -484,16 +484,16 @@ def install_binfile(from, op_file, target)
484
484
485
485
prepare_installation
486
486
487
- if $operatingsystem == "windows"
487
+ if $osname == "windows"
488
488
windows_bins = glob ( %w{ ext/windows/*bat } )
489
489
end
490
490
491
491
#build_rdoc(rdoc) if InstallOptions.rdoc
492
492
#build_ri(ri) if InstallOptions.ri
493
493
do_configs ( configs , InstallOptions . config_dir ) if InstallOptions . configs
494
494
do_bins ( bins , InstallOptions . bin_dir )
495
- do_bins ( windows_bins , InstallOptions . bin_dir , 'ext/windows/' ) if $operatingsystem == "windows" && InstallOptions . batch_files
495
+ do_bins ( windows_bins , InstallOptions . bin_dir , 'ext/windows/' ) if $osname == "windows" && InstallOptions . batch_files
496
496
do_libs ( libs )
497
497
do_locales ( locales )
498
- do_man ( man ) unless $operatingsystem == "windows"
498
+ do_man ( man ) unless $osname == "windows"
499
499
end
0 commit comments