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

common.mk: update-man-date

* common.mk (update-man-date): update last date in man pages.

* tool/vcs.rb (VCS#modified): returns last modified time.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-05-23 09:36:33 +00:00
parent 80000c534c
commit aaa123591d
2 changed files with 11 additions and 0 deletions

View file

@ -1023,6 +1023,12 @@ yes-test-all: sudo-precheck
sudo-precheck: PHONY sudo-precheck: PHONY
@$(SUDO) echo > $(NULL) @$(SUDO) echo > $(NULL)
update-man-date: PHONY
-$(Q) $(BASERUBY) -I"$(srcdir)/tool" -rvcs -i -p \
-e 'BEGIN{@vcs=VCS.detect(ARGV.shift)}' \
-e '$$_.sub!(/^(\.Dd ).*/){$$1+@vcs.modified(ARGF.path).strftime("%B %d, %Y")}' \
"$(srcdir)" "$(srcdir)"/man/*.1
help: PHONY help: PHONY
$(MESSAGE_BEGIN) \ $(MESSAGE_BEGIN) \
" Makefile of Ruby" \ " Makefile of Ruby" \

View file

@ -130,6 +130,11 @@ class VCS
return last, changed, modified, *rest return last, changed, modified, *rest
end end
def modified(path)
last, changed, modified, *rest = get_revisions(path)
modified
end
def relative_to(path) def relative_to(path)
if path if path
srcdir = File.realpath(@srcdir) srcdir = File.realpath(@srcdir)