diff mbox series

[3/8] package/pkg-golang: don't expand license info when empty

Message ID 2b8586e943724302b50a4dda7a13264134ad1841.1698941362.git.yann.morin@orange.com
State Accepted
Headers show
Series [1/8] package/pkg-cargo: don't expand license info when empty | expand

Commit Message

Yann E. MORIN Nov. 2, 2023, 4:09 p.m. UTC
From: "Yann E. MORIN" <yann.morin@orange.com>

The o infrastructure automatically expands the list of licenses with a
little blurb that the licenses for vendored dependencies might be
missing in the list.

However, when a package does not define a license, the resulting text is
sub-optimal, resulting in a manifest that contains (with a leading
comma, yes):

    , vendored dependencies licenses probably not listed

In that case, pointing out some unkown licensing terms may be part of
unkonwn licensing terms is superfluous.

Instead, just let the legal infra do its job, and report an "unkown"
license altogether.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
---
 package/pkg-golang.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk
index 7ba82284f3..1fa0b001e0 100644
--- a/package/pkg-golang.mk
+++ b/package/pkg-golang.mk
@@ -92,8 +92,12 @@  $(2)_DL_ENV += \
 	$$($(2)_GO_ENV)
 
 # Due to vendoring, it is pretty likely that not all licenses are
-# listed in <pkg>_LICENSE.
+# listed in <pkg>_LICENSE. If the license is unset, it is "unknown"
+# so adding unknowns to some unknown is still some other unkown,
+# so don't append the blurb in that case.
+ifneq ($$($(2)_LICENSE),)
 $(2)_LICENSE += , vendored dependencies licenses probably not listed
+endif
 
 # Build step. Only define it if not already defined by the package .mk
 # file.