mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 01:23:57 +02:00
expand-config.rb: search revision.h to extract release date
This commit is contained in:
parent
0344283fd3
commit
031bc21abb
1 changed files with 11 additions and 1 deletions
|
@ -7,7 +7,17 @@ config.sub!(/^(\s*)RUBY_VERSION\b.*(\sor\s*)$/, '\1true\2')
|
|||
rbconfig = Module.new {module_eval(config, conffile)}::RbConfig
|
||||
config = $expand ? rbconfig::CONFIG : rbconfig::MAKEFILE_CONFIG
|
||||
config["RUBY_RELEASE_DATE"] ||=
|
||||
File.read(File.expand_path("../../version.h", __FILE__))[/^\s*#\s*define\s+RUBY_RELEASE_DATE\s+"(.*)"/, 1]
|
||||
[
|
||||
["revision.h"],
|
||||
["../../revision.h", __FILE__],
|
||||
["../../version.h", __FILE__],
|
||||
].find do |hdr, dir|
|
||||
hdr = File.expand_path(hdr, dir) if dir
|
||||
if date = File.read(hdr)[/^\s*#\s*define\s+RUBY_RELEASE_DATE(?:TIME)?\s+"([0-9-]*)/, 1]
|
||||
break date
|
||||
end
|
||||
rescue
|
||||
end
|
||||
|
||||
while /\A(\w+)=(.*)/ =~ ARGV[0]
|
||||
config[$1] = $2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue