[openwrt/openwrt] build: skip download for host build with AUTOREMOVE if already compiled
LEDE Commits
lede-commits at lists.infradead.org
Mon Jan 23 10:19:08 PST 2023
ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/37b8b315e158312246798221c79f0dd5a640e898
commit 37b8b315e158312246798221c79f0dd5a640e898
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Fri Nov 11 16:40:45 2022 +0100
build: skip download for host build with AUTOREMOVE if already compiled
Packages in general use 4 check to trigger a recompile:
- timestamp for the build_dir
- timestamp for the staging stamp dir
- depends hash for the build_dir prepared file
- presence of package archieve in dl
If host tools are prebuilt and shipped in a container or manually
installed from an archieve, it would be ideal to skip including the
package archieve and just provide the build_dir prepared files and the
staging stamp file (and the actualy prebuilt tools).
Add some logic to skip dl download for host tools if AUTOREMOVE is
selected and checks for the presence of staging dir stamp file and build
dir stamp file.
If one of these requirements are not met, the package is redownloaded
and rebuilt.
Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
include/host-build.mk | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/host-build.mk b/include/host-build.mk
index 22fcc31f15..2cc1ec5842 100644
--- a/include/host-build.mk
+++ b/include/host-build.mk
@@ -206,5 +206,9 @@ endif
define HostBuild
$(HostBuild/Core)
- $(if $(if $(PKG_HOST_ONLY),,$(if $(and $(filter host-%,$(MAKECMDGOALS)),$(PKG_SKIP_DOWNLOAD)),,$(STAMP_PREPARED))),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
+ $(if $(if $(PKG_HOST_ONLY),,$(if $(and $(filter host-%,$(MAKECMDGOALS)),$(PKG_SKIP_DOWNLOAD)),,$(STAMP_PREPARED))),,
+ $(if $(and $(CONFIG_AUTOREMOVE), $(wildcard $(HOST_STAMP_INSTALLED), $(wildcard $(HOST_STAMP_BUILT)))),,
+ $(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))
+ )
+ )
endef
More information about the lede-commits
mailing list