bitbake: fetch2: clean up remaining cwd saves/changes
Now that the fetchers all preserve the current working directory, the cwd changes in the try_mirror_url, download, and checkstatus methods are no longer needed. (Bitbake rev: 0ed8975c42718342a104a9764a58816f964ec4ea) Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
970ff6c0fd
commit
c22293622d
|
@ -935,8 +935,6 @@ def try_mirror_url(fetch, origud, ud, ld, check = False):
|
||||||
return found
|
return found
|
||||||
return False
|
return False
|
||||||
|
|
||||||
os.chdir(ld.getVar("DL_DIR", True))
|
|
||||||
|
|
||||||
if not verify_donestamp(ud, ld, origud) or ud.method.need_update(ud, ld):
|
if not verify_donestamp(ud, ld, origud) or ud.method.need_update(ud, ld):
|
||||||
ud.method.download(ud, ld)
|
ud.method.download(ud, ld)
|
||||||
if hasattr(ud.method,"build_mirror_data"):
|
if hasattr(ud.method,"build_mirror_data"):
|
||||||
|
@ -1553,8 +1551,6 @@ class Fetch(object):
|
||||||
network = self.d.getVar("BB_NO_NETWORK", True)
|
network = self.d.getVar("BB_NO_NETWORK", True)
|
||||||
premirroronly = (self.d.getVar("BB_FETCH_PREMIRRORONLY", True) == "1")
|
premirroronly = (self.d.getVar("BB_FETCH_PREMIRRORONLY", True) == "1")
|
||||||
|
|
||||||
save_cwd = os.getcwd()
|
|
||||||
|
|
||||||
for u in urls:
|
for u in urls:
|
||||||
ud = self.ud[u]
|
ud = self.ud[u]
|
||||||
ud.setup_localpath(self.d)
|
ud.setup_localpath(self.d)
|
||||||
|
@ -1577,8 +1573,6 @@ class Fetch(object):
|
||||||
if premirroronly:
|
if premirroronly:
|
||||||
self.d.setVar("BB_NO_NETWORK", "1")
|
self.d.setVar("BB_NO_NETWORK", "1")
|
||||||
|
|
||||||
os.chdir(self.d.getVar("DL_DIR", True))
|
|
||||||
|
|
||||||
firsterr = None
|
firsterr = None
|
||||||
verified_stamp = verify_donestamp(ud, self.d)
|
verified_stamp = verify_donestamp(ud, self.d)
|
||||||
if not localpath and (not verified_stamp or m.need_update(ud, self.d)):
|
if not localpath and (not verified_stamp or m.need_update(ud, self.d)):
|
||||||
|
@ -1629,7 +1623,6 @@ class Fetch(object):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
os.chdir(save_cwd)
|
|
||||||
if ud.lockfile:
|
if ud.lockfile:
|
||||||
bb.utils.unlockfile(lf)
|
bb.utils.unlockfile(lf)
|
||||||
|
|
||||||
|
@ -1638,8 +1631,6 @@ class Fetch(object):
|
||||||
Check all urls exist upstream
|
Check all urls exist upstream
|
||||||
"""
|
"""
|
||||||
|
|
||||||
save_cwd = os.getcwd()
|
|
||||||
|
|
||||||
if not urls:
|
if not urls:
|
||||||
urls = self.urls
|
urls = self.urls
|
||||||
|
|
||||||
|
@ -1663,8 +1654,6 @@ class Fetch(object):
|
||||||
if not ret:
|
if not ret:
|
||||||
raise FetchError("URL %s doesn't work" % u, u)
|
raise FetchError("URL %s doesn't work" % u, u)
|
||||||
|
|
||||||
os.chdir(save_cwd)
|
|
||||||
|
|
||||||
def unpack(self, root, urls=None):
|
def unpack(self, root, urls=None):
|
||||||
"""
|
"""
|
||||||
Check all urls exist upstream
|
Check all urls exist upstream
|
||||||
|
|
Loading…
Reference in New Issue