From 1d382a7560e221083bec266f0f8fbcccd42bb324 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 3 May 2026 08:59:37 +0000 Subject: [PATCH] Recover depends downloads with stale fetch stamps --- depends/Makefile | 6 +++++- depends/funcs.mk | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/depends/Makefile b/depends/Makefile index 94ba6448..1d033114 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -83,9 +83,13 @@ download: $(foreach p,$(all_packages),$($(p)_fetched)) # and generate share/config.site for top-level ./configure. # -------------------------------------------------------------------- -.PHONY: install install-clean reinstall install-prefix +.PHONY: install install-clean reinstall install-prefix clean-sources install: install-prefix +clean-sources: + @echo "== Removing downloaded source archives and fetch stamps" + @rm -rf "$(SOURCES_PATH)" + install-prefix: $(packages) @echo "== Installing depends into: $(host_prefix)" @rm -rf "$(host_prefix)" diff --git a/depends/funcs.mk b/depends/funcs.mk index 989fe247..e495faa9 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -82,7 +82,12 @@ $(1)_download_path_fixed=$(subst :,\:,$$($(1)_download_path)) #default commands # The default behavior for tar will try to set ownership when running as uid 0 and may not succeed, --no-same-owner disables this behavior $(1)_fetch_cmds ?= $(call fetch_file,$(1),$(subst \:,:,$$($(1)_download_path_fixed)),$$($(1)_download_file),$($(1)_file_name),$($(1)_sha256_hash)) -$(1)_extract_cmds ?= mkdir -p $$($(1)_extract_dir) && echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && tar --no-same-owner --strip-components=1 -xf $$($(1)_source) +$(1)_extract_cmds ?= mkdir -p $$($(1)_extract_dir) && echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && \ + ( $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash || \ + ( rm -f $$($(1)_source) $$($(1)_fetched) && \ + $(call fetch_file,$(1),$(subst \:,:,$$($(1)_download_path_fixed)),$$($(1)_download_file),$($(1)_file_name),$($(1)_sha256_hash)) && \ + $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash ) ) && \ + tar --no-same-owner --strip-components=1 -xf $$($(1)_source) $(1)_preprocess_cmds ?= $(1)_build_cmds ?= $(1)_config_cmds ?=