diff options
author | Jean-Sébastien Pédron <[email protected]> | 2015-11-17 17:26:47 +0100 |
---|---|---|
committer | Jean-Sébastien Pédron <[email protected]> | 2015-11-17 18:32:17 +0100 |
commit | ffba4c451fc484cb59e4cfea6d03347895d11ec0 (patch) | |
tree | 51965b4ee10f586ee56126eebe3243649d57740f /core | |
parent | bd6e00675e2b87cf031017b931a02353fc67b250 (diff) | |
download | erlang.mk-ffba4c451fc484cb59e4cfea6d03347895d11ec0.tar.gz erlang.mk-ffba4c451fc484cb59e4cfea6d03347895d11ec0.tar.bz2 erlang.mk-ffba4c451fc484cb59e4cfea6d03347895d11ec0.zip |
make erlang-mk: Copy build.config after switching to $(ERLANG_MK_COMMIT)
If the local build.config has changes compared to upstream's
master branch, and $(ERLANG_MK_COMMIT) also brings changes to this
file, copying the local file to the checkout before switching to
$(ERLANG_MK_COMMIT) caused git-checkout(1) to abort with:
error: Your local changes to the following files would be overwritten by checkout:
build.config
Please, commit your changes or stash them before you can switch branches.
Aborting
While here, fix `core-upgrade-custom-repo` test case: without switching
back the alternate erlang.mk repository to its master branch, the clone
always got the test-copyright branch by default, making the
ERLANG_MK_COMMIT check ineffective.
Diffstat (limited to 'core')
-rw-r--r-- | core/core.mk | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/core.mk b/core/core.mk index 407b940..4ec72f2 100644 --- a/core/core.mk +++ b/core/core.mk @@ -192,8 +192,11 @@ ERLANG_MK_BUILD_DIR ?= .erlang.mk.build erlang-mk: git clone $(ERLANG_MK_REPO) $(ERLANG_MK_BUILD_DIR) +ifdef ERLANG_MK_COMMIT + cd $(ERLANG_MK_BUILD_DIR) && git checkout $(ERLANG_MK_COMMIT) +endif if [ -f $(ERLANG_MK_BUILD_CONFIG) ]; then cp $(ERLANG_MK_BUILD_CONFIG) $(ERLANG_MK_BUILD_DIR)/build.config; fi - cd $(ERLANG_MK_BUILD_DIR) && $(if $(ERLANG_MK_COMMIT),git checkout $(ERLANG_MK_COMMIT) &&) $(MAKE) + $(MAKE) -C $(ERLANG_MK_BUILD_DIR) cp $(ERLANG_MK_BUILD_DIR)/erlang.mk ./erlang.mk rm -rf $(ERLANG_MK_BUILD_DIR) |