mirror of
https://git.yoctoproject.org/poky
synced 2026-04-20 09:32:13 +02:00
bitbake: 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. (Bitbake rev: 5b12bf30bccdd00262e74964223220c649040be4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user