diff options
author | Raphael Hertzog <[email protected]> | 2018-10-06 23:19:44 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-01-09 20:05:00 +0100 |
commit | 4cb4209b9a3055d63bfa6c99cd9cf9e76fcdbffd (patch) | |
tree | 326a5e0ea271e6caf5b0901430fcc2a231c84c61 | |
parent | 192451f0cc45863c54c2d6fcea0ce6dc33aaacae (diff) | |
download | caja-dropbox-4cb4209b9a3055d63bfa6c99cd9cf9e76fcdbffd.tar.bz2 caja-dropbox-4cb4209b9a3055d63bfa6c99cd9cf9e76fcdbffd.tar.xz |
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
-rwxr-xr-x | caja-dropbox.in | 3 |
1 files changed, 3 insertions, 0 deletions
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() |