ruby-changes:14518
From: nobu <ko1@a...>
Date: Tue, 19 Jan 2010 14:34:16 +0900 (JST)
Subject: [ruby-changes:14518] Ruby:r26355 (ruby_1_8, trunk): * Makefile.in (clean-ext): allow glob patterns.
nobu 2010-01-19 14:29:18 +0900 (Tue, 19 Jan 2010) New Revision: 26355 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26355 Log: * Makefile.in (clean-ext): allow glob patterns. * ext/extmk.rb: ditto. Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/Makefile.in branches/ruby_1_8/ext/extmk.rb trunk/ChangeLog trunk/Makefile.in trunk/ext/extmk.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 26354) +++ ChangeLog (revision 26355) @@ -1,3 +1,9 @@ +Tue Jan 19 14:29:16 2010 Nobuyoshi Nakada <nobu@r...> + + * Makefile.in (clean-ext): allow glob patterns. + + * ext/extmk.rb: ditto. + Tue Jan 19 14:19:26 2010 NAKAMURA Usaku <usa@r...> * ext/zlib/{extconf.rb, zlib.c): crc32_combine and adler32_combine is Index: Makefile.in =================================================================== --- Makefile.in (revision 26354) +++ Makefile.in (revision 26355) @@ -252,18 +252,17 @@ @$(RMALL) $(RDOCOUT:/=\) clean-ext distclean-ext realclean-ext:: - @set dummy ${EXTS}; shift; \ - if test "$$#" = 0; then \ - set dummy `find ext -name Makefile | sed 's:^ext/::;s:/Makefile$$::' | sort`; \ - shift; \ - fi; \ + @cd ext; set dummy `echo "${EXTS}" | tr , ' '`; shift; \ + test "$$#" = 0 && set .; \ + set dummy `for dir; do \ + find $$dir -name Makefile | sed 's:^\./::;s:/Makefile$$:~:' | sort | sed 's:~$$::'; \ + done`; shift; \ for dir; do \ - [ -f "ext/$$dir/Makefile" ] || continue; \ echo $(@:-ext=)ing "$$dir"; \ - (cd "ext/$$dir" && exec $(MAKE) $(MFLAGS) $(@:-ext=)) && \ + (cd "$$dir" && exec $(MAKE) $(MFLAGS) $(@:-ext=)) && \ case "$@" in \ *distclean-ext*|*realclean-ext*) \ - $(RMDIRS) "ext/$$dir";; \ + $(RMDIRS) "$$dir";; \ esac; \ done Index: ext/extmk.rb =================================================================== --- ext/extmk.rb (revision 26354) +++ ext/extmk.rb (revision 26355) @@ -396,29 +396,27 @@ ext_prefix = "#{$top_srcdir}/ext" exts = $static_ext.sort_by {|t, i| i}.collect {|t, i| t} -if $extension - exts |= $extension.select {|d| File.directory?("#{ext_prefix}/#{d}")} -else - withes, withouts = %w[--with --without].collect {|w| - if not (w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any? - nil - elsif (w = w.grep(String)).empty? - proc {true} - else - proc {|c1| w.collect {|o| o.split(/,/)}.flatten.any?(&c1)} - end - } - if withes - withouts ||= proc {true} +withes, withouts = %w[--with --without].collect {|w| + if not (w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any? + nil + elsif (w = w.grep(String)).empty? + proc {true} else - withes = proc {false} - withouts ||= withes + proc {|c1| w.collect {|o| o.split(/,/)}.flatten.any?(&c1)} end - cond = proc {|ext, *| - cond1 = proc {|n| File.fnmatch(n, ext)} - withes.call(cond1) or !withouts.call(cond1) - } - exts |= Dir.glob("#{ext_prefix}/*/**/extconf.rb").collect {|d| +} +if withes + withouts ||= proc {true} +else + withes = proc {false} + withouts ||= withes +end +cond = proc {|ext, *| + cond1 = proc {|n| File.fnmatch(n, ext)} + withes.call(cond1) or !withouts.call(cond1) +} +($extension || %w[*]).each do |e| + exts |= Dir.glob("#{ext_prefix}/#{e}/**/extconf.rb").collect {|d| d = File.dirname(d) d.slice!(0, ext_prefix.length + 1) d Index: ruby_1_8/Makefile.in =================================================================== --- ruby_1_8/Makefile.in (revision 26354) +++ ruby_1_8/Makefile.in (revision 26355) @@ -178,11 +178,18 @@ -$(RM) $(INSTALLED_LIST) clean-ext distclean-ext realclean-ext:: - @find ext -name Makefile | sort | while read mk; do \ - dir=`dirname "$$mk"`; \ - echo $(@:-ext=)ing `expr "$$dir" : 'ext/\(.*\)'`; \ - (cd "$$dir"; $(MAKE) $(MFLAGS) $(@:-ext=)) && \ - test $@ = clean-ext || rmdir -p "$$dir" 2> /dev/null; \ + @cd ext; set dummy `echo "${EXTS}" | tr , ' '`; shift; \ + test "$$#" = 0 && set .; \ + set dummy `for dir; do \ + find $$dir -name Makefile | sed 's:^\./::;s:/Makefile$$:~:' | sort | sed 's:~$$::'; \ + done`; shift; \ + for dir; do \ + echo $(@:-ext=)ing "$$dir"; \ + (cd "$$dir" && exec $(MAKE) $(MFLAGS) $(@:-ext=)) && \ + case "$@" in \ + *distclean-ext*|*realclean-ext*) \ + rmdir -p "$$dir" 2> /dev/null;; \ + esac; \ done ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP) Index: ruby_1_8/ext/extmk.rb =================================================================== --- ruby_1_8/ext/extmk.rb (revision 26354) +++ ruby_1_8/ext/extmk.rb (revision 26355) @@ -397,29 +397,27 @@ ext_prefix = "#{$top_srcdir}/ext" exts = $static_ext.sort_by {|t, i| i}.collect {|t, i| t} -if $extension - exts |= $extension.select {|d| File.directory?("#{ext_prefix}/#{d}")} -else - withes, withouts = %w[--with --without].collect {|w| - if not (w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any? - nil - elsif (w = w.grep(String)).empty? - proc {true} - else - proc {|c1| w.collect {|o| o.split(/,/)}.flatten.any?(&c1)} - end - } - if withes - withouts ||= proc {true} +withes, withouts = %w[--with --without].collect {|w| + if not (w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any? + nil + elsif (w = w.grep(String)).empty? + proc {true} else - withes = proc {false} - withouts ||= withes + proc {|c1| w.collect {|o| o.split(/,/)}.flatten.any?(&c1)} end - cond = proc {|ext, *| - cond1 = proc {|n| File.fnmatch(n, ext)} - withes.call(cond1) or !withouts.call(cond1) - } - exts |= Dir.glob("#{ext_prefix}/*/**/extconf.rb").collect {|d| +} +if withes + withouts ||= proc {true} +else + withes = proc {false} + withouts ||= withes +end +cond = proc {|ext, *| + cond1 = proc {|n| File.fnmatch(n, ext)} + withes.call(cond1) or !withouts.call(cond1) +} +($extension || %w[*]).each do |e| + exts |= Dir.glob("#{ext_prefix}/#{e}/**/extconf.rb").collect {|d| d = File.dirname(d) d.slice!(0, ext_prefix.length + 1) d Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 26354) +++ ruby_1_8/ChangeLog (revision 26355) @@ -1,3 +1,9 @@ +Tue Jan 19 14:29:16 2010 Nobuyoshi Nakada <nobu@r...> + + * Makefile.in (clean-ext): allow glob patterns. + + * ext/extmk.rb: ditto. + Mon Jan 18 17:16:03 2010 Nobuyoshi Nakada <nobu@r...> * lib/webrick/httpservlet/filehandler.rb (make_partial_content): -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/