summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/rpath.py
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-12-13 20:49:17 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-12-13 20:49:17 +0000
commit3b9298b8018c0df65ce601af092b6ce4a6a4d090 (patch)
treec976707f5b16c8a897830d1f7020c3f0b1d61273 /rdiff-backup/rdiff_backup/rpath.py
parentc1a39e88df7ec66297635f519cb1f3fbd1b584f0 (diff)
downloadrdiff-backup-3b9298b8018c0df65ce601af092b6ce4a6a4d090.tar.gz
Added iterator operations on metadata file
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@244 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/rpath.py')
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index cfc0688..9d54872 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -271,11 +271,35 @@ class RORPath(RPathStatic):
pass
elif key == 'atime' and not Globals.preserve_atime: pass
elif key == 'devloc' or key == 'inode' or key == 'nlink': pass
- elif key == 'size' and self.isdir(): pass
+ elif key == 'size' and not self.isreg():
+ pass # size only matters for regular files
elif (not other.data.has_key(key) or
self.data[key] != other.data[key]): return None
return 1
+ def equal_verbose(self, other):
+ """Like __eq__, but log more information. Useful when testing"""
+ if self.index != other.index:
+ Log("Index %s != index %s" % (self.index, other.index), 2)
+ return None
+
+ for key in self.data.keys(): # compare dicts key by key
+ if ((key == 'uid' or key == 'gid') and
+ (not Globals.change_ownership or self.issym())):
+ # Don't compare gid/uid for symlinks or if not change_ownership
+ pass
+ elif key == 'atime' and not Globals.preserve_atime: pass
+ elif key == 'devloc' or key == 'inode' or key == 'nlink': pass
+ elif key == 'size' and not self.isreg(): pass
+ elif (not other.data.has_key(key) or
+ self.data[key] != other.data[key]):
+ if not other.data.has_key(key):
+ Log("Second is missing key %s" % (key,), 2)
+ else: Log("Value of %s differs: %s vs %s" %
+ (key, self.data[key], other.data[key]), 2)
+ return None
+ return 1
+
def __ne__(self, other): return not self.__eq__(other)
def __str__(self):