summaryrefslogtreecommitdiffstats
path: root/install.rb
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2010-09-24 15:21:20 -0700
committerMarkus Roberts <Markus@reality.com>2010-09-28 15:36:25 -0700
commit021359bd7448f6dea8f8c55a1e7dca84babdbd0c (patch)
tree5f551d98cac597fb7f05511c53bb4512b27a2589 /install.rb
parentd057b90bba4ffe7174e9af789835d5528e8a200d (diff)
downloadpuppet-021359bd7448f6dea8f8c55a1e7dca84babdbd0c.tar.gz
puppet-021359bd7448f6dea8f8c55a1e7dca84babdbd0c.tar.xz
puppet-021359bd7448f6dea8f8c55a1e7dca84babdbd0c.zip
Fix for #4644: install.rb works properly on Windows
We were failing to make the sbin directory, and so the install script was failing to install files to it. Also, we were trying to add man pages regardless of whether or not we actually wanted to. Changed operating system detection to use Facter["operatingsystem"], which is easier to check than RUBY_PLATFORM (there are multiple different values for Windows).
Diffstat (limited to 'install.rb')
-rwxr-xr-xinstall.rb20
1 files changed, 7 insertions, 13 deletions
diff --git a/install.rb b/install.rb
index e4154c999..449223d26 100755
--- a/install.rb
+++ b/install.rb
@@ -88,6 +88,7 @@ libs = glob(%w{lib/**/*.rb lib/**/*.py lib/puppet/util/command_line/*})
tests = glob(%w{test/**/*.rb})
def do_bins(bins, target, strip = 's?bin/')
+ Dir.mkdir(target) unless File.directory? target
bins.each do |bf|
obf = bf.gsub(/#{strip}/, '')
install_binfile(bf, obf, target)
@@ -154,10 +155,12 @@ end
# Prepare the file installation.
#
def prepare_installation
+ $operatingsystem = Facter["operatingsystem"].value
+
# Only try to do docs if we're sure they have rdoc
if $haverdoc
InstallOptions.rdoc = true
- InstallOptions.ri = RUBY_PLATFORM != "i386-mswin32"
+ InstallOptions.ri = $operatingsystem != "windows"
else
InstallOptions.rdoc = false
InstallOptions.ri = false
@@ -166,7 +169,7 @@ def prepare_installation
if $haveman
InstallOptions.man = true
- if RUBY_PLATFORM == "i386-mswin32"
+ if $operatingsystem == "windows"
InstallOptions.man = false
end
else
@@ -175,15 +178,6 @@ def prepare_installation
InstallOptions.tests = true
- if $haveman
- InstallOptions.man = true
- if RUBY_PLATFORM == "i386-mswin32"
- InstallOptions.man = false
- end
- else
- InstallOptions.man = false
- end
-
ARGV.options do |opts|
opts.banner = "Usage: #{File.basename($0)} [options]"
opts.separator ""
@@ -418,7 +412,7 @@ def install_binfile(from, op_file, target)
end
end
- if Config::CONFIG["target_os"] =~ /win/io and Config::CONFIG["target_os"] !~ /darwin/io
+ if $operatingsystem == "windows"
installed_wrapper = false
if File.exists?("#{from}.bat")
@@ -468,4 +462,4 @@ prepare_installation
do_bins(sbins, InstallOptions.sbin_dir)
do_bins(bins, InstallOptions.bin_dir)
do_libs(libs)
-do_man(man)
+do_man(man) if InstallOptions.man