ruby-changes:73359
From: Nobuyoshi <ko1@a...>
Date: Thu, 1 Sep 2022 19:39:43 +0900 (JST)
Subject: [ruby-changes:73359] 55b1600987 (master): Update revision.h in packages using `VCS#revision_header`
https://git.ruby-lang.org/ruby.git/commit/?id=55b1600987 From 55b1600987413949fe39507f703d2f51dab56eb6 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 31 Aug 2022 19:56:57 +0900 Subject: Update revision.h in packages using `VCS#revision_header` --- tool/lib/vcs.rb | 4 ++-- tool/make-snapshot | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb index 75a5d65f2f..db3a6f436f 100644 --- a/tool/lib/vcs.rb +++ b/tool/lib/vcs.rb @@ -204,7 +204,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L204 revision_handler(rev).short_revision(rev) end - def revision_header(last, changed, modified, branch, title, limit: 20) + def revision_header(last, changed, modified, branch, title, limit: 20, time: true) short = short_revision(last) if /[^\x00-\x7f]/ =~ title and title.respond_to?(:force_encoding) title = title.dup.force_encoding("US-ASCII") @@ -225,7 +225,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L225 title = title.dump.sub(/\\#/, '#') code << "#define RUBY_LAST_COMMIT_TITLE #{title}" end - if modified + if modified and time t = modified.utc code << t.strftime('#define RUBY_RELEASE_DATETIME "%FT%TZ"') end diff --git a/tool/make-snapshot b/tool/make-snapshot index 6b02da5139..2c15a52dbb 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -309,7 +309,7 @@ def package(vcs, rev, destdir, tmp = nil) https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L309 warn "#{$0}: #{rev} not found" return end - revision = vcs.get_revisions(url)[1] + revision = (info = vcs.get_revisions(url))[1] end v = "ruby" @@ -346,11 +346,7 @@ def package(vcs, rev, destdir, tmp = nil) https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L346 end File.open("#{v}/revision.h", "wb") {|f| - short = vcs.short_revision(revision) - f.puts "#define RUBY_REVISION #{short.inspect}" - unless short == revision - f.puts "#define RUBY_FULL_REVISION #{revision.inspect}" - end + f.puts vcs.revision_header(*info, time: false) } version ||= (versionhdr = IO.read("#{v}/version.h"))[RUBY_VERSION_PATTERN, 1] version ||= -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/