ruby-changes:64659
From: Nobuyoshi <ko1@a...>
Date: Tue, 29 Dec 2020 17:45:39 +0900 (JST)
Subject: [ruby-changes:64659] d57c5a7b61 (master): transcode-tblgen.rb: make silent a little when just -v
https://git.ruby-lang.org/ruby.git/commit/?id=d57c5a7b61 From d57c5a7b61c256f3216e82fe1ca6b5b6b9e50752 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 29 Dec 2020 16:42:24 +0900 Subject: transcode-tblgen.rb: make silent a little when just -v diff --git a/common.mk b/common.mk index b9103ab..43a272b 100644 --- a/common.mk +++ b/common.mk @@ -8,6 +8,7 @@ dll: $(LIBRUBY_SO) https://github.com/ruby/ruby/blob/trunk/common.mk#L8 # V=0 quiet, V=1 verbose. other values don't work. V = 0 +V0 = $(V:0=) Q1 = $(V:1=) Q = $(Q1:0=@) ECHO0 = $(ECHO1:0=echo) diff --git a/enc/Makefile.in b/enc/Makefile.in index 9203874..5e5d39c 100644 --- a/enc/Makefile.in +++ b/enc/Makefile.in @@ -1,4 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/enc/Makefile.in#L1 V = 0 +V0 = $(V:0=) Q1 = $(V:1=) Q = $(Q1:0=@) ECHO1 = $(V:1=@@NULLCMD@) diff --git a/enc/depend b/enc/depend index 26f8e70..f1da87e 100644 --- a/enc/depend +++ b/enc/depend @@ -97,7 +97,7 @@ $(ENCSOS) $(TRANSSOS): $(ENC_TRANS_SO_D) https://github.com/ruby/ruby/blob/trunk/enc/depend#L97 <%=transvpath_prefix%>.trans<%=transvpath_prefix%>.c: $(ECHO) generating table from $@ - $(Q)$(MINIRUBY) "$(tooldir)/transcode-tblgen.rb" -vo "$@" "$<" + $(Q)$(MINIRUBY) "$(tooldir)/transcode-tblgen.rb" -v$(V0:1=v)o "$@" "$<" % unless ENCS.empty? or TRANS.empty? diff --git a/ext/extmk.rb b/ext/extmk.rb index 80a0a12..4a087f2 100755 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -647,6 +647,7 @@ FileUtils.makedirs(File.dirname($command_output)) https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L647 begin atomic_write_open($command_output) do |mf| mf.puts "V = 0" + mf.puts "V0 = $(V:0=)" mf.puts "Q1 = $(V:1=)" mf.puts "Q = $(Q1:0=@)" mf.puts "ECHO1 = $(V:1=@:)" diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 672c544..d4fbabe 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1931,6 +1931,7 @@ SHELL = /bin/sh https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1931 # V=0 quiet, V=1 verbose. other values don't work. V = 0 +V0 = $(V:0=) Q1 = $(V:1=) Q = $(Q1:0=@) ECHO1 = $(V:1=@ #{CONFIG['NULLCMD']}) diff --git a/template/configure-ext.mk.tmpl b/template/configure-ext.mk.tmpl index 9921e22..8ba6b96 100644 --- a/template/configure-ext.mk.tmpl +++ b/template/configure-ext.mk.tmpl @@ -1,4 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/template/configure-ext.mk.tmpl#L1 V = 0 +V0 = $(V:0=) Q1 = $(V:1=) Q = $(Q1:0=@) ECHO1 = $(V:1=@:) diff --git a/template/exts.mk.tmpl b/template/exts.mk.tmpl index e4706be..924abeb 100644 --- a/template/exts.mk.tmpl +++ b/template/exts.mk.tmpl @@ -1,5 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/template/exts.mk.tmpl#L1 # -*- makefile -*- V = 0 +V0 = $(V:0=) Q1 = $(V:1=) Q = $(Q1:0=@) ECHO1 = $(V:1=@:) diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb index 297882a..dba6f33 100644 --- a/tool/transcode-tblgen.rb +++ b/tool/transcode-tblgen.rb @@ -724,7 +724,7 @@ def citrus_decode_mapsrc(ces, csid, mapsrcs) https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L724 path = File.join(*path) path << ".src" path[path.rindex('/')] = '%' - STDOUT.puts 'load mapsrc %s' % path if VERBOSE_MODE + STDOUT.puts 'load mapsrc %s' % path if VERBOSE_MODE > 1 open(path, 'rb') do |f| f.each_line do |l| break if /^BEGIN_MAP/ =~ l @@ -822,7 +822,7 @@ TRANSCODERS = [] https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L822 TRANSCODE_GENERATED_TRANSCODER_CODE = ''.dup def transcode_tbl_only(from, to, map, valid_encoding=UnspecifiedValidEncoding) - if VERBOSE_MODE + if VERBOSE_MODE > 1 if from.empty? || to.empty? STDOUT.puts "converter for #{from.empty? ? to : from}" else @@ -905,7 +905,7 @@ End https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L905 end def transcode_generate_node(am, name_hint=nil) - STDOUT.puts "converter for #{name_hint}" if VERBOSE_MODE + STDOUT.puts "converter for #{name_hint}" if VERBOSE_MODE > 1 am.gennode(TRANSCODE_GENERATED_BYTES_CODE, TRANSCODE_GENERATED_WORDS_CODE, name_hint) '' end @@ -1018,12 +1018,12 @@ if __FILE__ == $0 https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L1018 start_time = Time.now output_filename = nil - verbose_mode = false + verbose_mode = 0 force_mode = false op = OptionParser.new op.def_option("--help", "show help message") { puts op; exit 0 } - op.def_option("--verbose", "verbose mode") { verbose_mode = true } + op.def_option("--verbose", "verbose mode, twice for more verbose") { verbose_mode += 1 } op.def_option("--force", "force table generation") { force_mode = true } op.def_option("--output=FILE", "specify output file") {|arg| output_filename = arg } op.parse! @@ -1066,12 +1066,12 @@ if __FILE__ == $0 https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L1066 if old_signature == chk_signature now = Time.now File.utime(now, now, output_filename) - STDOUT.puts "already up-to-date: #{output_filename}" if VERBOSE_MODE + STDOUT.puts "already up-to-date: #{output_filename}" if VERBOSE_MODE > 0 exit end end - if VERBOSE_MODE + if VERBOSE_MODE > 0 if output_filename STDOUT.puts "generating #{output_filename} ..." end @@ -1111,7 +1111,7 @@ if __FILE__ == $0 https://github.com/ruby/ruby/blob/trunk/tool/transcode-tblgen.rb#L1111 File.rename(new_filename, output_filename) tms = Process.times elapsed = Time.now - start_time - STDOUT.puts "done. (#{'%.2f' % tms.utime}user #{'%.2f' % tms.stime}system #{'%.2f' % elapsed}elapsed)" if VERBOSE_MODE + STDOUT.puts "done. (#{'%.2f' % tms.utime}user #{'%.2f' % tms.stime}system #{'%.2f' % elapsed}elapsed)" if VERBOSE_MODE > 1 else print result end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/