From 0ab7cdf3da5b1bc3f2e3027b05018ae0670375b7 Mon Sep 17 00:00:00 2001 From: bescoto Date: Sun, 15 Jan 2006 03:07:56 +0000 Subject: SpecialFileError shouldn't trigger UpdateError git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@747 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/CHANGELOG | 3 +++ rdiff-backup/rdiff_backup/backup.py | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index 50d457e..c37bab5 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -5,6 +5,9 @@ Selection fix: empty directories could sometimes be improperly excluded if certain include expressions involving a non-trailing '**' were used. Bug reported by Toni Price. +A few minor changes to help rdiff-backup back up to an SMB/CIFS share. +Thanks to Cengiz Gunay for testing. + New in v1.1.5 (2006/01/01) -------------------------- diff --git a/rdiff-backup/rdiff_backup/backup.py b/rdiff-backup/rdiff_backup/backup.py index 181c918..7d24eb7 100644 --- a/rdiff-backup/rdiff_backup/backup.py +++ b/rdiff-backup/rdiff_backup/backup.py @@ -533,8 +533,9 @@ class PatchITRB(rorpiter.ITRBranch): if diff_rorp.isflaglinked(): self.patch_hardlink_to_temp(diff_rorp, new) elif diff_rorp.get_attached_filetype() == 'snapshot': - if not self.patch_snapshot_to_temp(diff_rorp, new): - return 0 + result = self.patch_snapshot_to_temp(diff_rorp, new) + if not result: return 0 + elif result == 2: return 1 # SpecialFile elif not self.patch_diff_to_temp(basis_rp, diff_rorp, new): return 0 if new.lstat() and not diff_rorp.isflaglinked(): @@ -547,11 +548,18 @@ class PatchITRB(rorpiter.ITRBranch): self.CCPP.update_hardlink_hash(diff_rorp) def patch_snapshot_to_temp(self, diff_rorp, new): - """Write diff_rorp to new, return true if successful""" + """Write diff_rorp to new, return true if successful + + Returns 1 if normal success, 2 if special file is written, + whether or not it is successful. This is because special + files either fail with a SpecialFileError, or don't need to be + compared. + + """ if diff_rorp.isspecial(): self.write_special(diff_rorp, new) rpath.copy_attribs(diff_rorp, new) - return 1 + return 2 report = robust.check_common_error(self.error_handler, rpath.copy, (diff_rorp, new)) -- cgit v1.2.1