summaryrefslogtreecommitdiff
path: root/instruby.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-25 22:23:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-25 22:23:17 +0000
commit171df94c2751146c894fe7cb2812020e17c47fc3 (patch)
tree1ca18bb573f9fd1fc0d4bfdc6c5af8757ee37ba1 /instruby.rb
parent3380618f1cf432e89c3abb2e06021fa09069d14a (diff)
* instruby.rb (makedirs): make same directory only once even if
dryrun. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'instruby.rb')
-rw-r--r--instruby.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/instruby.rb b/instruby.rb
index 943bfab..7833076 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