aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-12-03 20:50:42 +0100
committerLoïc Hoguin <[email protected]>2018-12-03 20:52:10 +0100
commit2163fef859c46ebe5f3d7827ce8ddfd45ee56691 (patch)
tree92da2d13ec3a647c14dacd878bf52c31e5d69d35
parent983f82bdfcb3e78f04468fcfd02d6a6ee5869b13 (diff)
downloaderlang.mk-2163fef859c46ebe5f3d7827ce8ddfd45ee56691.tar.gz
erlang.mk-2163fef859c46ebe5f3d7827ce8ddfd45ee56691.tar.bz2
erlang.mk-2163fef859c46ebe5f3d7827ce8ddfd45ee56691.zip
Print a changelog when updating Erlang.mk
-rw-r--r--CHANGELOG.asciidoc9
-rw-r--r--Makefile7
-rw-r--r--core/core.mk14
-rw-r--r--test/core_upgrade.mk24
4 files changed, 46 insertions, 8 deletions
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
new file mode 100644
index 0000000..ef5d2f2
--- /dev/null
+++ b/CHANGELOG.asciidoc
@@ -0,0 +1,9 @@
+2018/12/03: Changelog introduced.
+
+2018/12/03: Relx has been updated to v3.27.0.
+
+2018/12/03: Dependencies are no longer always rebuilt by
+ default. Please check the documentation for
+ information. A quick fix if this causes an
+ issue is to add `FULL = 1` at the top of your
+ Makefile.
diff --git a/Makefile b/Makefile
index 89015a0..b6b245c 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,12 @@ ERLANG_MK_VERSION = $(shell git describe --dirty --tags --always)
.PHONY: all check
all:
- export LC_COLLATE=C; \
+# Temporarily force the printing of the CHANGELOG.
+# The required variable hadn't been introduced yet.
+#ifdef UPGRADE
+ @cat CHANGELOG.asciidoc
+#endif
+ @export LC_COLLATE=C; \
awk 'FNR==1 && NR!=1{print ""}1' $(patsubst %,%.mk,$(BUILD_CONFIG)) \
| sed 's/^ERLANG_MK_VERSION =.*/ERLANG_MK_VERSION = $(ERLANG_MK_VERSION)/' \
| sed 's:^ERLANG_MK_WITHOUT =.*:ERLANG_MK_WITHOUT = $(WITHOUT):' > $(ERLANG_MK)
diff --git a/core/core.mk b/core/core.mk
index bc4d306..27e8a87 100644
--- a/core/core.mk
+++ b/core/core.mk
@@ -196,15 +196,15 @@ ERLANG_MK_BUILD_DIR ?= .erlang.mk.build
erlang-mk: WITHOUT ?= $(ERLANG_MK_WITHOUT)
erlang-mk:
ifdef ERLANG_MK_COMMIT
- git clone $(ERLANG_MK_REPO) $(ERLANG_MK_BUILD_DIR)
- cd $(ERLANG_MK_BUILD_DIR) && git checkout $(ERLANG_MK_COMMIT)
+ $(verbose) git clone $(ERLANG_MK_REPO) $(ERLANG_MK_BUILD_DIR)
+ $(verbose) cd $(ERLANG_MK_BUILD_DIR) && git checkout $(ERLANG_MK_COMMIT)
else
- git clone --depth 1 $(ERLANG_MK_REPO) $(ERLANG_MK_BUILD_DIR)
+ $(verbose) git clone --depth 1 $(ERLANG_MK_REPO) $(ERLANG_MK_BUILD_DIR)
endif
- if [ -f $(ERLANG_MK_BUILD_CONFIG) ]; then cp $(ERLANG_MK_BUILD_CONFIG) $(ERLANG_MK_BUILD_DIR)/build.config; fi
- $(MAKE) -C $(ERLANG_MK_BUILD_DIR) WITHOUT='$(strip $(WITHOUT))'
- cp $(ERLANG_MK_BUILD_DIR)/erlang.mk ./erlang.mk
- rm -rf $(ERLANG_MK_BUILD_DIR)
+ $(verbose) if [ -f $(ERLANG_MK_BUILD_CONFIG) ]; then cp $(ERLANG_MK_BUILD_CONFIG) $(ERLANG_MK_BUILD_DIR)/build.config; fi
+ $(gen_verbose) $(MAKE) --no-print-directory -C $(ERLANG_MK_BUILD_DIR) WITHOUT='$(strip $(WITHOUT))' UPGRADE=1
+ $(verbose) cp $(ERLANG_MK_BUILD_DIR)/erlang.mk ./erlang.mk
+ $(verbose) rm -rf $(ERLANG_MK_BUILD_DIR)
# The erlang.mk package index is bundled in the default erlang.mk build.
# Search for the string "copyright" to skip to the rest of the code.
diff --git a/test/core_upgrade.mk b/test/core_upgrade.mk
index 3a2a43e..9567518 100644
--- a/test/core_upgrade.mk
+++ b/test/core_upgrade.mk
@@ -6,6 +6,30 @@ CORE_UPGRADE_TARGETS = $(call list_targets,core-upgrade)
core-upgrade: $(CORE_UPGRADE_TARGETS)
+core-upgrade-changelog: build clean
+
+ $i "Bootstrap a new OTP library named $(APP)"
+ $t mkdir $(APP)/
+ $t cp ../erlang.mk $(APP)/
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
+
+ $i "Fork erlang.mk locally and set a test CHANGELOG.asciidoc"
+ $t git clone -q https://github.com/ninenines/erlang.mk $(APP)/alt-erlangmk-repo
+ $t echo "$(APP)$(APP)" > $(APP)/alt-erlangmk-repo/CHANGELOG.asciidoc
+# Since part of this functionality needs the main Makefile, copy it.
+ $t cp ../Makefile $(APP)/alt-erlangmk-repo/
+ $t (cd $(APP)/alt-erlangmk-repo && \
+ git config user.email "[email protected]" && \
+ git config user.name "test suite" && \
+ git add CHANGELOG.asciidoc Makefile && \
+ git commit -q --no-gpg-sign -a -m 'Add test changelog')
+
+ $i "Point application to an alternate erlang.mk repository"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "ERLANG_MK_REPO = file://$(abspath $(APP)/alt-erlangmk-repo)\n"}' $(APP)/Makefile
+
+ $i "Update erlang.mk; CHANGELOG.asciidoc should be printed"
+ $t $(MAKE) -C $(APP) erlang-mk | grep -c "$(APP)$(APP)" | grep -q 1
+
core-upgrade-conflicting-configs: build clean
$i "Bootstrap a new OTP library named $(APP)"