summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/command.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/command.py')
-rw-r--r--bitbake/lib/bb/command.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 732327d84d..0706b89271 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -60,7 +60,7 @@ class Command:
60 # FIXME Add lock for this 60 # FIXME Add lock for this
61 self.currentAsyncCommand = None 61 self.currentAsyncCommand = None
62 62
63 def runCommand(self, commandline, ro_only = False): 63 def runCommand(self, commandline, process_server, ro_only=False):
64 command = commandline.pop(0) 64 command = commandline.pop(0)
65 65
66 # Ensure cooker is ready for commands 66 # Ensure cooker is ready for commands
@@ -84,7 +84,7 @@ class Command:
84 if not hasattr(command_method, 'readonly') or not getattr(command_method, 'readonly'): 84 if not hasattr(command_method, 'readonly') or not getattr(command_method, 'readonly'):
85 return None, "Not able to execute not readonly commands in readonly mode" 85 return None, "Not able to execute not readonly commands in readonly mode"
86 try: 86 try:
87 self.cooker.process_inotify_updates() 87 self.cooker.process_inotify_updates_apply()
88 if getattr(command_method, 'needconfig', True): 88 if getattr(command_method, 'needconfig', True):
89 self.cooker.updateCacheSync() 89 self.cooker.updateCacheSync()
90 result = command_method(self, commandline) 90 result = command_method(self, commandline)
@@ -100,7 +100,10 @@ class Command:
100 else: 100 else:
101 return result, None 101 return result, None
102 if self.currentAsyncCommand is not None: 102 if self.currentAsyncCommand is not None:
103 return None, "Busy (%s in progress)" % self.currentAsyncCommand[0] 103 # Wait for the idle loop to have cleared (30s max)
104 process_server.wait_for_idle(timeout=30)
105 if self.currentAsyncCommand is not None:
106 return None, "Busy (%s in progress)" % self.currentAsyncCommand[0]
104 if command not in CommandsAsync.__dict__: 107 if command not in CommandsAsync.__dict__:
105 return None, "No such command" 108 return None, "No such command"
106 self.currentAsyncCommand = (command, commandline) 109 self.currentAsyncCommand = (command, commandline)
@@ -109,7 +112,7 @@ class Command:
109 112
110 def runAsyncCommand(self): 113 def runAsyncCommand(self):
111 try: 114 try:
112 self.cooker.process_inotify_updates() 115 self.cooker.process_inotify_updates_apply()
113 if self.cooker.state in (bb.cooker.state.error, bb.cooker.state.shutdown, bb.cooker.state.forceshutdown): 116 if self.cooker.state in (bb.cooker.state.error, bb.cooker.state.shutdown, bb.cooker.state.forceshutdown):
114 # updateCache will trigger a shutdown of the parser 117 # updateCache will trigger a shutdown of the parser
115 # and then raise BBHandledException triggering an exit 118 # and then raise BBHandledException triggering an exit