~ubuntu-branches/ubuntu/trusty/puppet/trusty

« back to all changes in this revision

Viewing changes to install.rb

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-22 14:08:22 UTC
  • mfrom: (1.1.25) (3.1.32 sid)
  • Revision ID: package-import@ubuntu.com-20111022140822-odxde5lohc45yhuz
Tags: 2.7.6-1
* New upstream release (CVE-2011-3872)
* Remove cherry-picked "groupadd_aix_warning" patch
* Install all new manpages

Show diffs side-by-side

added added

removed removed

Lines of Context:
243
243
 
244
244
  if not InstallOptions.configdir.nil?
245
245
    configdir = InstallOptions.configdir
 
246
  elsif $operatingsystem == "windows"
 
247
    begin
 
248
      require 'win32/dir'
 
249
    rescue LoadError => e
 
250
      puts "Cannot run on Microsoft Windows without the sys-admin, win32-process, win32-dir & win32-service gems: #{e}"
 
251
      exit -1
 
252
    end
 
253
    configdir = File.join(Dir::COMMON_APPDATA, "PuppetLabs", "puppet", "etc")
246
254
  else
247
255
    configdir = "/etc/puppet"
248
256
  end
283
291
  if not InstallOptions.destdir.nil?
284
292
    destdir = InstallOptions.destdir
285
293
  # To be deprecated once people move over to using --destdir option
286
 
  elsif ENV['DESTDIR'] != nil?
 
294
  elsif not ENV['DESTDIR'].nil?
287
295
    destdir = ENV['DESTDIR']
288
296
    warn "DESTDIR is deprecated. Use --destdir instead."
289
297
  else
290
298
    destdir = ''
291
299
  end
292
300
 
293
 
  configdir = "#{destdir}#{configdir}"
294
 
  bindir = "#{destdir}#{bindir}"
295
 
  sbindir = "#{destdir}#{sbindir}"
296
 
  mandir = "#{destdir}#{mandir}"
297
 
  sitelibdir = "#{destdir}#{sitelibdir}"
 
301
  configdir = join(destdir, configdir)
 
302
  bindir = join(destdir, bindir)
 
303
  sbindir = join(destdir, sbindir)
 
304
  mandir = join(destdir, mandir)
 
305
  sitelibdir = join(destdir, sitelibdir)
298
306
 
299
307
  FileUtils.makedirs(configdir) if InstallOptions.configs
300
308
  FileUtils.makedirs(bindir)
314
322
end
315
323
 
316
324
##
 
325
# Join two paths. On Windows, dir must be converted to a relative path,
 
326
# by stripping the drive letter, but only if the basedir is not empty.
 
327
#
 
328
def join(basedir, dir)
 
329
  return "#{basedir}#{dir[2..-1]}" if $operatingsystem == "windows" and basedir.length > 0 and dir.length > 2
 
330
 
 
331
  "#{basedir}#{dir}"
 
332
end
 
333
 
 
334
##
317
335
# Build the rdoc documentation. Also, try to build the RI documentation.
318
336
#
319
337
def build_rdoc(files)
405
423
    if not installed_wrapper
406
424
      tmp_file2 = File.join(tmp_dir, '_tmp_wrapper')
407
425
      cwn = File.join(Config::CONFIG['bindir'], op_file)
408
 
      cwv = CMD_WRAPPER.gsub('<ruby>', ruby.gsub(%r{/}) { "\\" }).gsub!('<command>', cwn.gsub(%r{/}) { "\\" } )
 
426
      regex_safe_ruby = Regexp.escape(ruby.gsub(%r{/}) { "\\" })
 
427
      regex_safe_cwn = Regexp.escape(cwn.gsub(%r{/}) { "\\" })
409
428
 
 
429
      cwv = CMD_WRAPPER.gsub('<ruby>', regex_safe_ruby).gsub('<command>', regex_safe_cwn)
410
430
      File.open(tmp_file2, "wb") { |cw| cw.puts cwv }
411
431
      FileUtils.install(tmp_file2, File.join(target, "#{op_file}.bat"), :mode => 0755, :verbose => true)
412
432