From 79ddd7871a7237ff63cbaf076339e44bf502ee1f Mon Sep 17 00:00:00 2001 From: owsla Date: Sat, 14 Jun 2008 18:17:57 +0000 Subject: We should preserve hardlinks even when the destination file system does not support them. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@896 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/CHANGELOG | 3 +++ rdiff-backup/rdiff_backup/fs_abilities.py | 2 +- rdiff-backup/rdiff_backup/metadata.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'rdiff-backup') diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index a8b1f53..101611d 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -1,6 +1,9 @@ New in v1.1.16 (????/??/??) --------------------------- +Properly preserve hard links when the destination does not support them. +Thanks to Andreas Olsson for noticing the problem. (Andrew Ferguson) + Fix another case where rdiff-backup fails because it has insufficient permissions on a file it owns. Thanks to Peter Schuller for the test case. (Andrew Ferguson) diff --git a/rdiff-backup/rdiff_backup/fs_abilities.py b/rdiff-backup/rdiff_backup/fs_abilities.py index cf7c88c..9d125b1 100644 --- a/rdiff-backup/rdiff_backup/fs_abilities.py +++ b/rdiff-backup/rdiff_backup/fs_abilities.py @@ -188,7 +188,7 @@ class FSAbilities: if Globals.preserve_hardlinks != 0: log.Log("Warning: hard linking not supported by filesystem " "at %s" % (self.root_rp.path,), 3) - self.hardlinks = 0 + self.hardlinks = None else: self.hardlinks = 1 def set_fsync_dirs(self, testdir): diff --git a/rdiff-backup/rdiff_backup/metadata.py b/rdiff-backup/rdiff_backup/metadata.py index b830a2e..c20092b 100644 --- a/rdiff-backup/rdiff_backup/metadata.py +++ b/rdiff-backup/rdiff_backup/metadata.py @@ -116,7 +116,7 @@ def RORP2Record(rorpath): str_list.append(" CarbonFile %s\n" % (cfile,)) # If file is hardlinked, add that information - if Globals.preserve_hardlinks: + if Globals.preserve_hardlinks != 0: numlinks = rorpath.getnumlinks() if numlinks > 1: str_list.append(" NumHardLinks %s\n" % numlinks) -- cgit v1.2.1