diff --git a/ChangeLog b/ChangeLog index d0fe6a6d29..26be72ecfa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri May 7 11:31:50 2010 Nobuyoshi Nakada + + * instruby.rb (install-man): install mdocs directly without + temporary files. [ruby-dev:41204] + Fri May 7 09:16:16 2010 Nobuyoshi Nakada * ext/tk/extconf.rb (get_tclConfig_dirs): glob with EXEEXT. diff --git a/instruby.rb b/instruby.rb index d8464558c0..973d60996b 100755 --- a/instruby.rb +++ b/instruby.rb @@ -15,7 +15,6 @@ require 'fileutils' require 'shellwords' require 'optparse' require 'optparse/shellwords' -require 'tempfile' STDOUT.sync = true File.umask(0) @@ -448,13 +447,11 @@ install?(:local, :comm, :man) do if $mantype == "doc" install mdoc, destfile, :mode => $data_mode else - w = nil - Tempfile.open(base) do |f| - w = f - open(mdoc) {|r| Mdoc2Man.mdoc2man(r, w)} + class << (w = []) + alias print push end - install w.path, destfile, :mode => $data_mode - w.close! + open(mdoc) {|r| Mdoc2Man.mdoc2man(r, w)} + open_for_install(destfile, $data_mode) {w.join("")} end end end