All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] skipped recipe handling v2
@ 2011-06-09 16:42 Paul Eggleton
  2011-06-09 16:42 ` [PATCH 1/2] bitbake: track skipped packages Paul Eggleton
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Paul Eggleton @ 2011-06-09 16:42 UTC (permalink / raw)
  To: bitbake-devel

For the description of this changeset please see the original mail:
http://lists.linuxtogo.org/pipermail/bitbake-devel/2011-June/000911.html

Changes since v1: rebased against recent bitbake changes, added a cache
version bump.

These patches are against Poky but they apply cleanly with -p2 against 
bitbake master. They are also available in the git repository at:
  git://git.pokylinux.org/poky-contrib paule/skippackage
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=paule/skippackage

Paul Eggleton (2):
  bitbake: track skipped packages
  bitbake-layers: handle skipped recipes

 bitbake/bin/bitbake-layers  |   24 +++++++++++++++++++-----
 bitbake/lib/bb/cache.py     |    9 ++++++---
 bitbake/lib/bb/cooker.py    |   16 ++++++++++++++++
 bitbake/lib/bb/parse/ast.py |   12 ++++++------
 4 files changed, 47 insertions(+), 14 deletions(-)

-- 
1.7.4.1




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

* [PATCH 1/2] bitbake: track skipped packages
  2011-06-09 16:42 [PATCH 0/2] skipped recipe handling v2 Paul Eggleton
@ 2011-06-09 16:42 ` Paul Eggleton
  2011-06-09 16:42 ` [PATCH 2/2] bitbake-layers: handle skipped recipes Paul Eggleton
  2011-06-09 17:13 ` [PATCH 0/2] skipped recipe handling v2 Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2011-06-09 16:42 UTC (permalink / raw)
  To: bitbake-devel

Add skiplist to cooker that allows access to the list of packages skipped
via SkipPackage (this includes COMPATIBLE_MACHINE, INCOMPATIBLE_LICENSE,
etc.) This can be used to enhance error reporting.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/lib/bb/cache.py     |    9 ++++++---
 bitbake/lib/bb/cooker.py    |   16 ++++++++++++++++
 bitbake/lib/bb/parse/ast.py |   12 ++++++------
 3 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index 5b8e3ee..a0df93e 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -43,7 +43,7 @@ except ImportError:
     logger.info("Importing cPickle failed. "
                 "Falling back to a very slow implementation.")
 
-__cache_version__ = "139"
+__cache_version__ = "140"
 
 def getCacheFile(path, filename):
     return os.path.join(path, filename)
@@ -96,8 +96,11 @@ class CoreRecipeInfo(RecipeInfoCommon):
         self.variants = self.listvar('__VARIANTS', metadata) + ['']
         self.nocache = self.getvar('__BB_DONT_CACHE', metadata)
 
-        if self.getvar('__SKIPPED', metadata):
+        self.skipreason = self.getvar('__SKIPPED', metadata)
+        if self.skipreason:
             self.skipped = True
+            self.provides  = self.depvar('PROVIDES', metadata)
+            self.rprovides = self.depvar('RPROVIDES', metadata)
             return
 
         self.tasks = metadata.getVar('__BBTASKS', False)
@@ -446,7 +449,7 @@ class Cache(object):
         cached, infos = self.load(fn, appends, cfgData)
         for virtualfn, info_array in infos:
             if info_array[0].skipped:
-                logger.debug(1, "Skipping %s", virtualfn)
+                logger.debug(1, "Skipping %s: %s", virtualfn, info_array[0].skipreason)
                 skipped += 1
             else:
                 self.add_info(virtualfn, info_array, cacheData, not cached)
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 5bdf90f..a64ee52 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -55,6 +55,20 @@ class NothingToBuild(Exception):
 class state:
     initial, parsing, running, shutdown, stop = range(5)
 
+
+class SkippedPackage:
+    def __init__(self, info = None, reason = None):
+        self.skipreason = None
+        self.provides = None
+        self.rprovides = None
+
+        if info:
+            self.skipreason = info.skipreason
+            self.provides = info.provides
+            self.rprovides = info.rprovides
+        elif reason:
+            self.skipreason = reason
+
 #============================================================================#
 # BBCooker
 #============================================================================#
@@ -66,6 +80,7 @@ class BBCooker:
     def __init__(self, configuration, server_registration_cb):
         self.status = None
         self.appendlist = {}
+        self.skiplist = {}
 
         self.server_registration_cb = server_registration_cb
 
@@ -1261,6 +1276,7 @@ class CookerParser(object):
         for virtualfn, info_array in result:
             if info_array[0].skipped:
                 self.skipped += 1
+                self.cooker.skiplist[virtualfn] = SkippedPackage(info_array[0])
             self.bb_cache.add_info(virtualfn, info_array, self.cooker.status,
                                         parsed=parsed)
         return True
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index b296562..722d542 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -376,8 +376,8 @@ def multi_finalize(fn, d):
     try:
         if not onlyfinalise or "default" in onlyfinalise:
             finalize(fn, d)
-    except bb.parse.SkipPackage:
-        bb.data.setVar("__SKIPPED", True, d)
+    except bb.parse.SkipPackage as e:
+        bb.data.setVar("__SKIPPED", e.args[0], d)
     datastores = {"": safe_d}
 
     versions = (d.getVar("BBVERSIONS", True) or "").split()
@@ -419,8 +419,8 @@ def multi_finalize(fn, d):
             verfunc(pv, d, safe_d)
             try:
                 finalize(fn, d)
-            except bb.parse.SkipPackage:
-                bb.data.setVar("__SKIPPED", True, d)
+            except bb.parse.SkipPackage as e:
+                bb.data.setVar("__SKIPPED", e.args[0], d)
 
         _create_variants(datastores, versions, verfunc)
 
@@ -439,8 +439,8 @@ def multi_finalize(fn, d):
             try:
                 if not onlyfinalise or variant in onlyfinalise:
                     finalize(fn, variant_d, variant)
-            except bb.parse.SkipPackage:
-                bb.data.setVar("__SKIPPED", True, variant_d)
+            except bb.parse.SkipPackage as e:
+                bb.data.setVar("__SKIPPED", e.args[0], variant_d)
 
     if len(datastores) > 1:
         variants = filter(None, datastores.iterkeys())
-- 
1.7.4.1




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

* [PATCH 2/2] bitbake-layers: handle skipped recipes
  2011-06-09 16:42 [PATCH 0/2] skipped recipe handling v2 Paul Eggleton
  2011-06-09 16:42 ` [PATCH 1/2] bitbake: track skipped packages Paul Eggleton
@ 2011-06-09 16:42 ` Paul Eggleton
  2011-06-09 17:13 ` [PATCH 0/2] skipped recipe handling v2 Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2011-06-09 16:42 UTC (permalink / raw)
  To: bitbake-devel

Report bbappends correctly for skipped recipes instead of reporting the
bbappends as not having any matching recipe.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/bin/bitbake-layers |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
index d2ed5d4..6b5ad5a 100755
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -83,6 +83,8 @@ class Commands(cmd.Cmd):
         for pn in self.cooker_data.pkg_pn:
             self.show_appends_for_pn(pn)
 
+        self.show_appends_for_skipped()
+
         self.show_appends_with_no_recipes()
 
     def show_appends_for_pn(self, pn):
@@ -94,17 +96,27 @@ class Commands(cmd.Cmd):
                                              self.cooker_data.pkg_pn)
         best_filename = os.path.basename(best[3])
 
+        self.show_appends_output(filenames, best_filename)
+
+    def show_appends_for_skipped(self):
+        filenames = [os.path.basename(f)
+                    for f in self.cooker.skiplist.iterkeys()]
+        self.show_appends_output(filenames, None, " (skipped)")
+
+    def show_appends_output(self, filenames, best_filename, name_suffix = ''):
         appended, missing = self.get_appends_for_files(filenames)
         if appended:
             for basename, appends in appended:
-                logger.info('%s:', basename)
+                logger.info('%s%s:', basename, name_suffix)
                 for append in appends:
                     logger.info('  %s', append)
 
-            if best_filename in missing:
-                logger.warn('%s: missing append for preferred version',
-                            best_filename)
-                self.returncode |= 1
+            if best_filename:
+                if best_filename in missing:
+                    logger.warn('%s: missing append for preferred version',
+                                best_filename)
+                    self.returncode |= 1
+
 
     def get_appends_for_files(self, filenames):
         appended, notappended = set(), set()
@@ -124,6 +136,8 @@ class Commands(cmd.Cmd):
     def show_appends_with_no_recipes(self):
         recipes = set(os.path.basename(f)
                       for f in self.cooker_data.pkg_fn.iterkeys())
+        recipes |= set(os.path.basename(f)
+                      for f in self.cooker.skiplist.iterkeys())
         appended_recipes = self.cooker_data.appends.iterkeys()
         appends_without_recipes = [self.cooker_data.appends[recipe]
                                    for recipe in appended_recipes
-- 
1.7.4.1




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

* Re: [PATCH 0/2] skipped recipe handling v2
  2011-06-09 16:42 [PATCH 0/2] skipped recipe handling v2 Paul Eggleton
  2011-06-09 16:42 ` [PATCH 1/2] bitbake: track skipped packages Paul Eggleton
  2011-06-09 16:42 ` [PATCH 2/2] bitbake-layers: handle skipped recipes Paul Eggleton
@ 2011-06-09 17:13 ` Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2011-06-09 17:13 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: bitbake-devel

On Thu, 2011-06-09 at 17:42 +0100, Paul Eggleton wrote:
> For the description of this changeset please see the original mail:
> http://lists.linuxtogo.org/pipermail/bitbake-devel/2011-June/000911.html
> 
> Changes since v1: rebased against recent bitbake changes, added a cache
> version bump.
> 
> These patches are against Poky but they apply cleanly with -p2 against 
> bitbake master. They are also available in the git repository at:
>   git://git.pokylinux.org/poky-contrib paule/skippackage
>   http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=paule/skippackage
> 
> Paul Eggleton (2):
>   bitbake: track skipped packages
>   bitbake-layers: handle skipped recipes

Merged to master, thanks.

Richard




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

end of thread, other threads:[~2011-06-09 17:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-09 16:42 [PATCH 0/2] skipped recipe handling v2 Paul Eggleton
2011-06-09 16:42 ` [PATCH 1/2] bitbake: track skipped packages Paul Eggleton
2011-06-09 16:42 ` [PATCH 2/2] bitbake-layers: handle skipped recipes Paul Eggleton
2011-06-09 17:13 ` [PATCH 0/2] skipped recipe handling v2 Richard Purdie

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.