From 71bb1b27ea3bc53138a5fcf1ae08409759f1790f Mon Sep 17 00:00:00 2001 From: Nicolas Carrier Date: Fri, 13 Jan 2023 12:46:22 +0100 Subject: [PATCH] package/pkg-generic.mk: no legal info WARNING if REDISTRIBUTE = NO Packages making use of OVERRIDE_SRC_DIR or of the local SITE_METHOD, will trigger a warning when the legal-info target is built, for example: WARNING: foo: sources not saved (local packages not handled) But in the situation where the packages has explicitly defined FOO_REDISTRIBUTE = NO in its .mk file, it makes no sense since the sources wouldn't be saved anyway. This patch swap the conditions on the type of package and on the REDISTRIBUTE value, so that the warnings get issued only if REDISTRIBUTE equals YES. Signed-off-by: Nicolas Carrier Signed-off-by: Yann E. MORIN (cherry picked from commit c541df41806f0940128ab333d693fb7766e98da7) Signed-off-by: Peter Korsgaard --- package/pkg-generic.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index fdf53063be..a88934b866 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -1145,6 +1145,7 @@ else $(Q)$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAWNAME),$$($(2)_BASENAME_RAW),$$($(2)_HASH_FILE),$$(F),$$($(2)_DIR)/$$(F),$$(call UPPERCASE,$(4)))$$(sep)) endif # license files +ifeq ($$($(2)_REDISTRIBUTE),YES) ifeq ($$($(2)_SITE_METHOD),local) # Packages without a tarball: don't save and warn @$$(call legal-warning-nosource,$$($(2)_RAWNAME),local) @@ -1155,7 +1156,6 @@ else ifneq ($$($(2)_OVERRIDE_SRCDIR),) else # Other packages -ifeq ($$($(2)_REDISTRIBUTE),YES) # Save the source tarball and any extra downloads, but not # patches, as they are handled specially afterwards. $$(foreach e,$$($(2)_ACTUAL_SOURCE_TARBALL) $$(notdir $$($(2)_EXTRA_DOWNLOADS)),\ @@ -1169,9 +1169,9 @@ ifeq ($$($(2)_REDISTRIBUTE),YES) $$($(2)_REDIST_SOURCES_DIR) || exit 1; \ printf "%s\n" "$$$${f##*/}" >>$$($(2)_REDIST_SOURCES_DIR)/series || exit 1; \ done <$$($(2)_DIR)/.applied_patches_list -endif # redistribute - endif # other packages + +endif # redistribute @$$(call legal-manifest,$$(call UPPERCASE,$(4)),$$($(2)_RAWNAME),$$($(2)_VERSION),$$(subst $$(space)$$(comma),$$(comma),$$($(2)_LICENSE)),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE),$$(call legal-deps,$(1))) endif # ifneq ($$(call qstrip,$$($(2)_SOURCE)),) $$(foreach hook,$$($(2)_POST_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))