+1 On Fri, Sep 24, 2010 at 4:30 PM, Nick Lewis <[email protected]> wrote:
> 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). > > Signed-off-by: Nick Lewis <[email protected]> > --- > install.rb | 20 +++++++------------- > 1 files changed, 7 insertions(+), 13 deletions(-) > > diff --git a/install.rb b/install.rb > index e4154c9..449223d 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 > -- > 1.7.3 > > -- > 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]<puppet-dev%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/puppet-dev?hl=en. > > -- 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.
