Skip to content

Commit

Permalink
* instruby.rb (makedirs): make same directory only once even if
Browse files Browse the repository at this point in the history
  dryrun.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Jan 25, 2003
1 parent 3380618 commit 171df94
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 4 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
15 changes: 13 additions & 2 deletions instruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,21 @@ def parse_args()
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"]

Expand Down Expand Up @@ -151,7 +162,7 @@ class << self

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

Expand Down

0 comments on commit 171df94

Please sign in to comment.