aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-08 12:42:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-10 23:37:16 +0000
commit71fe2b3c196c63f866c832b97238af7525ced249 (patch)
treeb989fa0652a0bb3da3fe333b7a785d62490f11e1
parentaa75e1784c1a347e04c3036469f389ab735fb810 (diff)
downloadbitbake-71fe2b3c196c63f866c832b97238af7525ced249.tar.gz
bitbake-71fe2b3c196c63f866c832b97238af7525ced249.tar.bz2
bitbake-71fe2b3c196c63f866c832b97238af7525ced249.zip
bitbake/fetch2: Ensure we only remove files, not directories when fetch failures occur
(From Poky rev: 91eeb9b0d334275ff2730e55e86fd351e1b652ef) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/__init__.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 5a002875..89f5930b 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -431,7 +431,8 @@ def try_mirrors(d, origud, mirrors, check = False):
except bb.fetch2.BBFetchException:
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
return None
@@ -850,8 +851,9 @@ class Fetch(object):
localpath = ud.localpath
except BBFetchException:
- # Remove any incomplete file
- bb.utils.remove(ud.localpath)
+ # Remove any incomplete fetch
+ if os.path.isfile(ud.localpath):
+ bb.utils.remove(ud.localpath)
mirrors = mirror_from_string(bb.data.getVar('MIRRORS', self.d, True))
localpath = try_mirrors (self.d, ud, mirrors)