diff options
author | Loïc Hoguin <[email protected]> | 2018-11-24 22:51:40 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-11-24 22:51:40 +0100 |
commit | 1a5852f6750615f72e3523bb8685f98210f81e11 (patch) | |
tree | 8e3f95447d5378880b7bff1cab425bc0b5a1cfc8 /core/deps.mk | |
parent | 2110fb337b4457012d7a97fcc5071b095b7be861 (diff) | |
download | erlang.mk-1a5852f6750615f72e3523bb8685f98210f81e11.tar.gz erlang.mk-1a5852f6750615f72e3523bb8685f98210f81e11.tar.bz2 erlang.mk-1a5852f6750615f72e3523bb8685f98210f81e11.zip |
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.
Diffstat (limited to 'core/deps.mk')
-rw-r--r-- | core/deps.mk | 10 |
1 files changed, 10 insertions, 0 deletions
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 |