diff options
Diffstat (limited to 'dev-ruby/facter/files/facter-1.5.7-ruby19.patch')
-rw-r--r-- | dev-ruby/facter/files/facter-1.5.7-ruby19.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/dev-ruby/facter/files/facter-1.5.7-ruby19.patch b/dev-ruby/facter/files/facter-1.5.7-ruby19.patch new file mode 100644 index 000000000000..9bba6ebb2919 --- /dev/null +++ b/dev-ruby/facter/files/facter-1.5.7-ruby19.patch @@ -0,0 +1,61 @@ +diff -Naur facter-1.5.7.orig/install.rb facter-1.5.7/install.rb +--- facter-1.5.7.orig/install.rb 2009-09-11 13:26:07.000000000 +0900 ++++ facter-1.5.7/install.rb 2010-06-05 12:32:12.000000000 +0900 +@@ -35,11 +35,18 @@ + require 'rbconfig' + require 'find' + require 'fileutils' +-require 'ftools' # apparently on some system ftools doesn't get loaded + require 'optparse' + require 'ostruct' + + begin ++ require 'ftools' # apparently on some system ftools doesn't get loaded ++ $haveftools = true ++rescue LoadError ++ puts "ftools not found. Using FileUtils instead.." ++ $haveftools = false ++end ++ ++begin + require 'rdoc/rdoc' + $haverdoc = true + rescue LoadError +@@ -91,9 +98,15 @@ + libs.each do |lf| + olf = File.join(InstallOptions.site_dir, lf.gsub(/#{strip}/, '')) + op = File.dirname(olf) +- File.makedirs(op, true) +- File.chmod(0755, op) +- File.install(lf, olf, 0644, true) ++ if $haveftools ++ File.makedirs(op, true) ++ File.chmod(0755, op) ++ File.install(lf, olf, 0644, true) ++ else ++ FileUtils.makedirs(op, {:mode => 0755, :verbose => true}) ++ FileUtils.chmod(0755, op) ++ FileUtils.install(lf, olf, {:mode => 0644, :verbose => true}) ++ end + end + end + +@@ -101,9 +114,15 @@ + man.each do |mf| + omf = File.join(InstallOptions.man_dir, mf.gsub(/#{strip}/, '')) + om = File.dirname(omf) +- File.makedirs(om, true) +- File.chmod(0644, om) +- File.install(mf, omf, 0644, true) ++ if $haveftools ++ File.makedirs(om, true) ++ File.chmod(0644, om) ++ File.install(mf, omf, 0644, true) ++ else ++ FileUtils.makedirs(om, {:mode => 0755, :verbose => true}) ++ FileUtils.chmod(0755, om) ++ FileUtils.install(mf, omf, {:mode => 0644, :verbose => true}) ++ end + gzip = %x{which gzip} + gzip.chomp! + %x{#{gzip} -f #{omf}} |