From 559b413a54f2e6c33347f9f1dc97b8c84880eb1d Mon Sep 17 00:00:00 2001 From: bescoto Date: Tue, 22 Nov 2005 22:45:12 +0000 Subject: Fix for "Directory not empty" bug git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/branches/r1-0@686 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/CHANGELOG | 6 +++++- rdiff-backup/rdiff_backup/backup.py | 8 ++++---- rdiff-backup/rdiff_backup/rpath.py | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index bd175db..3d8d6e7 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -5,7 +5,11 @@ Applied Alec Berryman's patch to update the no-compression regexp. Alec Berryman's fs_abilities patch is supposed to help with AFS. -Fixed filename-too-long crash when quoting. +Fixed (version of) filename-too-long crash when quoting. + +Due to very detailed error report from Yoav, fixed a "Directory not +empty" error that can arise on emulated filesystems like NFS and +EncFS. New in v1.0.2 (2005/10/24) diff --git a/rdiff-backup/rdiff_backup/backup.py b/rdiff-backup/rdiff_backup/backup.py index a34eb73..26cda63 100644 --- a/rdiff-backup/rdiff_backup/backup.py +++ b/rdiff-backup/rdiff_backup/backup.py @@ -109,12 +109,12 @@ class SourceStruct: diff_rorp = src_rp.getRORPath() if dest_sig.isflaglinked(): diff_rorp.flaglinked(dest_sig.get_link_flag()) - elif dest_sig.isreg() and src_rp.isreg(): - attach_diff(diff_rorp, src_rp, dest_sig) elif src_rp.isreg(): - attach_snapshot(diff_rorp, src_rp) + if dest_sig.isreg(): attach_diff(diff_rorp, src_rp, dest_sig) + else: attach_snapshot(diff_rorp, src_rp) + else: dest_sig.close_if_necessary() - else: diff_rorp.set_attached_filetype('snapshot') + diff_rorp.set_attached_filetype('snapshot') yield diff_rorp static.MakeClass(SourceStruct) diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py index 15f4a59..ac24a31 100644 --- a/rdiff-backup/rdiff_backup/rpath.py +++ b/rdiff-backup/rdiff_backup/rpath.py @@ -873,7 +873,7 @@ class RPath(RORPath): log.Log("Deleting %s" % self.path, 7) if self.isdir(): try: self.rmdir() - except os.error: + except EnvironmentError: if Globals.fsync_directories: self.fsync() self.conn.shutil.rmtree(self.path) else: self.conn.os.unlink(self.path) -- cgit v1.2.1