Commit fe7c04cf authored by bescoto's avatar bescoto

Don't copy attributes to hard links, and make --no-hard-links

override.  Thanks to David Vasilevsky.


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@559 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent ecbe2d7f
...@@ -23,6 +23,9 @@ Fixed user/group restoring error noticed by Fran Firman. ...@@ -23,6 +23,9 @@ Fixed user/group restoring error noticed by Fran Firman.
Checked in Robert Shaw's --chars-to-quote patch Checked in Robert Shaw's --chars-to-quote patch
Treated hard link permission problem on Mac OS X by applying
suggestion by David Vasilevsky.
New in v0.13.4 (2004/01/31) New in v0.13.4 (2004/01/31)
--------------------------- ---------------------------
......
...@@ -118,7 +118,6 @@ def link_rp(diff_rorp, dest_rpath, dest_root = None): ...@@ -118,7 +118,6 @@ def link_rp(diff_rorp, dest_rpath, dest_root = None):
# This can happen if the source of dest_link_rpath was deleted # This can happen if the source of dest_link_rpath was deleted
# after it's linking info was recorded but before # after it's linking info was recorded but before
# dest_link_rpath was written. # dest_link_rpath was written.
print "$$$$$$$", exc, exc[0], errno.errorcode[exc[0]]
if errno.errorcode[exc[0]] == 'ENOENT': if errno.errorcode[exc[0]] == 'ENOENT':
dest_rpath.touch() # This will cause an UpdateError later dest_rpath.touch() # This will cause an UpdateError later
else: raise Exception("EnvironmentError '%s' linking %s to %s" % else: raise Exception("EnvironmentError '%s' linking %s to %s" %
......
...@@ -415,6 +415,7 @@ def backup_set_fs_globals(rpin, rpout): ...@@ -415,6 +415,7 @@ def backup_set_fs_globals(rpin, rpout):
Log.FatalError("--never-drop-acls specified, but ACL support\n" Log.FatalError("--never-drop-acls specified, but ACL support\n"
"disabled on destination filesystem") "disabled on destination filesystem")
if Globals.preserve_hardlinks != 0:
SetConnections.UpdateGlobal('preserve_hardlinks', dest_fsa.hardlinks) SetConnections.UpdateGlobal('preserve_hardlinks', dest_fsa.hardlinks)
SetConnections.UpdateGlobal('fsync_directories', dest_fsa.fsync_dirs) SetConnections.UpdateGlobal('fsync_directories', dest_fsa.fsync_dirs)
SetConnections.UpdateGlobal('change_ownership', dest_fsa.ownership) SetConnections.UpdateGlobal('change_ownership', dest_fsa.ownership)
...@@ -521,6 +522,7 @@ def restore_set_fs_globals(target): ...@@ -521,6 +522,7 @@ def restore_set_fs_globals(target):
Log.FatalError("--never-drop-acls specified, but ACL support\n" Log.FatalError("--never-drop-acls specified, but ACL support\n"
"disabled on destination filesystem") "disabled on destination filesystem")
if Globals.preserve_hardlinks != 0:
SetConnections.UpdateGlobal('preserve_hardlinks', target_fsa.hardlinks) SetConnections.UpdateGlobal('preserve_hardlinks', target_fsa.hardlinks)
SetConnections.UpdateGlobal('change_ownership', target_fsa.ownership) SetConnections.UpdateGlobal('change_ownership', target_fsa.ownership)
...@@ -699,6 +701,7 @@ def single_set_fs_globals(rbdir): ...@@ -699,6 +701,7 @@ def single_set_fs_globals(rbdir):
update_triple(fsa.carbonfile, update_triple(fsa.carbonfile,
('carbonfile_active', 'carbonfile_write', 'carbonfile_conn')) ('carbonfile_active', 'carbonfile_write', 'carbonfile_conn'))
if Globals.preserve_hardlinks != 0:
SetConnections.UpdateGlobal('preserve_hardlinks', fsa.hardlinks) SetConnections.UpdateGlobal('preserve_hardlinks', fsa.hardlinks)
SetConnections.UpdateGlobal('fsync_directories', fsa.fsync_dirs) SetConnections.UpdateGlobal('fsync_directories', fsa.fsync_dirs)
SetConnections.UpdateGlobal('change_ownership', fsa.ownership) SetConnections.UpdateGlobal('change_ownership', fsa.ownership)
......
...@@ -497,7 +497,8 @@ class PatchITRB(rorpiter.ITRBranch): ...@@ -497,7 +497,8 @@ class PatchITRB(rorpiter.ITRBranch):
assert diff_rorp.get_attached_filetype() == 'diff' assert diff_rorp.get_attached_filetype() == 'diff'
if robust.check_common_error(self.error_handler, if robust.check_common_error(self.error_handler,
Rdiff.patch_local, (basis_rp, diff_rorp, new)) == 0: return 0 Rdiff.patch_local, (basis_rp, diff_rorp, new)) == 0: return 0
if new.lstat(): rpath.copy_attribs(diff_rorp, new) if new.lstat() and not diff_rorp.isflaglinked():
rpath.copy_attribs(diff_rorp, new)
return self.matches_cached_rorp(diff_rorp, new) return self.matches_cached_rorp(diff_rorp, new)
def matches_cached_rorp(self, diff_rorp, new_rp): def matches_cached_rorp(self, diff_rorp, new_rp):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment