diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | instruby.rb | 15 |
2 files changed, 17 insertions, 3 deletions
@@ -1,9 +1,12 @@ -Sun Jan 26 06:43:48 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net> +Sun Jan 26 07:18:42 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net> * instruby.rb: re-define individual methods verbosely rather than including FileUtils::Verbose, in order to suppress messages from FileUtils#cmp. + * instruby.rb (makedirs): make same directory only once even if + dryrun. + * lib/fileutils.rb (FileUtils::Verbose, FileUtils::NoWrite): re-define methods with define_method instead of module_eval. diff --git a/instruby.rb b/instruby.rb index 943bfabc36..7833076f67 100644 --- a/instruby.rb +++ b/instruby.rb @@ -53,10 +53,21 @@ include FileUtils::NoWrite if $dryrun alias makelink ln_sf class << self body = proc {|*args|super(*args<<:verbose)} - for func in [:install, :makedirs, :makelink] + for func in [:install, :makelink] define_method(func, body) end end +$made_dirs = {} +def makedirs(dirs) + dirs = fu_list(dirs) + dirs.reject! do |dir| + $made_dirs.fetch(dir) do + $made_dirs[dir] = true + File.directory?(dir) + end + end + super(dirs, :verbose) unless dirs.empty? +end exeext = CONFIG["EXEEXT"] @@ -151,7 +162,7 @@ end Dir.glob("lib/**/*{.rb,help-message}") do |f| dir = File.dirname(f).sub!(/\Alib/, rubylibdir) || rubylibdir - makedirs dir unless File.directory? dir + makedirs dir install f, dir, 0644 end |