From f4681fc417a057f46f00ac95474251944843a050 Mon Sep 17 00:00:00 2001 From: Arnout Vandecappelle Date: Sat, 14 Sep 2024 11:54:59 +0200 Subject: [PATCH] package/pkg-generic.mk: legal-info: make sure host-tar is available Commit aacca7f0639bac6bb3fb262d0b1738c4387edeb0 introduced the possibility to also create tarballs for packages that are local or overridden (i.e., with a custom version). However, it doesn't work correctly for PPD, because the PPD-host-tar and gzip are not available. This failure was silent because the mk_tar_gz function doesn't exit on error. The following error was printed but ignored: support/download/helpers: line 62: .../per-package/busybox/host/bin/tar: No such file or directory Call prepare-per-package-directory before calling mk_tar_gz which uses it. Note that we use only tar and gzip here, not all of DOWNLOAD_DEPENDENCIES, because tar and gzip are the only ones we really use. Also add this dependency to the legal-info target. We use an order-only dependency even though that makes not difference for a phony target, but this makes it similar to how it's done for the stamp targets. Note also that this dependency is redundant, because there is already a dependency on the foo-rsync target which does depend on DOWNLOAD_DEPENDENCIES. We still add the dependency explicitly in case things change with the foo-rsync target in the future. Signed-off-by: Arnout Vandecappelle Cc: Nicolas Carrier Reported-by: Yann E. MORIN Signed-off-by: Yann E. MORIN --- package/pkg-generic.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 69352b3730..48cc8ec800 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -1008,6 +1008,9 @@ $(1)-rsync: $$($(2)_TARGET_RSYNC) $(1)-source: $(1)-legal-source: +# For override, legal-info uses host-tar and host-gzip +$(1)-legal-info: | $(BR2_GZIP_HOST_DEPENDENCY) $(BR2_TAR_HOST_DEPENDENCY) + $(1)-external-deps: @echo "file://$$($(2)_OVERRIDE_SRCDIR)" @@ -1163,6 +1166,7 @@ ifneq ($$($(2)_OVERRIDE_SRCDIR),) $$(Q)rsync -au --chmod=u=rwX,go=rX $$(RSYNC_VCS_EXCLUSIONS) \ $(call qstrip,$$($(2)_OVERRIDE_SRCDIR))/ \ $$($(2)_BUILDDIR)/.legal-info-rsync/ + $$(call prepare-per-package-directory,$$(BR2_GZIP_HOST_DEPENDENCY) $$(BR2_TAR_HOST_DEPENDENCY)) $$(Q)mkdir -p $$($(2)_REDIST_SOURCES_DIR) $$(Q). support/download/helpers; set -x; cd $$($(2)_BUILDDIR); TAR=$$(TAR) mk_tar_gz \ $$($(2)_BUILDDIR)/.legal-info-rsync/ \