summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2017-03-21 04:54:55 (GMT)
committerTony Theodore <tonyt@logyst.com>2017-03-21 04:59:32 (GMT)
commit6b40c10316fd1fa5cd46442a24e8bff86bc0b8f9 (patch)
tree4dc38734dc8592892fe214b73fc56c2873a385a4
parent0c2c6122ffded475d31c8057640751f4903b9aa3 (diff)
downloadmxe-6b40c10316fd1fa5cd46442a24e8bff86bc0b8f9.zip
mxe-6b40c10316fd1fa5cd46442a24e8bff86bc0b8f9.tar.gz
mxe-6b40c10316fd1fa5cd46442a24e8bff86bc0b8f9.tar.bz2
github: add check-gh-conf targets to verify updates and downloads
-rw-r--r--Makefile9
-rw-r--r--github.mk21
2 files changed, 29 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 53d312b..47cc86d 100644
--- a/Makefile
+++ b/Makefile
@@ -488,6 +488,7 @@ download-only-$(1): download-only-$($(1)_FILE)
download-only-$($(1)_FILE)::
$(and $($(1)_URL),
@[ -d '$(LOG_DIR)/$(TIMESTAMP)' ] || mkdir -p '$(LOG_DIR)/$(TIMESTAMP)'
+ @$$(if $$(REMOVE_DOWNLOAD),rm -f '$(PKG_DIR)/$($(1)_FILE)')
@if ! $(call CHECK_PKG_ARCHIVE,$(1)); then \
$(PRINTF_FMT) '[download]' '$(1)' | $(RTRIM); \
(set -x; $(call DOWNLOAD_PKG_ARCHIVE,$(1))) &> '$(LOG_DIR)/$(TIMESTAMP)/$(1)-download'; \
@@ -506,8 +507,14 @@ download-only-$($(1)_FILE)::
exit 1; \
fi; \
fi)
+
+.PHONY: prepare-pkg-source-$(1)
+prepare-pkg-source-$(1): download-only-$(1)
+ rm -rf '$(2)'
+ mkdir -p '$(2)'
+ $$(call PREPARE_PKG_SOURCE,$(1),$(2))
endef
-$(foreach PKG,$(PKGS),$(eval $(call PKG_RULE,$(PKG))))
+$(foreach PKG,$(PKGS),$(eval $(call PKG_RULE,$(PKG),$(call TMP_DIR,$(PKG)))))
# disable networking during build-only rules for reproducibility
ifeq ($(findstring darwin,$(BUILD)),)
diff --git a/github.mk b/github.mk
index 8e6409c..f6aef36 100644
--- a/github.mk
+++ b/github.mk
@@ -114,3 +114,24 @@ define MXE_GET_GH_TAG
| $(SORT) -V
| tail -1
endef
+
+GITHUB_PKGS = $(patsubst %_GH_CONF,%,$(filter %_GH_CONF,$(.VARIABLES)))
+
+# check-gh-conf : test updates and source directory
+# check-gh-conf-dl: removes downloads and tests above
+
+# a test of many package updates may hit rate limit of 60/hr
+# https://developer.github.com/v3/#rate-limiting
+
+.PHONY: check-gh-conf check-gh-conf-%
+check-gh-conf-dl: REMOVE_DOWNLOAD = true
+check-gh-conf-dl: MXE_NO_BACKUP_DL = true
+check-gh-conf-dl: check-gh-conf
+check-gh-conf-pkg-%: check-update-package-% download-only-%
+ @$(PRINTF_FMT) '[prep-src]' '$(*)' | $(RTRIM)
+ @($(MAKE) -f '$(MAKEFILE)' 'prepare-pkg-source-$(*)') > /dev/null
+ @rm -rf '$(call TMP_DIR,$(*))'
+
+# secondexpansion here since this file is included before pkg makefiles
+.SECONDEXPANSION:
+check-gh-conf: $$(addprefix check-gh-conf-pkg-,$$(GITHUB_PKGS))