summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/rpath.py
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-10-24 17:16:05 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-10-24 17:16:05 +0000
commitd4632e3842d0d9bba56704b01e03d636d92cc826 (patch)
tree25398a1f66dc2729b094e2bf03e582d595253af1 /rdiff-backup/rdiff_backup/rpath.py
parent3b9946d214fabebd4c72d278d579de21677b7d0c (diff)
downloadrdiff-backup-d4632e3842d0d9bba56704b01e03d636d92cc826.tar.gz
Refactored fs_abilities, also don't quote if case-insensitive->case-insensitive
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@648 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/rpath.py')
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index 33d1224..3914d58 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -155,7 +155,8 @@ def copy_attribs(rpin, rpout):
if Globals.change_ownership:
rpout.chown(*rpout.conn.user_group.map_rpath(rpin))
if rpin.issym(): return # symlinks don't have times or perms
- if Globals.resource_forks_write and rpin.isreg():
+ if (Globals.resource_forks_write and rpin.isreg() and
+ rpin.has_resource_fork()):
rpout.write_resource_fork(rpin.get_resource_fork())
if Globals.carbonfile_write and rpin.isreg():
rpout.write_carbonfile(rpin.get_carbonfile())
@@ -176,7 +177,8 @@ def copy_attribs_inc(rpin, rpout):
check_for_files(rpin, rpout)
if Globals.change_ownership: apply(rpout.chown, rpin.getuidgid())
if rpin.issym(): return # symlinks don't have times or perms
- if Globals.resource_forks_write and rpin.isreg() and rpout.isreg():
+ if (Globals.resource_forks_write and rpin.isreg() and
+ rpin.has_resource_fork() and rpout.isreg()):
rpout.write_resource_fork(rpin.get_resource_fork())
if Globals.carbonfile_write and rpin.isreg() and rpout.isreg():
rpout.write_carbonfile(rpin.get_carbonfile())
@@ -604,7 +606,10 @@ class RORPath:
def get_acl(self):
"""Return access control list object from dictionary"""
- return self.data['acl']
+ try: return self.data['acl']
+ except KeyError:
+ acl = self.data['acl'] = get_blank_acl(self.index)
+ return acl
def set_ea(self, ea):
"""Record extended attributes in dictionary. Does not write"""
@@ -612,7 +617,10 @@ class RORPath:
def get_ea(self):
"""Return extended attributes object"""
- return self.data['ea']
+ try: return self.data['ea']
+ except KeyError:
+ ea = self.data['ea'] = get_blank_ea(self.index)
+ return ea
def has_carbonfile(self):
"""True if rpath has a carbonfile parameter"""
@@ -1243,7 +1251,9 @@ def setdata_local(rpath):
if Globals.carbonfile_conn and rpath.isreg(): rpath.get_carbonfile()
-# These two are overwritten by the eas_acls.py module. We can't
+# These functions are overwritten by the eas_acls.py module. We can't
# import that module directly because of circular dependency problems.
def acl_get(rp): assert 0
+def get_blank_acl(index): assert 0
def ea_get(rp): assert 0
+def get_blank_ea(index): assert 0