summaryrefslogtreecommitdiff
path: root/defs
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-15 17:06:35 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-15 17:06:35 +0900
commitc781b1b7a3d112c6f9b2521c4ff2c5408a429a72 (patch)
tree63fa914907acab5cb7890fd617d0569ccf2c30f4 /defs
parent5a42dca6887203ebba3532f4430c17d3a73a6169 (diff)
update-deps for dependencies
Diffstat (limited to 'defs')
-rw-r--r--defs/gmake.mk17
1 files changed, 17 insertions, 0 deletions
diff --git a/defs/gmake.mk b/defs/gmake.mk
index 4a3d1c857c..012c3832b9 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -284,3 +284,20 @@ ifneq ($(filter $(VCS),git),)
update-src::
@$(BASERUBY) $(srcdir)/tool/lib/colorize.rb pass "Latest commit hash = $(shell $(filter-out svn,$(VCS)) -C $(srcdir) rev-parse --short=10 HEAD)"
endif
+
+# Update dependencies and commit the updates to the current branch.
+update-deps:
+ $(eval update_deps := $(shell date +update-deps-%Y%m%d))
+ $(eval deps_dir := $(shell mktemp -d)/$(update_deps))
+ $(eval GIT_DIR := $(shell git -C $(srcdir) rev-parse --absolute-git-dir))
+ git --git-dir=$(GIT_DIR) worktree add $(deps_dir)
+ cp $(srcdir)/tool/config.guess $(srcdir)/tool/config.sub $(deps_dir)/tool
+ [ -f config.status ] && cp config.status $(deps_dir)
+ cd $(deps_dir) && autoconf && \
+ exec ./configure -q -C --enable-load-relative --disable-install-doc --disable-rubygems 'optflags=-O0' 'debugflags=-save-temps=obj -g'
+ $(RUNRUBY) -C $(deps_dir) tool/update-deps --fix
+ git -C $(deps_dir) diff --no-ext-diff --ignore-submodules --exit-code || \
+ git -C $(deps_dir) commit --all --message='Update dependencies'
+ git --git-dir=$(GIT_DIR) worktree remove $(deps_dir)
+ git --git-dir=$(GIT_DIR) merge --no-edit --ff-only $(update_deps)
+ git --git-dir=$(GIT_DIR) branch --delete $(update_deps)