Skip to content

Commit 4cb4209

Browse files
rhertzograveit65
authored andcommitted
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
1 parent 192451f commit 4cb4209

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

caja-dropbox.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@ class DownloadState(object):
281281
archive = tarfile.open(fileobj=self.local_file, mode='r:gz')
282282
total_members = len(archive.getmembers())
283283
for i, member in enumerate(archive.getmembers()):
284+
filename = os.path.join(PARENT_DIR, member.name)
285+
if os.path.exists(filename) and not os.path.isdir(filename):
286+
os.unlink(filename)
284287
archive.extract(member, PARENT_DIR)
285288
yield member.name, i, total_members
286289
archive.close()

0 commit comments

Comments
 (0)