All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] bitbake: use layer priority when applying bbappends
@ 2011-05-31 17:36 ` Paul Eggleton
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Eggleton @ 2011-05-31 17:36 UTC (permalink / raw)
  To: bitbake-devel

The following changes since commit 52295fa3deef3b0374b99829626d524cefae6001:

  Improve handling of 'all' architecture recipes and their interaction with sstate (2011-05-31 13:07:00 +0100)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib paule/bbfile-sort
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=paule/bbfile-sort

Paul Eggleton (1):
  bitbake: use layer priority when applying bbappends

 bitbake/lib/bb/cooker.py |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

-- 
1.7.4.1




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

* [PATCH 1/1] bitbake: use layer priority when applying bbappends
  2011-05-31 17:36 ` Paul Eggleton
@ 2011-05-31 17:36   ` Paul Eggleton
  -1 siblings, 0 replies; 5+ messages in thread
From: Paul Eggleton @ 2011-05-31 17:36 UTC (permalink / raw)
  To: bitbake-devel

If the priority of a layer has been specified with BBFILE_PRIORITY_ then
use that to sort the list of BBFILES entries, which will affect the order
in which .bbappend files are applied.

Fixes [YOCTO #1125]

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/lib/bb/cooker.py |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 3973529..bb58f0b 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -405,6 +405,15 @@ class BBCooker:
         print("}", file=tdepends_file)
         logger.info("Task dependencies saved to 'task-depends.dot'")
 
+    def calc_bbfile_priority( self, filename, matched = None ):
+        for _, _, regex, pri in self.status.bbfile_config_priorities:
+            if regex.match(filename):
+                if matched != None:
+                    if not regex in matched:
+                        matched.add(regex)
+                return pri
+        return 0
+
     def buildDepgraph( self ):
         all_depends = self.status.all_depends
         pn_provides = self.status.pn_provides
@@ -413,15 +422,6 @@ class BBCooker:
         bb.data.update_data(localdata)
         bb.data.expandKeys(localdata)
 
-        matched = set()
-        def calc_bbfile_priority(filename):
-            for _, _, regex, pri in self.status.bbfile_config_priorities:
-                if regex.match(filename):
-                    if not regex in matched:
-                        matched.add(regex)
-                    return pri
-            return 0
-
         # Handle PREFERRED_PROVIDERS
         for p in (bb.data.getVar('PREFERRED_PROVIDERS', localdata, 1) or "").split():
             try:
@@ -434,8 +434,9 @@ class BBCooker:
             self.status.preferred[providee] = provider
 
         # Calculate priorities for each file
+        matched = set()
         for p in self.status.pkg_fn:
-            self.status.bbfile_priority[p] = calc_bbfile_priority(p)
+            self.status.bbfile_priority[p] = calc_bbfile_priority(p, matched)
  
         # Don't show the warning if the BBFILE_PATTERN did match .bbappend files
         unmatched = set()
@@ -950,6 +951,9 @@ class BBCooker:
         files = (data.getVar( "BBFILES", self.configuration.data, 1 ) or "").split()
         data.setVar("BBFILES", " ".join(files), self.configuration.data)
 
+        # Sort files by priority
+        files.sort( key=lambda fileitem: self.calc_bbfile_priority(fileitem) )
+
         if not len(files):
             files = self.get_bbfiles()
 
-- 
1.7.4.1




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

* [PATCH 0/1] bitbake: use layer priority when applying bbappends
@ 2011-05-31 17:36 ` Paul Eggleton
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Eggleton @ 2011-05-31 17:36 UTC (permalink / raw)
  To: poky

The following changes since commit 52295fa3deef3b0374b99829626d524cefae6001:

  Improve handling of 'all' architecture recipes and their interaction with sstate (2011-05-31 13:07:00 +0100)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib paule/bbfile-sort
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=paule/bbfile-sort

Paul Eggleton (1):
  bitbake: use layer priority when applying bbappends

 bitbake/lib/bb/cooker.py |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

-- 
1.7.4.1



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

* [PATCH 1/1] bitbake: use layer priority when applying bbappends
@ 2011-05-31 17:36   ` Paul Eggleton
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Eggleton @ 2011-05-31 17:36 UTC (permalink / raw)
  To: poky

If the priority of a layer has been specified with BBFILE_PRIORITY_ then
use that to sort the list of BBFILES entries, which will affect the order
in which .bbappend files are applied.

Fixes [YOCTO #1125]

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/lib/bb/cooker.py |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 3973529..bb58f0b 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -405,6 +405,15 @@ class BBCooker:
         print("}", file=tdepends_file)
         logger.info("Task dependencies saved to 'task-depends.dot'")
 
+    def calc_bbfile_priority( self, filename, matched = None ):
+        for _, _, regex, pri in self.status.bbfile_config_priorities:
+            if regex.match(filename):
+                if matched != None:
+                    if not regex in matched:
+                        matched.add(regex)
+                return pri
+        return 0
+
     def buildDepgraph( self ):
         all_depends = self.status.all_depends
         pn_provides = self.status.pn_provides
@@ -413,15 +422,6 @@ class BBCooker:
         bb.data.update_data(localdata)
         bb.data.expandKeys(localdata)
 
-        matched = set()
-        def calc_bbfile_priority(filename):
-            for _, _, regex, pri in self.status.bbfile_config_priorities:
-                if regex.match(filename):
-                    if not regex in matched:
-                        matched.add(regex)
-                    return pri
-            return 0
-
         # Handle PREFERRED_PROVIDERS
         for p in (bb.data.getVar('PREFERRED_PROVIDERS', localdata, 1) or "").split():
             try:
@@ -434,8 +434,9 @@ class BBCooker:
             self.status.preferred[providee] = provider
 
         # Calculate priorities for each file
+        matched = set()
         for p in self.status.pkg_fn:
-            self.status.bbfile_priority[p] = calc_bbfile_priority(p)
+            self.status.bbfile_priority[p] = calc_bbfile_priority(p, matched)
  
         # Don't show the warning if the BBFILE_PATTERN did match .bbappend files
         unmatched = set()
@@ -950,6 +951,9 @@ class BBCooker:
         files = (data.getVar( "BBFILES", self.configuration.data, 1 ) or "").split()
         data.setVar("BBFILES", " ".join(files), self.configuration.data)
 
+        # Sort files by priority
+        files.sort( key=lambda fileitem: self.calc_bbfile_priority(fileitem) )
+
         if not len(files):
             files = self.get_bbfiles()
 
-- 
1.7.4.1



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

* Re: [PATCH 1/1] bitbake: use layer priority when applying bbappends
  2011-05-31 17:36   ` Paul Eggleton
  (?)
@ 2011-06-01 10:07   ` Paul Eggleton
  -1 siblings, 0 replies; 5+ messages in thread
From: Paul Eggleton @ 2011-06-01 10:07 UTC (permalink / raw)
  To: poky

On Tuesday 31 May 2011 18:36:55 Paul Eggleton wrote:
> -            self.status.bbfile_priority[p] = calc_bbfile_priority(p)
> +            self.status.bbfile_priority[p] = calc_bbfile_priority(p,
> matched)

Oops, this should be self.calc_bbfile_priority. Have updated contrib branch & 
sent updated patch to bitbake-devel.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

end of thread, other threads:[~2011-06-01 10:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-31 17:36 [PATCH 0/1] bitbake: use layer priority when applying bbappends Paul Eggleton
2011-05-31 17:36 ` Paul Eggleton
2011-05-31 17:36 ` [PATCH 1/1] " Paul Eggleton
2011-05-31 17:36   ` Paul Eggleton
2011-06-01 10:07   ` Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.