From b70234092cc402ae7adb9065df641806431a969d Mon Sep 17 00:00:00 2001 From: bescoto Date: Thu, 22 Dec 2005 03:59:02 +0000 Subject: long directory name fix git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/branches/r1-0@715 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/CHANGELOG | 3 +++ rdiff-backup/rdiff_backup/backup.py | 5 ++++- rdiff-backup/testing/regressiontest.py | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index da193e4..2d24ca5 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -4,6 +4,9 @@ New in v1.0.4 (????/??/??) Files with ACLs will not be unnecessarily marked as changed (bug report by Carsten Lorenz). +Another fix for long-filenames crash, this time when a long-named +directory with files in it gets deleted + New in v1.0.3 (2005/11/25) -------------------------- diff --git a/rdiff-backup/rdiff_backup/backup.py b/rdiff-backup/rdiff_backup/backup.py index 26cda63..8e4f5b5 100644 --- a/rdiff-backup/rdiff_backup/backup.py +++ b/rdiff-backup/rdiff_backup/backup.py @@ -584,7 +584,10 @@ class PatchITRB(rorpiter.ITRBranch): rpath.copy_attribs(self.dir_update, self.base_rp) else: assert self.dir_replacement - self.base_rp.rmdir() + try: self.base_rp.rmdir() + except OSError: + log.Log("Warning: unable to rmdir " + self.base_rp.path, 2) + self.base_rp.delete() if self.dir_replacement.lstat(): rpath.rename(self.dir_replacement, self.base_rp) diff --git a/rdiff-backup/testing/regressiontest.py b/rdiff-backup/testing/regressiontest.py index 427ed83..2a39e0d 100644 --- a/rdiff-backup/testing/regressiontest.py +++ b/rdiff-backup/testing/regressiontest.py @@ -159,6 +159,7 @@ class IncrementTest1(unittest.TestCase): Myrm(Local.rpout.path) InternalBackup(1, 1, "testfiles/longfilenames1", Local.rpout.path, 100) InternalBackup(1, 1, "testfiles/longfilenames2", Local.rpout.path, 200) + InternalBackup(1, 1, "testfiles/empty", Local.rpout.path, 300) def test_quoted_hardlinks(self): """Test backing up a directory with quoted hardlinks in it""" -- cgit v1.2.1