aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/runqueue.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-24 22:24:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-25 01:04:18 +0100
commit5b12bf30bccdd00262e74964223220c649040be4 (patch)
treef033d94fc03bd706e1221d0a58308d427395aefd /lib/bb/runqueue.py
parent9501dd6fdd7a7c25cbfa4464cf881fcf8c049ce2 (diff)
downloadbitbake-5b12bf30bccdd00262e74964223220c649040be4.tar.gz
runqueue: Don't use sys.argv
We should not be using sys.argv inside the server to decide which targets the user added on the commandline. There might not even be a commandline. Thankfully the targets variable is easily accessible in this context and contains this exact data we want. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/runqueue.py')
-rw-r--r--lib/bb/runqueue.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 6370ce50a..28bdadb45 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -376,7 +376,7 @@ class RunQueueData:
self.stampwhitelist = cfgData.getVar("BB_STAMP_WHITELIST") or ""
self.multi_provider_whitelist = (cfgData.getVar("MULTI_PROVIDER_WHITELIST") or "").split()
- self.setscenewhitelist = get_setscene_enforce_whitelist(cfgData)
+ self.setscenewhitelist = get_setscene_enforce_whitelist(cfgData, targets)
self.setscenewhitelist_checked = False
self.setscene_enforce = (cfgData.getVar('BB_SETSCENE_ENFORCE') == "1")
self.init_progress_reporter = bb.progress.DummyMultiStageProcessProgressReporter()
@@ -2999,16 +2999,15 @@ class runQueuePipe():
print("Warning, worker left partial message: %s" % self.queue)
self.input.close()
-def get_setscene_enforce_whitelist(d):
+def get_setscene_enforce_whitelist(d, targets):
if d.getVar('BB_SETSCENE_ENFORCE') != '1':
return None
whitelist = (d.getVar("BB_SETSCENE_ENFORCE_WHITELIST") or "").split()
outlist = []
for item in whitelist[:]:
if item.startswith('%:'):
- for target in sys.argv[1:]:
- if not target.startswith('-'):
- outlist.append(target.split(':')[0] + ':' + item.split(':')[1])
+ for (mc, target, task, fn) in targets:
+ outlist.append(target + ':' + item.split(':')[1])
else:
outlist.append(item)
return outlist