summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/librsync.py
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-10-27 06:16:39 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-10-27 06:16:39 +0000
commitd9b68d73175d004caed8c781c97308f7c2e3dccc (patch)
tree7be1e3b4c7a23324d6d4ef0ed5483b890ee58210 /rdiff-backup/rdiff_backup/librsync.py
parent80470345fa1998a033078314f77930a60ea14107 (diff)
downloadrdiff-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/librsync.py')
-rw-r--r--rdiff-backup/rdiff_backup/librsync.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/rdiff-backup/rdiff_backup/librsync.py b/rdiff-backup/rdiff_backup/librsync.py
index a8e37ca..d71e475 100644
--- a/rdiff-backup/rdiff_backup/librsync.py
+++ b/rdiff-backup/rdiff_backup/librsync.py
@@ -1,4 +1,4 @@
-# Copyright 2002 Ben Escoto
+# Copyright 2002 2005 Ben Escoto
#
# This file is part of rdiff-backup.
#
@@ -24,7 +24,8 @@ which is written in C. The goal was to use C as little as possible...
"""
-import _librsync, types, array
+import types, array
+import _librsync
blocksize = _librsync.RS_JOB_BLOCKSIZE
@@ -95,15 +96,16 @@ class LikeFile:
new_in = self.infile.read(blocksize)
if not new_in:
self.infile_eof = 1
- assert not self.infile.close()
+ self.infile_closeval = self.infile.close()
self.infile_closed = 1
break
self.inbuf += new_in
def close(self):
- """Close infile"""
- if not self.infile_closed: assert not self.infile.close()
+ """Close infile and pass on infile close value"""
self.closed = 1
+ if self.infile_closed: return self.infile_closeval
+ else: return self.infile.close()
class SigFile(LikeFile):