Commit a2ae6e66 authored by bescoto's avatar bescoto

More fixes from Daniel Hazelbaker, mostly related to resource forks


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@350 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 9b99e1d0
...@@ -89,7 +89,7 @@ def MakeTar(): ...@@ -89,7 +89,7 @@ def MakeTar():
assert not os.system("cp %s %s" % (filename, tardir)), filename assert not os.system("cp %s %s" % (filename, tardir)), filename
os.mkdir(tardir+"/rdiff_backup") os.mkdir(tardir+"/rdiff_backup")
for filename in ["backup.py", "connection.py", for filename in ["eas_acls.py", "backup.py", "connection.py",
"FilenameMapping.py", "Hardlink.py", "FilenameMapping.py", "Hardlink.py",
"increment.py", "__init__.py", "iterfile.py", "increment.py", "__init__.py", "iterfile.py",
"lazy.py", "librsync.py", "log.py", "Main.py", "lazy.py", "librsync.py", "log.py", "Main.py",
......
...@@ -430,6 +430,8 @@ def restore_set_fs_globals(target): ...@@ -430,6 +430,8 @@ def restore_set_fs_globals(target):
update_bool_global('write_acls', target_fsa.acls) update_bool_global('write_acls', target_fsa.acls)
update_bool_global('read_eas', target_fsa.eas) update_bool_global('read_eas', target_fsa.eas)
update_bool_global('write_eas', target_fsa.eas) update_bool_global('write_eas', target_fsa.eas)
update_bool_global('read_resource_forks', target_fsa.resource_forks)
update_bool_global('write_resource_forks', target_fsa.resource_forks)
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)
......
...@@ -27,7 +27,7 @@ FSAbilities object describing it. ...@@ -27,7 +27,7 @@ FSAbilities object describing it.
""" """
import errno import errno, os
import Globals, log, TempFile, selection import Globals, log, TempFile, selection
class FSAbilities: class FSAbilities:
...@@ -284,18 +284,17 @@ rdiff-backup-data/chars_to_quote. ...@@ -284,18 +284,17 @@ rdiff-backup-data/chars_to_quote.
"""Test for resource forks by writing to regular_file/rsrc""" """Test for resource forks by writing to regular_file/rsrc"""
reg_rp = dir_rp.append('regfile') reg_rp = dir_rp.append('regfile')
reg_rp.touch() reg_rp.touch()
rfork = reg_rp.append('rsrc')
assert not rfork.lstat()
s = 'test string---this should end up in resource fork' s = 'test string---this should end up in resource fork'
try: try:
fp_write = rfork.open('wb') fp_write = reg_rp.conn.open(os.path.join(reg_rp.path, 'rsrc'),
'wb')
fp_write.write(s) fp_write.write(s)
assert not fp_write.close() assert not fp_write.close()
fp_read = rfork.open('rb') fp_read = reg_rp.conn.open(os.path.join(reg_rp.path, 'rsrc'), 'rb')
s_back = fp_read.read() s_back = fp_read.read()
assert not fp.read.close() assert not fp_read.close()
except (OSError, IOError), e: self.resource_forks = 0 except (OSError, IOError), e: self.resource_forks = 0
else: self.resource_forks = (s_back == s) else: self.resource_forks = (s_back == s)
reg_rp.delete() reg_rp.delete()
......
...@@ -1036,6 +1036,7 @@ class RPath(RORPath): ...@@ -1036,6 +1036,7 @@ class RPath(RORPath):
fp = self.conn.open(os.path.join(self.path, 'rsrc'), 'wb') fp = self.conn.open(os.path.join(self.path, 'rsrc'), 'wb')
fp.write(rfork_data) fp.write(rfork_data)
assert not fp.close() assert not fp.close()
self.set_resource_fork(rfork_data)
class RPathFileHook: class RPathFileHook:
......
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