summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/wget.py
diff options
context:
space:
mode:
authorZygmunt Krynicki <zygmunt.krynicki@huawei.com>2022-02-19 17:59:46 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-20 16:45:24 +0000
commit59fdcddf05a9aed00b4edd398d6dc82689bfd564 (patch)
treee5f0ef6b84e0a6ca071d0053ccb610f7a5f3a3f5 /bitbake/lib/bb/fetch2/wget.py
parent427bfd5f8fad045432947c73c6007b7a79e5e7d6 (diff)
downloadpoky-59fdcddf05a9aed00b4edd398d6dc82689bfd564.tar.gz
bitbake: fetch2/wget: move loop-invariant load of BB_ORIGENV
BB_ORIGENV is used as a fallback environment block. It is repeatedly accessed inside the loop. Since it is a loop invariant, move it out of the loop. (Bitbake rev: 346a1a6c76d40458d7b4c116147ec4d371bee74a) Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@huawei.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/wget.py')
-rw-r--r--bitbake/lib/bb/fetch2/wget.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index 253cabce75..2579a65ce6 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -316,12 +316,11 @@ class Wget(FetchMethod):
316 # to scope the changes to the build_opener request, which is when the 316 # to scope the changes to the build_opener request, which is when the
317 # environment lookups happen. 317 # environment lookups happen.
318 newenv = {} 318 newenv = {}
319 origenv = d.getVar("BB_ORIGENV")
319 for name in bb.fetch2.FETCH_EXPORT_VARS: 320 for name in bb.fetch2.FETCH_EXPORT_VARS:
320 value = d.getVar(name) 321 value = d.getVar(name)
321 if not value: 322 if not value and origenv:
322 origenv = d.getVar("BB_ORIGENV") 323 value = origenv.getVar(name)
323 if origenv:
324 value = origenv.getVar(name)
325 if value: 324 if value:
326 newenv[name] = value 325 newenv[name] = value
327 326