Added logic to prevent installation of man pages on windows

Signed-off-by: William Van Hevelingen <[email protected]>
---
Local-branch: ticket/master/4925
 install.rb |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/install.rb b/install.rb
index bbf4007..eb91e7c 100755
--- a/install.rb
+++ b/install.rb
@@ -97,16 +97,20 @@ def do_libs(libs, strip = 'lib/')
 end
 
 def do_man(man, strip = 'man/')
+  if (InstallOptions.man == true)  
     man.each do |mf|
-        omf = File.join(InstallOptions.man_dir, mf.gsub(/#{strip}/, ''))
-        om = File.dirname(omf)
-        FileUtils.makedirs(om, {:mode => 0755, :verbose => true})
-        FileUtils.chmod(0755, om)
-        FileUtils.install(mf, omf, {:mode => 0644, :verbose => true})
-        gzip = %x{which gzip}
-        gzip.chomp!
-        %x{#{gzip} -f #{omf}}
+       omf = File.join(InstallOptions.man_dir, mf.gsub(/#{strip}/, ''))
+       om = File.dirname(omf)
+       FileUtils.makedirs(om, {:mode => 0755, :verbose => true})
+       FileUtils.chmod(0755, om)
+       FileUtils.install(mf, omf, {:mode => 0644, :verbose => true})
+       gzip = %x{which gzip}
+       gzip.chomp!
+       %x{#{gzip} -f #{omf}}
     end
+  else
+    puts "Skipping Man Page Generation"
+  end
 end
 
 # Verify that all of the prereqs are installed
@@ -121,6 +125,10 @@ def check_prereqs
     }
 end
 
+def is_windows?
+  RUBY_PLATFORM.to_s.match(/mswin|win32|dos|cygwin|mingw/)
+end
+
 ##
 # Prepare the file installation.
 #
@@ -128,7 +136,7 @@ def prepare_installation
     # Only try to do docs if we're sure they have rdoc
     if $haverdoc
         InstallOptions.rdoc  = true
-        if RUBY_PLATFORM == "i386-mswin32"
+        if is_windows?
             InstallOptions.ri  = false
         else
             InstallOptions.ri  = true
@@ -141,7 +149,7 @@ def prepare_installation
 
     if $haveman
         InstallOptions.man = true
-        if RUBY_PLATFORM == "i386-mswin32"
+        if is_windows?
             InstallOptions.man  = false
         end
     else
-- 
1.7.0.4

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to