mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
bitbake/fetch2: Ensure we only remove files, not directories when fetch failures occur
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -431,7 +431,8 @@ def try_mirrors(d, origud, mirrors, check = False):
|
|||||||
|
|
||||||
except bb.fetch2.BBFetchException:
|
except bb.fetch2.BBFetchException:
|
||||||
logger.debug(1, "Mirror fetch failure for url %s (original url: %s)" % (newuri, origud.url))
|
logger.debug(1, "Mirror fetch failure for url %s (original url: %s)" % (newuri, origud.url))
|
||||||
bb.utils.remove(ud.localpath)
|
if os.path.isfile(ud.localpath):
|
||||||
|
bb.utils.remove(ud.localpath)
|
||||||
continue
|
continue
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@@ -850,8 +851,9 @@ class Fetch(object):
|
|||||||
localpath = ud.localpath
|
localpath = ud.localpath
|
||||||
|
|
||||||
except BBFetchException:
|
except BBFetchException:
|
||||||
# Remove any incomplete file
|
# Remove any incomplete fetch
|
||||||
bb.utils.remove(ud.localpath)
|
if os.path.isfile(ud.localpath):
|
||||||
|
bb.utils.remove(ud.localpath)
|
||||||
mirrors = mirror_from_string(bb.data.getVar('MIRRORS', self.d, True))
|
mirrors = mirror_from_string(bb.data.getVar('MIRRORS', self.d, True))
|
||||||
localpath = try_mirrors (self.d, ud, mirrors)
|
localpath = try_mirrors (self.d, ud, mirrors)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user