From 4cb4209b9a3055d63bfa6c99cd9cf9e76fcdbffd Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Sat, 6 Oct 2018 23:19:44 +0200 Subject: 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: https://github.com/dropbox/nautilus-dropbox/commit/209542f https://github.com/dropbox/nautilus-dropbox/pull/59 --- caja-dropbox.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/caja-dropbox.in b/caja-dropbox.in index 1b6342c..6921fc4 100755 --- a/caja-dropbox.in +++ b/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() -- cgit v1.2.1