1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* tool/transcode-tblgen.rb: record checksum of

transcode-tblgen.rb itself.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-08-10 09:10:58 +00:00
parent aa9457762f
commit 30e90a335d
2 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Sun Aug 10 18:09:16 2008 Tanaka Akira <akr@fsij.org>
* tool/transcode-tblgen.rb: record checksum of
transcode-tblgen.rb itself.
Sun Aug 10 12:34:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> Sun Aug 10 12:34:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* config.guess ({powerpc-apple,i586-pc}-haiku): re-applied r18403. * config.guess ({powerpc-apple,i586-pc}-haiku): re-applied r18403.

View file

@ -565,7 +565,11 @@ dir = File.dirname(arg)
$:.unshift dir unless $:.include? dir $:.unshift dir unless $:.include? dir
src = File.read(arg) src = File.read(arg)
src.force_encoding("ascii-8bit") if src.respond_to? :force_encoding src.force_encoding("ascii-8bit") if src.respond_to? :force_encoding
this_script = File.read(__FILE__)
this_script.force_encoding("ascii-8bit") if this_script.respond_to? :force_encoding
base_signature = "/* autogenerated. */\n" base_signature = "/* autogenerated. */\n"
base_signature << "/* #{make_signature(File.basename(__FILE__), this_script)} */\n"
base_signature << "/* #{make_signature(File.basename(arg), src)} */\n" base_signature << "/* #{make_signature(File.basename(arg), src)} */\n"
if !force_mode && output_filename && File.readable?(output_filename) if !force_mode && output_filename && File.readable?(output_filename)
@ -574,14 +578,14 @@ if !force_mode && output_filename && File.readable?(output_filename)
old_signature.each_line {|line| old_signature.each_line {|line|
if %r{/\* src="([0-9a-z_.-]+)",} =~ line if %r{/\* src="([0-9a-z_.-]+)",} =~ line
name = $1 name = $1
next if name == File.basename(arg) next if name == File.basename(arg) || name == File.basename(__FILE__)
path = File.join(dir, name) path = File.join(dir, name)
if File.readable? path if File.readable? path
chk_signature << "/* #{make_signature(name, File.read(path))} */\n" chk_signature << "/* #{make_signature(name, File.read(path))} */\n"
end end
end end
} }
if old_signature == chk_signature && File.mtime(__FILE__) < File.mtime(output_filename) if old_signature == chk_signature
now = Time.now now = Time.now
File.utime(now, now, output_filename) File.utime(now, now, output_filename)
STDERR.puts "already up-to-date: #{output_filename}" if VERBOSE_MODE STDERR.puts "already up-to-date: #{output_filename}" if VERBOSE_MODE