]> code.ossystems Code Review - openembedded-core.git/commitdiff
Made '-b' work with BBCLASSEXTEND
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Sun, 21 Mar 2010 22:02:56 +0000 (23:02 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 2 Jul 2010 14:41:31 +0000 (15:41 +0100)
When BBCLASSEXTEND is set, '-b' builds usually failed with messages
like

| ERROR: Parsing error data_fn virtual:native:<recipe>.bb and fn
<recipe>.bb don't match
|
|   File ".../bb/providers.py", line 47, in sortPriorities
|     priority = dataCache.bbfile_priority[f]
| KeyError: 'virtual:native:<recipe>.bb'

This patch fixes it and allows to specify the alternative class in a
way like

| ./bitbake -b virtual:native:<recipe>.bb

This patch was written to be so minimal as possible; variables should be
probably renamed to reflect their new meaning.

(Bitbake rev: f1c7fe9fc12161ceb3fe201cde370b929b208729)

Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/cache.py
bitbake/lib/bb/cooker.py

index f3ba714d46c9f7e38beb5373b43c359c61fe0871..30857864dc7a56d109f2e0f1c6488b72ef625ec9 100644 (file)
@@ -137,6 +137,7 @@ class Cache:
         # If we're a virtual class we need to make sure all our depends are appended 
         # to the depends of fn.
         depends = self.getVar("__depends", virtualfn, True) or []
+        self.depends_cache.setdefault(fn, {})
         if "__depends" not in self.depends_cache[fn] or not self.depends_cache[fn]["__depends"]:
             self.depends_cache[fn]["__depends"] = depends
         for dep in depends:
index 2406dfe95bc44ad69dafe218464860d187485357..f49e76d04a34925960d7116de156a8f3f73b4118 100644 (file)
@@ -630,13 +630,19 @@ class BBCooker:
         if (task == None):
             task = self.configuration.cmd
 
-        fn = self.matchFile(buildfile)
+        self.bb_cache = bb.cache.init(self)
+        self.status = bb.cache.CacheData()
+
+        (fn, cls) = self.bb_cache.virtualfn2realfn(buildfile)
+        buildfile = self.matchFile(fn)
+        fn = self.bb_cache.realfn2virtual(buildfile, cls)
+
         self.buildSetVars()
 
         # Load data into the cache for fn and parse the loaded cache data
-        self.bb_cache = bb.cache.init(self)
-        self.status = bb.cache.CacheData()
-        self.bb_cache.loadData(fn, self.configuration.data, self.status)      
+        the_data = self.bb_cache.loadDataFull(fn, self.configuration.data)
+        self.bb_cache.setData(fn, buildfile, the_data)
+        self.bb_cache.handle_data(fn, self.status)
 
         # Tweak some variables
         item = self.bb_cache.getVar('PN', fn, True)