Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] archiver.bbclass: Add ENABLE_COPYLEFT_FILTER to enable/disable copyleft_filter.bbclass
@ 2020-05-15  9:56 Robert Yang
  2020-05-15  9:56 ` [PATCH 1/1] " Robert Yang
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Yang @ 2020-05-15  9:56 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit ce6c50ea68c34e02b487d54fdd9288e04833cdef:

  wayland: fix condition for strndup detection (2020-05-14 14:13:50 +0100)

are available in the Git repository at:

  git://git.openembedded.org/openembedded-core-contrib rbt/archiver2
  http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/archiver2

Robert Yang (1):
  archiver.bbclass: Add ENABLE_COPYLEFT_FILTER to enable/disable
    copyleft_filter.bbclass

 meta/classes/archiver.bbclass | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] archiver.bbclass: Add ENABLE_COPYLEFT_FILTER to enable/disable copyleft_filter.bbclass
  2020-05-15  9:56 [PATCH 0/1] archiver.bbclass: Add ENABLE_COPYLEFT_FILTER to enable/disable copyleft_filter.bbclass Robert Yang
@ 2020-05-15  9:56 ` Robert Yang
  2020-05-15 10:16   ` [OE-core] " Paul Barker
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Yang @ 2020-05-15  9:56 UTC (permalink / raw)
  To: openembedded-core

Set it to 0 can make it archive all the used sources during the build, nothing
will be filtered out, this is useful when we want to archive all the sources.

This equals to:
COPYLEFT_LICENSE_INCLUDE = "*"
COPYLEFT_LICENSE_EXCLUDE = ""

But there are a lot of settings in copyleft_filter.bbclass, so it may not work
when its default settings are changed, add the var ENABLE_COPYLEFT_FILTER will
make it more reliable.

The default value is 1, has no impact by default.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/classes/archiver.bbclass | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 48b4913a9f..f4e3478cd0 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -44,6 +44,9 @@
 COPYLEFT_RECIPE_TYPES ?= 'target native nativesdk cross crosssdk cross-canadian'
 inherit copyleft_filter
 
+# Set this to 0 will archive all used sources in the build
+ENABLE_COPYLEFT_FILTER ?= "1"
+
 ARCHIVER_MODE[srpm] ?= "0"
 ARCHIVER_MODE[src] ?= "patched"
 ARCHIVER_MODE[diff] ?= "0"
@@ -81,13 +84,13 @@ python () {
                 pn = p
                 break
 
-    included, reason = copyleft_should_include(d)
-    if not included:
-        bb.debug(1, 'archiver: %s is excluded: %s' % (pn, reason))
-        return
-    else:
-        bb.debug(1, 'archiver: %s is included: %s' % (pn, reason))
-
+    if oe.types.boolean(d.getVar('ENABLE_COPYLEFT_FILTER')):
+        included, reason = copyleft_should_include(d)
+        if not included:
+            bb.debug(1, 'archiver: %s is excluded: %s' % (pn, reason))
+            return
+        else:
+            bb.debug(1, 'archiver: %s is included: %s' % (pn, reason))
 
     # glibc-locale: do_fetch, do_unpack and do_patch tasks have been deleted,
     # so avoid archiving source here.
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH 1/1] archiver.bbclass: Add ENABLE_COPYLEFT_FILTER to enable/disable copyleft_filter.bbclass
  2020-05-15  9:56 ` [PATCH 1/1] " Robert Yang
@ 2020-05-15 10:16   ` Paul Barker
  2020-05-15 10:20     ` Robert Yang
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Barker @ 2020-05-15 10:16 UTC (permalink / raw)
  To: Robert Yang; +Cc: openembedded-core

On Fri, 15 May 2020 at 10:57, Robert Yang <liezhi.yang@windriver.com> wrote:
>
> Set it to 0 can make it archive all the used sources during the build, nothing
> will be filtered out, this is useful when we want to archive all the sources.
>
> This equals to:
> COPYLEFT_LICENSE_INCLUDE = "*"
> COPYLEFT_LICENSE_EXCLUDE = ""
>
> But there are a lot of settings in copyleft_filter.bbclass, so it may not work
> when its default settings are changed, add the var ENABLE_COPYLEFT_FILTER will
> make it more reliable.

Why would copyleft_filter.bbclass not work when the settings are
changed? They're intended to be configurable.

I've been using `COPYLEFT_LICENSE_INCLUDE = "*"` in several projects
for years now. I'm not sure that we need another overlapping variable
which could confuse users further.

Thanks,
Paul

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH 1/1] archiver.bbclass: Add ENABLE_COPYLEFT_FILTER to enable/disable copyleft_filter.bbclass
  2020-05-15 10:16   ` [OE-core] " Paul Barker
@ 2020-05-15 10:20     ` Robert Yang
  2020-05-15 10:32       ` Paul Barker
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Yang @ 2020-05-15 10:20 UTC (permalink / raw)
  To: Paul Barker; +Cc: openembedded-core


On 5/15/20 6:16 PM, Paul Barker wrote:
> On Fri, 15 May 2020 at 10:57, Robert Yang <liezhi.yang@windriver.com> wrote:
>>
>> Set it to 0 can make it archive all the used sources during the build, nothing
>> will be filtered out, this is useful when we want to archive all the sources.
>>
>> This equals to:
>> COPYLEFT_LICENSE_INCLUDE = "*"
>> COPYLEFT_LICENSE_EXCLUDE = ""
>>
>> But there are a lot of settings in copyleft_filter.bbclass, so it may not work
>> when its default settings are changed, add the var ENABLE_COPYLEFT_FILTER will
>> make it more reliable.
> 
> Why would copyleft_filter.bbclass not work when the settings are
> changed? They're intended to be configurable.
> 
> I've been using `COPYLEFT_LICENSE_INCLUDE = "*"` in several projects
> for years now. I'm not sure that we need another overlapping variable
> which could confuse users further.

As you know, there other settings in copyleft_filter.bbclass may affect
the result, such as:

COPYLEFT_RECIPE_TYPES
COPYLEFT_PN_INCLUDE
COPYLEFT_PN_EXCLUDE

These settings maybe changed, and it's not easy to detect the changes,
the ENABLE_COPYLEFT_FILTER can make it more reliable.

// Robert

> 
> Thanks,
> Paul
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH 1/1] archiver.bbclass: Add ENABLE_COPYLEFT_FILTER to enable/disable copyleft_filter.bbclass
  2020-05-15 10:20     ` Robert Yang
@ 2020-05-15 10:32       ` Paul Barker
  2020-05-15 10:56         ` Robert Yang
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Barker @ 2020-05-15 10:32 UTC (permalink / raw)
  To: Robert Yang; +Cc: openembedded-core

On Fri, 15 May 2020 at 11:22, Robert Yang <liezhi.yang@windriver.com> wrote:
>
>
> On 5/15/20 6:16 PM, Paul Barker wrote:
> > On Fri, 15 May 2020 at 10:57, Robert Yang <liezhi.yang@windriver.com> wrote:
> >>
> >> Set it to 0 can make it archive all the used sources during the build, nothing
> >> will be filtered out, this is useful when we want to archive all the sources.
> >>
> >> This equals to:
> >> COPYLEFT_LICENSE_INCLUDE = "*"
> >> COPYLEFT_LICENSE_EXCLUDE = ""
> >>
> >> But there are a lot of settings in copyleft_filter.bbclass, so it may not work
> >> when its default settings are changed, add the var ENABLE_COPYLEFT_FILTER will
> >> make it more reliable.
> >
> > Why would copyleft_filter.bbclass not work when the settings are
> > changed? They're intended to be configurable.
> >
> > I've been using `COPYLEFT_LICENSE_INCLUDE = "*"` in several projects
> > for years now. I'm not sure that we need another overlapping variable
> > which could confuse users further.
>
> As you know, there other settings in copyleft_filter.bbclass may affect
> the result, such as:
>
> COPYLEFT_RECIPE_TYPES
> COPYLEFT_PN_INCLUDE
> COPYLEFT_PN_EXCLUDE
>
> These settings maybe changed, and it's not easy to detect the changes,
> the ENABLE_COPYLEFT_FILTER can make it more reliable.

I still don't think I understand sorry. Why can't changes be detected?
What's unreliable in the existing code? Are there specific failure
cases we can give examples of?

I think there's a good argument for renaming copyleft_filter.bbclass
and all the variables since the names are confusing when you want the
archiver to include non-copyleft packages. But that would cause churn
and break lots of people's configs so I've never proposed it. Not sure
we need a master variable to enable/disable the whole class though.

Thanks,
Paul

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH 1/1] archiver.bbclass: Add ENABLE_COPYLEFT_FILTER to enable/disable copyleft_filter.bbclass
  2020-05-15 10:32       ` Paul Barker
@ 2020-05-15 10:56         ` Robert Yang
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Yang @ 2020-05-15 10:56 UTC (permalink / raw)
  To: Paul Barker; +Cc: openembedded-core



On 5/15/20 6:32 PM, Paul Barker wrote:
> On Fri, 15 May 2020 at 11:22, Robert Yang <liezhi.yang@windriver.com> wrote:
>>
>>
>> On 5/15/20 6:16 PM, Paul Barker wrote:
>>> On Fri, 15 May 2020 at 10:57, Robert Yang <liezhi.yang@windriver.com> wrote:
>>>>
>>>> Set it to 0 can make it archive all the used sources during the build, nothing
>>>> will be filtered out, this is useful when we want to archive all the sources.
>>>>
>>>> This equals to:
>>>> COPYLEFT_LICENSE_INCLUDE = "*"
>>>> COPYLEFT_LICENSE_EXCLUDE = ""
>>>>
>>>> But there are a lot of settings in copyleft_filter.bbclass, so it may not work
>>>> when its default settings are changed, add the var ENABLE_COPYLEFT_FILTER will
>>>> make it more reliable.
>>>
>>> Why would copyleft_filter.bbclass not work when the settings are
>>> changed? They're intended to be configurable.
>>>
>>> I've been using `COPYLEFT_LICENSE_INCLUDE = "*"` in several projects
>>> for years now. I'm not sure that we need another overlapping variable
>>> which could confuse users further.
>>
>> As you know, there other settings in copyleft_filter.bbclass may affect
>> the result, such as:
>>
>> COPYLEFT_RECIPE_TYPES
>> COPYLEFT_PN_INCLUDE
>> COPYLEFT_PN_EXCLUDE
>>
>> These settings maybe changed, and it's not easy to detect the changes,
>> the ENABLE_COPYLEFT_FILTER can make it more reliable.
> 
> I still don't think I understand sorry. Why can't changes be detected?
> What's unreliable in the existing code? Are there specific failure
> cases we can give examples of?

If one of the above variables' value is changed in a conf file, the archiver
will still work, but the results will be changed, it's not hard for advanced
users to detect that, but not easy for newbies.

> 
> I think there's a good argument for renaming copyleft_filter.bbclass
> and all the variables since the names are confusing when you want the
> archiver to include non-copyleft packages. But that would cause churn
> and break lots of people's configs so I've never proposed it. Not sure
> we need a master variable to enable/disable the whole class though.

I think that the problem is archiver's results depend on copyleft_filter
a lot, but they should be two separated functions, so I proposed a
new var to control it. But keep the current status is also OK since it
works.

// Robert

> 
> Thanks,
> Paul
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-15 10:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-15  9:56 [PATCH 0/1] archiver.bbclass: Add ENABLE_COPYLEFT_FILTER to enable/disable copyleft_filter.bbclass Robert Yang
2020-05-15  9:56 ` [PATCH 1/1] " Robert Yang
2020-05-15 10:16   ` [OE-core] " Paul Barker
2020-05-15 10:20     ` Robert Yang
2020-05-15 10:32       ` Paul Barker
2020-05-15 10:56         ` Robert Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox