зеркало из https://github.com/github/ruby.git
Update revision.h in packages using `VCS#revision_header`
This commit is contained in:
Родитель
ee09f75a6b
Коммит
55b1600987
|
@ -204,7 +204,7 @@ class VCS
|
||||||
revision_handler(rev).short_revision(rev)
|
revision_handler(rev).short_revision(rev)
|
||||||
end
|
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)
|
short = short_revision(last)
|
||||||
if /[^\x00-\x7f]/ =~ title and title.respond_to?(:force_encoding)
|
if /[^\x00-\x7f]/ =~ title and title.respond_to?(:force_encoding)
|
||||||
title = title.dup.force_encoding("US-ASCII")
|
title = title.dup.force_encoding("US-ASCII")
|
||||||
|
@ -225,7 +225,7 @@ class VCS
|
||||||
title = title.dump.sub(/\\#/, '#')
|
title = title.dump.sub(/\\#/, '#')
|
||||||
code << "#define RUBY_LAST_COMMIT_TITLE #{title}"
|
code << "#define RUBY_LAST_COMMIT_TITLE #{title}"
|
||||||
end
|
end
|
||||||
if modified
|
if modified and time
|
||||||
t = modified.utc
|
t = modified.utc
|
||||||
code << t.strftime('#define RUBY_RELEASE_DATETIME "%FT%TZ"')
|
code << t.strftime('#define RUBY_RELEASE_DATETIME "%FT%TZ"')
|
||||||
end
|
end
|
||||||
|
|
|
@ -309,7 +309,7 @@ def package(vcs, rev, destdir, tmp = nil)
|
||||||
warn "#{$0}: #{rev} not found"
|
warn "#{$0}: #{rev} not found"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
revision = vcs.get_revisions(url)[1]
|
revision = (info = vcs.get_revisions(url))[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
v = "ruby"
|
v = "ruby"
|
||||||
|
@ -346,11 +346,7 @@ def package(vcs, rev, destdir, tmp = nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
File.open("#{v}/revision.h", "wb") {|f|
|
File.open("#{v}/revision.h", "wb") {|f|
|
||||||
short = vcs.short_revision(revision)
|
f.puts vcs.revision_header(*info, time: false)
|
||||||
f.puts "#define RUBY_REVISION #{short.inspect}"
|
|
||||||
unless short == revision
|
|
||||||
f.puts "#define RUBY_FULL_REVISION #{revision.inspect}"
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
version ||= (versionhdr = IO.read("#{v}/version.h"))[RUBY_VERSION_PATTERN, 1]
|
version ||= (versionhdr = IO.read("#{v}/version.h"))[RUBY_VERSION_PATTERN, 1]
|
||||||
version ||=
|
version ||=
|
||||||
|
|
Загрузка…
Ссылка в новой задаче