diff options
Diffstat (limited to 'buildstream')
-rw-r--r-- | buildstream/plugins/sources/bzr.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/buildstream/plugins/sources/bzr.py b/buildstream/plugins/sources/bzr.py index 679a3436c..cb7cbb040 100644 --- a/buildstream/plugins/sources/bzr.py +++ b/buildstream/plugins/sources/bzr.py @@ -172,14 +172,15 @@ class BzrSource(Source): repo in an inconsistent state. """ with self.tempdir() as repodir: - if os.path.exists(self._get_mirror_dir()): + mirror_dir = self._get_mirror_dir() + if os.path.exists(mirror_dir): try: # shutil.copytree doesn't like it if destination exists shutil.rmtree(repodir) - shutil.copytree(self._get_mirror_dir(), repodir) + shutil.copytree(mirror_dir, repodir) except (shutil.Error, OSError) as e: raise SourceError("{}: Failed to copy bzr repo from '{}' to '{}'" - .format(str(self), self.mirror_dir, tmpdir)) from e + .format(str(self), mirror_dir, repodir)) from e yield repodir self._atomic_replace_mirrordir(repodir) |