From: Eduardo Robles Elvira Date: Tue, 11 Mar 2014 12:27:10 +0000 (+0100) Subject: adding more easy to understand diff backup debug output X-Git-Tag: v2.2~62 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=50f43227121f7c0843ab37d8fe3c3e569960a67e;p=python-delta-tar adding more easy to understand diff backup debug output --- diff --git a/deltatar/deltatar.py b/deltatar/deltatar.py index 309427a..e01ccf6 100644 --- a/deltatar/deltatar.py +++ b/deltatar/deltatar.py @@ -824,6 +824,8 @@ class DeltaTar(object): stat['path'] = "snapshot://" + dpath['path'] stat['volume'] = self.vol_no + self.logger.debug("[STORE] %s" % dpath['path']) + # backup file tarobj.add(dpath['path'], arcname=stat['path'], recursive=False) @@ -835,10 +837,12 @@ class DeltaTar(object): crc = binascii.crc32(s, crc) & 0xffffffff index_fd.write(s) elif action == 'delete': + path = self.unprefixed(ipath['path']) stat = { - u'path': u'delete://' + self.unprefixed(ipath['path']), + u'path': u'delete://' + path, u'type': ipath['type'] } + self.logger.debug("[DELETE] %s" % path) # mark it as deleted in the backup tarobj.add("/dev/null", arcname=stat['path']) @@ -849,14 +853,15 @@ class DeltaTar(object): index_fd.write(s) elif action == 'list': stat = dpath.copy() - stat['path'] = u'list://' + self.unprefixed(ipath['path']) + 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) # 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) - self.logger.debug("backup %s" % stat['path']) s = bytes('{"type": "END-FILE-LIST"}\n', 'UTF-8') crc = binascii.crc32(s, crc) & 0xffffffff