# retrieve file offset
stat['offset'] = tarobj.get_last_member_offset()
-
- # store in the index the stat dict
- s = bytes(json.dumps(stat) + '\n', 'UTF-8')
- crc = binascii.crc32(s, crc) & 0xffffffff
- index_fd.write(s)
elif action == 'delete':
path = self.unprefixed(ipath['path'])
stat = {
# mark it as deleted in the backup
tarobj.add("/dev/null", arcname=stat['path'])
-
- # store in the index the stat dict
- s = bytes(json.dumps(stat) + '\n', 'UTF-8')
- crc = binascii.crc32(s, crc) & 0xffffffff
- index_fd.write(s)
elif action == 'list':
stat = dpath.copy()
path = self.unprefixed(ipath['path'])
stat['path'] = u'list://' + path
# unchanged files do not enter in the backup, only in the index
self.logger.debug("[UNCHANGED] %s" % path)
+ else:
+ # should not happen
+ self.logger.warn('unknown action in create_diff_backup: {0}'
+ ''.format(action))
+ stat = None
- # store in the index the stat dict
+ if stat:
+ # store the stat dict in the index
s = bytes(json.dumps(stat) + '\n', 'UTF-8')
crc = binascii.crc32(s, crc) & 0xffffffff
index_fd.write(s)