github: add check-gh-conf targets to verify updates and downloads

This commit is contained in:
Tony Theodore 2017-03-21 15:54:55 +11:00
parent 0c2c6122ff
commit 6b40c10316
2 changed files with 29 additions and 1 deletions

View File

@ -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)),)

View File

@ -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))