Skip to content
Permalink
Browse files
Unlink files that are going to be replaced by the unpack
Without this, the unpack will fail with ETXTBUSY on some files which are
being executed.

https://bugs.launchpad.net/ubuntu/+source/nautilus-dropbox/+bug/818014

origin commit:
dropbox/nautilus-dropbox@209542f
dropbox/nautilus-dropbox#59
  • Loading branch information
rhertzog authored and raveit65 committed Jan 9, 2019
1 parent 192451f commit 4cb4209b9a3055d63bfa6c99cd9cf9e76fcdbffd
Showing with 3 additions and 0 deletions.
  1. +3 −0 caja-dropbox.in
@@ -281,6 +281,9 @@ class DownloadState(object):
archive = tarfile.open(fileobj=self.local_file, mode='r:gz')
total_members = len(archive.getmembers())
for i, member in enumerate(archive.getmembers()):
filename = os.path.join(PARENT_DIR, member.name)
if os.path.exists(filename) and not os.path.isdir(filename):
os.unlink(filename)
archive.extract(member, PARENT_DIR)
yield member.name, i, total_members
archive.close()

0 comments on commit 4cb4209

Please sign in to comment.