diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-10-27 06:16:39 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-10-27 06:16:39 +0000 |
commit | d9b68d73175d004caed8c781c97308f7c2e3dccc (patch) | |
tree | 7be1e3b4c7a23324d6d4ef0ed5483b890ee58210 /rdiff-backup/rdiff_backup/metadata.py | |
parent | 80470345fa1998a033078314f77930a60ea14107 (diff) | |
download | rdiff-backup-d9b68d73175d004caed8c781c97308f7c2e3dccc.tar.gz |
Write SHA1 digests for all regular files
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@662 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/metadata.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/metadata.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rdiff-backup/rdiff_backup/metadata.py b/rdiff-backup/rdiff_backup/metadata.py index 8b261a7..c8e6579 100644 --- a/rdiff-backup/rdiff_backup/metadata.py +++ b/rdiff-backup/rdiff_backup/metadata.py @@ -119,6 +119,10 @@ def RORP2Record(rorpath): str_list.append(" Inode %s\n" % rorpath.getinode()) str_list.append(" DeviceLoc %s\n" % rorpath.getdevloc()) + # Save any hashes, if available + if rorpath.has_sha1(): + str_list.append(' SHA1Digest %s\n' % rorpath.get_sha1()) + elif type == "None": return "".join(str_list) elif type == "dir" or type == "sock" or type == "fifo": pass elif type == "sym": @@ -166,6 +170,7 @@ def Record2RORP(record_string): elif field == "CarbonFile": if data == "None": data_dict['carbonfile'] = None else: data_dict['carbonfile'] = string2carbonfile(data) + elif field == "SHA1Digest": data_dict['sha1'] = data elif field == "NumHardLinks": data_dict['nlink'] = int(data) elif field == "Inode": data_dict['inode'] = long(data) elif field == "DeviceLoc": data_dict['devloc'] = long(data) |