]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: cooker/providers: Only add target to world build if task exists
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 21 Sep 2016 21:31:57 +0000 (22:31 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 22 Sep 2016 10:18:11 +0000 (11:18 +0100)
A "bitbake world -c unpack" currently breaks as not all tasks have an
unpack task. This change allows addition of world targets only if the
specified task exists which makes certain commands possible when otherwise
you just get errors which can't easily be avoided.

(Bitbake rev: ca4f5e6d01b5c8cf315f59bc86194d63c0d3d042)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/cooker.py
bitbake/lib/bb/providers.py

index f3252640cb9a80e17484be7300a4c8466784ef51..934072c44f610b7479a31ff71189a10a983fa7e7 100644 (file)
@@ -658,7 +658,7 @@ class BBCooker:
         if task is None:
             task = self.configuration.cmd
 
-        fulltargetlist = self.checkPackages(pkgs_to_build)
+        fulltargetlist = self.checkPackages(pkgs_to_build, task)
         taskdata = {}
         localdata = {}
 
@@ -1618,7 +1618,7 @@ class BBCooker:
 
         return True
 
-    def checkPackages(self, pkgs_to_build):
+    def checkPackages(self, pkgs_to_build, task=None):
 
         # Return a copy, don't modify the original
         pkgs_to_build = pkgs_to_build[:]
@@ -1634,7 +1634,7 @@ class BBCooker:
         if 'world' in pkgs_to_build:
             pkgs_to_build.remove('world')
             for mc in self.multiconfigs:
-                bb.providers.buildWorldTargetList(self.recipecaches[mc])
+                bb.providers.buildWorldTargetList(self.recipecaches[mc], task)
                 for t in self.recipecaches[mc].world_target:
                     if mc:
                         t = "multiconfig:" + mc + ":" + t
index 80701b28118d2fe9bf2cdef7d8ae5bac05873728..db02a0b0de4a5b7f6b7df56dff9b0140d1c858d5 100644 (file)
@@ -402,7 +402,7 @@ def getRuntimeProviders(dataCache, rdepend):
     return rproviders
 
 
-def buildWorldTargetList(dataCache):
+def buildWorldTargetList(dataCache, task=None):
     """
     Build package list for "bitbake world"
     """
@@ -413,6 +413,9 @@ def buildWorldTargetList(dataCache):
     for f in dataCache.possible_world:
         terminal = True
         pn = dataCache.pkg_fn[f]
+        if task and task not in dataCache.task_deps[f]['tasks']:
+            logger.debug(2, "World build skipping %s as task %s doesn't exist", f, task)
+            terminal = False
 
         for p in dataCache.pn_provides[pn]:
             if p.startswith('virtual/'):