Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 4cb4209
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions caja-dropbox.in
Expand Up @@ -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()
Expand Down

0 comments on commit 4cb4209

Please sign in to comment.