summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbst-marge-bot <marge-bot@buildstream.build>2019-04-16 09:58:36 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-04-16 09:58:36 +0000
commit3df557d929a584e46f45ded256801e203cf67b9f (patch)
treed44bf7dddd10687a6b1c6c27000c4a9ef5c27635
parent599485fc7633ec22c2645b97648fd4454d5f8636 (diff)
parent31f983c4bfce2b412a9fb9410efae6b9ece7bb20 (diff)
downloadbuildstream-3df557d929a584e46f45ded256801e203cf67b9f.tar.gz
Merge branch 'tristan/rename-errno-fix-1.2' into 'bst-1.2'
plugins/sources/git.py: Cope with rename returning error EEXIST See merge request BuildStream/buildstream!1294
-rw-r--r--buildstream/plugins/sources/git.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/buildstream/plugins/sources/git.py b/buildstream/plugins/sources/git.py
index 0ff46803f..9ecef445b 100644
--- a/buildstream/plugins/sources/git.py
+++ b/buildstream/plugins/sources/git.py
@@ -128,9 +128,9 @@ class GitMirror(SourceFetcher):
except OSError as e:
# When renaming and the destination repo already exists, os.rename()
- # will fail with ENOTEMPTY, since an empty directory will be silently
- # replaced
- if e.errno == errno.ENOTEMPTY:
+ # will fail with ENOTEMPTY or EEXIST, since an empty directory will
+ # be silently replaced
+ if e.errno in (errno.ENOTEMPTY, errno.EEXIST):
self.source.status("{}: Discarding duplicate clone of {}"
.format(self.source, url))
else: