From 1a5852f6750615f72e3523bb8685f98210f81e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 24 Nov 2018 22:51:40 +0100 Subject: Add the git-subfolder fetch method It clones and checkouts like the git fetch method, but does so in the Erlang.mk temporary directory. It then creates a symbolic link to the subfolder for the dependency. --- core/deps.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core') diff --git a/core/deps.mk b/core/deps.mk index 2b14c4f..19a2410 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -544,6 +544,16 @@ define dep_fetch_git cd $(DEPS_DIR)/$(call dep_name,$(1)) && git checkout -q $(call dep_commit,$(1)); endef +define dep_fetch_git-subfolder + mkdir -p $(ERLANG_MK_TMP)/git-subfolder; \ + git clone -q -n -- $(call dep_repo,$1) \ + $(ERLANG_MK_TMP)/git-subfolder/$(call dep_name,$1); \ + cd $(ERLANG_MK_TMP)/git-subfolder/$(call dep_name,$1) \ + && git checkout -q $(call dep_commit,$1); \ + ln -s $(ERLANG_MK_TMP)/git-subfolder/$(call dep_name,$1)/$(word 4,$(dep_$(1))) \ + $(DEPS_DIR)/$(call dep_name,$1); +endef + define dep_fetch_git-submodule git submodule update --init -- $(DEPS_DIR)/$1; endef -- cgit v1.2.3