From d9b68d73175d004caed8c781c97308f7c2e3dccc Mon Sep 17 00:00:00 2001 From: bescoto Date: Thu, 27 Oct 2005 06:16:39 +0000 Subject: 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 --- rdiff-backup/rdiff_backup/librsync.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'rdiff-backup/rdiff_backup/librsync.py') 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): -- cgit v1.2.1