diff mbox series

package/pkg-generic.mk: no legal info WARNING if REDISTRIBUTE = NO

Message ID d7d0dede27d4b3a026071a3019b58c5e8df9fe7b.camel@orolia.com
State Accepted
Headers show
Series package/pkg-generic.mk: no legal info WARNING if REDISTRIBUTE = NO | expand

Commit Message

Nicolas Carrier Jan. 13, 2023, 1:20 p.m. UTC
Hello,
Here is a patch to remove some legal-info warnings when REDISTRIBUTE is set to NO, for local and
override packages.

I can't use git send-email as our IT department has forbidden the standard pop/imap/smtp methods...
I hope that won't be too much of an issue :/

Comments

Yann E. MORIN Jan. 14, 2023, 8:38 p.m. UTC | #1
Nicolas, All,

On 2023-01-13 13:20 +0000, Nicolas Carrier spake thusly:
> Hello,
> Here is a patch to remove some legal-info warnings when REDISTRIBUTE is set to NO, for local and
> override packages.
> 
> I can't use git send-email as our IT department has forbidden the standard pop/imap/smtp methods...
> I hope that won't be too much of an issue :/

Yup, it did not go smoothly, but I'm afraid that you'll not be the only
one who can't send patches via proper mail... So, I took some time to
tweak my scripting to adapt to that situation.

> From 60a77caebc6d3b0900e1bbe56a61d821f7c586f9 Mon Sep 17 00:00:00 2001
> From: Nicolas Carrier <nicolas.carrier@orolia.com>
> Date: Fri, 13 Jan 2023 12:46:22 +0100
> Subject: [PATCH 1/1] 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.

Yes, it makes sense.

> 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 <nicolas.carrier@orolia.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  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 f2bea01d7d..2f8ba39edf 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))
> -- 
> 2.30.2
> 

> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
Yann E. MORIN Jan. 14, 2023, 8:49 p.m. UTC | #2
Nicolas, All,

On 2023-01-14 21:38 +0100, Yann E. MORIN spake thusly:
> On 2023-01-13 13:20 +0000, Nicolas Carrier spake thusly:
[--SNIP--]
> > 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.
> Yes, it makes sense.

I now realise that my comment was ambiguoug, given what I was commenting
on. So, let me rephrase:

Indeed, emitting the warning does not make sense. Indeed, what you
explained does make sense.

There, ambiguity resolved. ;-)

Regards,
Yann E. MORIN.
Nicolas Carrier Jan. 16, 2023, 7:43 a.m. UTC | #3
Ha yes, I have to admit that I had understood the contrary, thank you for lifting the ambiguity and
above all, thank you for having accepted my broken patches.

I'll try to bug my IT department as hard as I can so that they re-enable SMTP.

On Sat, 2023-01-14 at 21:49 +0100, Yann E. MORIN wrote:
> CAUTION: This email originated from outside of the organization.
> Do not click links or open attachments unless you recognize the sender and know the content is
> safe.
> 
> Nicolas, All,
> 
> On 2023-01-14 21:38 +0100, Yann E. MORIN spake thusly:
> > On 2023-01-13 13:20 +0000, Nicolas Carrier spake thusly:
> [--SNIP--]
> > > 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.
> > Yes, it makes sense.
> 
> I now realise that my comment was ambiguoug, given what I was commenting
> on. So, let me rephrase:
> 
> Indeed, emitting the warning does not make sense. Indeed, what you
> explained does make sense.
> 
> There, ambiguity resolved. ;-)
> 
> Regards,
> Yann E. MORIN.
> 
> --
> .-----------------.--------------------.------------------.--------------------.
> >  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> > +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> > +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> > http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'
Peter Korsgaard Jan. 16, 2023, 2:46 p.m. UTC | #4
>>>>> "Nicolas" == Nicolas Carrier <Nicolas.Carrier@orolia.com> writes:

 > Hello,
 > Here is a patch to remove some legal-info warnings when REDISTRIBUTE is set to NO, for local and
 > override packages.

 > I can't use git send-email as our IT department has forbidden the standard pop/imap/smtp methods...
 > I hope that won't be too much of an issue :/

:/

Committed to 2022.11.x and 2022.02.x, thanks.
diff mbox series

Patch

From 60a77caebc6d3b0900e1bbe56a61d821f7c586f9 Mon Sep 17 00:00:00 2001
From: Nicolas Carrier <nicolas.carrier@orolia.com>
Date: Fri, 13 Jan 2023 12:46:22 +0100
Subject: [PATCH 1/1] 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 <nicolas.carrier@orolia.com>
---
 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 f2bea01d7d..2f8ba39edf 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))
-- 
2.30.2