diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-24 22:24:30 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-25 18:14:53 +0100 |
commit | 8ce3e9a76dd34be067486c014b9a9a1fc52854bc (patch) | |
tree | dc72bd3fd174ee3438ea4f7b2d47b602c4fac3d1 /bitbake | |
parent | 7002d67de02206fca0782c3373e915de20a71e9e (diff) | |
download | poky-8ce3e9a76dd34be067486c014b9a9a1fc52854bc.tar.gz |
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>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 6370ce50a1..28bdadb45e 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -376,7 +376,7 @@ class RunQueueData: | |||
376 | 376 | ||
377 | self.stampwhitelist = cfgData.getVar("BB_STAMP_WHITELIST") or "" | 377 | self.stampwhitelist = cfgData.getVar("BB_STAMP_WHITELIST") or "" |
378 | self.multi_provider_whitelist = (cfgData.getVar("MULTI_PROVIDER_WHITELIST") or "").split() | 378 | self.multi_provider_whitelist = (cfgData.getVar("MULTI_PROVIDER_WHITELIST") or "").split() |
379 | self.setscenewhitelist = get_setscene_enforce_whitelist(cfgData) | 379 | self.setscenewhitelist = get_setscene_enforce_whitelist(cfgData, targets) |
380 | self.setscenewhitelist_checked = False | 380 | self.setscenewhitelist_checked = False |
381 | self.setscene_enforce = (cfgData.getVar('BB_SETSCENE_ENFORCE') == "1") | 381 | self.setscene_enforce = (cfgData.getVar('BB_SETSCENE_ENFORCE') == "1") |
382 | self.init_progress_reporter = bb.progress.DummyMultiStageProcessProgressReporter() | 382 | self.init_progress_reporter = bb.progress.DummyMultiStageProcessProgressReporter() |
@@ -2999,16 +2999,15 @@ class runQueuePipe(): | |||
2999 | print("Warning, worker left partial message: %s" % self.queue) | 2999 | print("Warning, worker left partial message: %s" % self.queue) |
3000 | self.input.close() | 3000 | self.input.close() |
3001 | 3001 | ||
3002 | def get_setscene_enforce_whitelist(d): | 3002 | def get_setscene_enforce_whitelist(d, targets): |
3003 | if d.getVar('BB_SETSCENE_ENFORCE') != '1': | 3003 | if d.getVar('BB_SETSCENE_ENFORCE') != '1': |
3004 | return None | 3004 | return None |
3005 | whitelist = (d.getVar("BB_SETSCENE_ENFORCE_WHITELIST") or "").split() | 3005 | whitelist = (d.getVar("BB_SETSCENE_ENFORCE_WHITELIST") or "").split() |
3006 | outlist = [] | 3006 | outlist = [] |
3007 | for item in whitelist[:]: | 3007 | for item in whitelist[:]: |
3008 | if item.startswith('%:'): | 3008 | if item.startswith('%:'): |
3009 | for target in sys.argv[1:]: | 3009 | for (mc, target, task, fn) in targets: |
3010 | if not target.startswith('-'): | 3010 | outlist.append(target + ':' + item.split(':')[1]) |
3011 | outlist.append(target.split(':')[0] + ':' + item.split(':')[1]) | ||
3012 | else: | 3011 | else: |
3013 | outlist.append(item) | 3012 | outlist.append(item) |
3014 | return outlist | 3013 | return outlist |