public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in dev-ruby/facter/files: facter-1.5.7-ruby19.patch
@ 2010-06-11  0:41 Matsuu Takuto (matsuu)
  0 siblings, 0 replies; only message in thread
From: Matsuu Takuto (matsuu) @ 2010-06-11  0:41 UTC (permalink / raw
  To: gentoo-commits

matsuu      10/06/11 00:41:41

  Added:                facter-1.5.7-ruby19.patch
  Log:
  Convert to ruby-fakegem. Fixed to work with ruby19.
  (Portage version: 2.1.8.3/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  dev-ruby/facter/files/facter-1.5.7-ruby19.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-ruby/facter/files/facter-1.5.7-ruby19.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-ruby/facter/files/facter-1.5.7-ruby19.patch?rev=1.1&content-type=text/plain

Index: facter-1.5.7-ruby19.patch
===================================================================
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}}






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-11  0:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-11  0:41 [gentoo-commits] gentoo-x86 commit in dev-ruby/facter/files: facter-1.5.7-ruby19.patch Matsuu Takuto (matsuu)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox