mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
bitbake: fetch2: Ensure when downloading we are consistently in the same directory
This assists with build reproducuility. It also avoids errors if cwd happens not to exist when we call into the fetcher. That situation would be unusual but I hit it with the unit tests. (From Poky rev: 86517af9e066c2da1d580fa66b7c7f0340f3403e) (Bitbake rev: b886c6c15a58643e06ca5ad7a3ff1f7766e4f48c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -471,6 +471,8 @@ def try_mirrors(d, origud, mirrors, check = False):
|
||||
ud = FetchData(newuri, ld)
|
||||
ud.setup_localpath(ld)
|
||||
|
||||
os.chdir(ld.getVar("DL_DIR", True))
|
||||
|
||||
if check:
|
||||
found = ud.method.checkstatus(newuri, ud, ld)
|
||||
if found:
|
||||
@@ -965,6 +967,8 @@ class Fetch(object):
|
||||
if premirroronly:
|
||||
self.d.setVar("BB_NO_NETWORK", "1")
|
||||
|
||||
os.chdir(self.d.getVar("DL_DIR", True))
|
||||
|
||||
firsterr = None
|
||||
if not localpath and ((not os.path.exists(ud.donestamp)) or m.need_update(u, ud, self.d)):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user