mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
transcode-tblgen.rb: make silent a little when just -v
This commit is contained in:
parent
365df8d351
commit
d57c5a7b61
Notes:
git
2020-12-29 17:45:45 +09:00
8 changed files with 15 additions and 9 deletions
|
@ -8,6 +8,7 @@ dll: $(LIBRUBY_SO)
|
|||
|
||||
# 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)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
V = 0
|
||||
V0 = $(V:0=)
|
||||
Q1 = $(V:1=)
|
||||
Q = $(Q1:0=@)
|
||||
ECHO1 = $(V:1=@@NULLCMD@)
|
||||
|
|
|
@ -97,7 +97,7 @@ $(ENCSOS) $(TRANSSOS): $(ENC_TRANS_SO_D)
|
|||
|
||||
<%=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?
|
||||
|
||||
|
|
|
@ -647,6 +647,7 @@ FileUtils.makedirs(File.dirname($command_output))
|
|||
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=@:)"
|
||||
|
|
|
@ -1931,6 +1931,7 @@ SHELL = /bin/sh
|
|||
|
||||
# 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']})
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
V = 0
|
||||
V0 = $(V:0=)
|
||||
Q1 = $(V:1=)
|
||||
Q = $(Q1:0=@)
|
||||
ECHO1 = $(V:1=@:)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# -*- makefile -*-
|
||||
V = 0
|
||||
V0 = $(V:0=)
|
||||
Q1 = $(V:1=)
|
||||
Q = $(Q1:0=@)
|
||||
ECHO1 = $(V:1=@:)
|
||||
|
|
|
@ -724,7 +724,7 @@ def citrus_decode_mapsrc(ces, csid, mapsrcs)
|
|||
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 = []
|
|||
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
|
|||
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
|
|||
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
|
|||
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
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue