Skip to contentSkip to conversation

base: improve LICENSE_FLAGS_DETAILS output

PATCH In review [email protected] 2 participants 4 messages Jun 21, 2023 – Sep 8, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 base: improve LICENSE_FLAGS_DETAILS output

From: Ross Burton <[email protected]>

Don't prefix the output of LICENSE_FLAGS_DETAILS with "For further details, see" so that recipes can put arbitrary text in their license details instead of being limited to a specific sentence structure.

---
 meta/classes-global/base.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-global/base.bbclass +1 -1
index 976a2ddee4b..cbda8d12f09 100644
@@ -520,7 +520,7 @@ python () {
                 message = "Has a restricted license '%s' which is not listed in your LICENSE_FLAGS_ACCEPTED." % unmatched
                 details = d.getVarFlag("LICENSE_FLAGS_DETAILS", unmatched)
                 if details:
-                    message += " For further details, see %s." % details
+                    message += details
             bb.debug(1, "Skipping %s: %s" % (pn, message))
             raise bb.parse.SkipRecipe(message)
 
Signature · 1 line
2.34.1
#1 lore raw

Hi Ross,

I'm currently writing the doc patch for LICENSE_FLAGS_DETAILS. However, I don't find the current behavior optimal...

Quoted 16 lines · On 21.06.23 at 16:22, [email protected] wrote:

From: Ross Burton <[email protected]>

Don't prefix the output of LICENSE_FLAGS_DETAILS with "For further details, see" so that recipes can put arbitrary text in their license details instead of being limited to a specific sentence structure.

---
  meta/classes-global/base.bbclass | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-global/base.bbclass +0 -0
index 976a2ddee4b..cbda8d12f09 100644

meta/classes-global/base.bbclass python () { · line 523

Quoted 5 lines
meta/classes-global/base.bbclass +1 -1
@@ -520,7 +520,7 @@ python () {
                  message = "Has a restricted license '%s' which is not listed in your LICENSE_FLAGS_ACCEPTED." % unmatched
                  details = d.getVarFlag("LICENSE_FLAGS_DETAILS", unmatched)
                  if details:
-                    message += " For further details, see %s." % details
+                    message += details

What about
message += ' ' + details
instead?

Otherwise, you have to add a leading space to LICENSE_FLAGS_DETAILS. What do you think?

Happy to send a patch if that helps...

Cheers
Michael.

#2 lore raw
Quoted 30 lines · Michael Opdenacker

Hi Ross,

I'm currently writing the doc patch for LICENSE_FLAGS_DETAILS. However, I don't find the current behavior optimal...

Quoted 13 lines · On 21.06.23 at 16:22, [email protected] wrote:

From: Ross Burton <[email protected]>
Don't prefix the output of LICENSE_FLAGS_DETAILS with "For further details, see" so that recipes can put arbitrary text in their license details instead of being limited to a specific sentence structure.

---
 meta/classes-global/base.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-global/base.bbclass +0 -0
index 976a2ddee4b..cbda8d12f09 100644

meta/classes-global/base.bbclass python () { · line 523

Quoted 5 lines
meta/classes-global/base.bbclass +1 -1
@@ -520,7 +520,7 @@ python () {
                 message = "Has a restricted license '%s' which is not listed in your LICENSE_FLAGS_ACCEPTED." % unmatched
                 details = d.getVarFlag("LICENSE_FLAGS_DETAILS", unmatched)
                 if details:
-                    message += " For further details, see %s." % details
+                    message += details

What about
message += ' ' + details
instead?

Quoted 2 lines

Otherwise, you have to add a leading space to LICENSE_FLAGS_DETAILS. What do you think?

Throwing in a newline or a space seems sensible, yes. Want to send a patch?

FWIW the recipes in meta-arm put a newline at the beginning, so adding a blank line if details is set seems fairly sensible.

Ross

#3 lore raw
Quoted 29 lines · Ross Burton
Quoted 28 lines · Michael Opdenacker

Hi Ross,

I'm currently writing the doc patch for LICENSE_FLAGS_DETAILS. However, I don't find the current behavior optimal...

Quoted 13 lines · On 21.06.23 at 16:22, [email protected] wrote:

From: Ross Burton <[email protected]>
Don't prefix the output of LICENSE_FLAGS_DETAILS with "For further details, see" so that recipes can put arbitrary text in their license details instead of being limited to a specific sentence structure.

---
  meta/classes-global/base.bbclass | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-global/base.bbclass +0 -0
index 976a2ddee4b..cbda8d12f09 100644

meta/classes-global/base.bbclass python () { · line 523

Quoted 5 lines
meta/classes-global/base.bbclass +1 -1
@@ -520,7 +520,7 @@ python () {
                  message = "Has a restricted license '%s' which is not listed in your LICENSE_FLAGS_ACCEPTED." % unmatched
                  details = d.getVarFlag("LICENSE_FLAGS_DETAILS", unmatched)
                  if details:
-                    message += " For further details, see %s." % details
+                    message += details

What about
message += ' ' + details
instead?

Quoted 5 lines
Quoted 2 lines

Otherwise, you have to add a leading space to LICENSE_FLAGS_DETAILS. What do you think?

Throwing in a newline or a space seems sensible, yes. Want to send a patch?

FWIW the recipes in meta-arm put a newline at the beginning, so adding a blank line if details is set seems fairly sensible.

Thanks Ross, good idea!
I sent a patch, but been in a rush, forgot to add you to a "Reported-by" line.

Thanks again
Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com