From 6b40c10316fd1fa5cd46442a24e8bff86bc0b8f9 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Tue, 21 Mar 2017 15:54:55 +1100 Subject: github: add check-gh-conf targets to verify updates and downloads --- Makefile | 9 ++++++++- github.mk | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) 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)) -- cgit v0.12