summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/command.py4
-rw-r--r--bitbake/lib/bb/cooker.py3
-rw-r--r--bitbake/lib/bb/server/xmlrpc.py2
3 files changed, 8 insertions, 1 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 3788207122..84fcdf9433 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -264,6 +264,10 @@ class CommandsSync:
264 features = params[0] 264 features = params[0]
265 command.cooker.setFeatures(features) 265 command.cooker.setFeatures(features)
266 266
267 # although we change the internal state of the cooker, this is transparent since
268 # we always take and leave the cooker in state.initial
269 setFeatures.readonly = True
270
267class CommandsAsync: 271class CommandsAsync:
268 """ 272 """
269 A class of asynchronous commands 273 A class of asynchronous commands
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index e6916a621b..f41f5946ae 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -159,6 +159,9 @@ class BBCooker:
159 self.state = state.forceshutdown 159 self.state = state.forceshutdown
160 160
161 def setFeatures(self, features): 161 def setFeatures(self, features):
162 # we only accept a new feature set if we're in state initial, so we can reset without problems
163 if self.state != state.initial:
164 raise Exception("Illegal state for feature set change")
162 original_featureset = list(self.featureset) 165 original_featureset = list(self.featureset)
163 for feature in features: 166 for feature in features:
164 self.featureset.setFeature(feature) 167 self.featureset.setFeature(feature)
diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py
index bf867b584b..5dcaa6c7b0 100644
--- a/bitbake/lib/bb/server/xmlrpc.py
+++ b/bitbake/lib/bb/server/xmlrpc.py
@@ -292,7 +292,7 @@ class BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection):
292 292
293 _, error = self.connection.runCommand(["setFeatures", self.featureset]) 293 _, error = self.connection.runCommand(["setFeatures", self.featureset])
294 if error: 294 if error:
295 logger.error("Unable to set the cooker to the correct featureset: %s" % error) 295 # no need to log it here, the error shall be sent to the client
296 raise BaseException(error) 296 raise BaseException(error)
297 297
298 return self 298 return self