Skip to contentSkip to conversation

Fix utility-tasks.bbclass and nopackages.bbclass

PATCH In review Robert Yang 4 participants 7 messages May 25, 2016 – May 26, 2016

lore
Share & tools
lore
#0 lore raw

cover Fix utility-tasks.bbclass and nopackages.bbclass

The following changes since commit bb4ead9b7b1400c37a72d148d9775bdf4210ec37:

linux-yocto/4.4: integrate v4.4.11 (2016-05-25 07:49:55 +0100)

are available in the git repository at:

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

Robert Yang (2):
utility-tasks.bbclass: fix do_listtasks
nopackages.bbclass: deltask foo_setscene

 meta/classes/nopackages.bbclass    |  6 ++++++
 meta/classes/utility-tasks.bbclass | 16 ++++++++--------
 2 files changed, 14 insertions(+), 8 deletions(-)
Signature · 1 line
2.8.0
#1 lore raw

PATCH 1/2 utility-tasks.bbclass: fix do_listtasks

It lists deleted tasks which is unexpected, use __BBTASKS to fix the problem since deltask() which is defined in bitbake/lib/bb/build.py updates __BBTASKS correctly.

---
 meta/classes/utility-tasks.bbclass | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
meta/classes/utility-tasks.bbclass +8 -8
index 7bc584a..b06d335 100644
@@ -3,14 +3,14 @@ do_listtasks[nostamp] = "1"
 python do_listtasks() {
     taskdescs = {}
     maxlen = 0
-    for e in d.keys():
-        if d.getVarFlag(e, 'task', True):
-            maxlen = max(maxlen, len(e))
-            if e.endswith('_setscene'):
-                desc = "%s (setscene version)" % (d.getVarFlag(e[:-9], 'doc', True) or '')
-            else:
-                desc = d.getVarFlag(e, 'doc', True) or ''
-            taskdescs[e] = desc
+    bbtasks = d.getVar('__BBTASKS', True)
+    for task in bbtasks:
+        maxlen = max(maxlen, len(task))
+        if task.endswith('_setscene'):
+            desc = "%s (setscene version)" % (d.getVarFlag(task[:-9], 'doc', True) or '')
+        else:
+            desc = d.getVarFlag(task, 'doc', True) or ''
+        taskdescs[task] = desc
 
     tasks = sorted(taskdescs.keys())
     for taskname in tasks:
Signature · 1 line
2.8.0
#2 lore raw

Re: [PATCH 1/2] utility-tasks.bbclass: fix do_listtasks

Quoted 4 lines · Robert Yang

It lists deleted tasks which is unexpected, use __BBTASKS to fix the problem since deltask() which is defined in bitbake/lib/bb/build.py updates __BBTASKS correctly.

Wouldn't an alternative be to change deltask so that it also remove the "task" flag from the variable?

Ross

#3 lore raw

Re: [PATCH 1/2] utility-tasks.bbclass: fix do_listtasks

Quoted 11 lines · Ross

On 25 May 2016 at 10:23, Robert Yang <[email protected] <mailto:[email protected]>> wrote:

It lists deleted tasks which is unexpected, use __BBTASKS to fix the problem since deltask() which is defined in bitbake/lib/bb/build.py updates __BBTASKS correctly.

Wouldn't an alternative be to change deltask so that it also remove the "task" flag from the variable?

The problem is, if we do:

d.delVarFlag(task, 'task')

Then maybe we should remove the whole task from d rather than only remove the flags ?

// Robert

Quoted 2 lines

Ross

#4 lore raw

Re: [PATCH 1/2] utility-tasks.bbclass: fix do_listtasks

Quoted 16 lines · Robert Yang
Quoted 4 lines · Ross

On 25 May 2016 at 10:23, Robert Yang <[email protected] <mailto:[email protected]>> wrote:

Quoted 9 lines

It lists deleted tasks which is unexpected, use __BBTASKS to fix the problem since deltask() which is defined in bitbake/lib/bb/build.py updates __BBTASKS correctly.

Wouldn't an alternative be to change deltask so that it also remove the "task"
flag from the variable?

Quoted 6 lines

The problem is, if we do:

d.delVarFlag(task, 'task')

Then maybe we should remove the whole task from d rather than only remove the flags ?

IMO, no, deltask and addtask control whether an existing function is a task or not, so can be run like a task. If you want the variable deleted, that's what delVar is for.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
#5 lore raw

Re: [PATCH 1/2] utility-tasks.bbclass: fix do_listtasks

In reply to Robert Yang
Quoted 29 lines · Robert Yang

It lists deleted tasks which is unexpected, use __BBTASKS to fix the problem since deltask() which is defined in bitbake/lib/bb/build.py updates __BBTASKS correctly.

---
 meta/classes/utility-tasks.bbclass | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
meta/classes/utility-tasks.bbclass +2 -9
index 7bc584a..b06d335 100644
@@ -3,14 +3,14 @@ do_listtasks[nostamp] = "1"
 python do_listtasks() {
     taskdescs = {}
     maxlen = 0
-    for e in d.keys():
-        if d.getVarFlag(e, 'task', True):
-            maxlen = max(maxlen, len(e))
-            if e.endswith('_setscene'):
-                desc = "%s (setscene version)" % (d.getVarFlag(e[:
-9], 'doc', True) or '')
-            else:
-                desc = d.getVarFlag(e, 'doc', True) or ''
-            taskdescs[e] = desc
+    bbtasks = d.getVar('__BBTASKS', True)
+    for task in bbtasks:

meta/classes/utility-tasks.bbclass do_listtasks[nostamp] = "1" · line 16

Quoted 10 lines
meta/classes/utility-tasks.bbclass +6 -1
+        maxlen = max(maxlen, len(task))
+        if task.endswith('_setscene'):
+            desc = "%s (setscene version)" % (d.getVarFlag(task[:
-9], 'doc', True) or '')
+        else:
+            desc = d.getVarFlag(task, 'doc', True) or ''
+        taskdescs[task] = desc
 
     tasks = sorted(taskdescs.keys())
     for taskname in tasks:

__BBTASKS is a bitbake internal variable and OE should not know or care about it, its implementation may change without warning and I won't take bug reports about that.

We need to fix this differently.

Cheers,

Richard

#6 lore raw

PATCH 2/2 nopackages.bbclass: deltask foo_setscene

In reply to Robert Yang

When deltask foo, also deltask foo_setscene.

---
 meta/classes/nopackages.bbclass | 6 ++++++
 1 file changed, 6 insertions(+)
meta/classes/nopackages.bbclass +6 -0
index 0c2761b..559f507 100644
@@ -4,3 +4,9 @@ deltask do_package_write_ipk
 deltask do_package_write_deb
 deltask do_package_qa
 deltask do_packagedata
+deltask do_package_setscene
+deltask do_package_write_rpm_setscene
+deltask do_package_write_ipk_setscene
+deltask do_package_write_deb_setscene
+deltask do_package_qa_setscene
+deltask do_packagedata_setscene
Signature · 1 line
2.8.0