diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-03-05 00:22:20 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-03-05 00:22:20 +0000 |
commit | 606bc949ff7c13e3873a6f69f7da22b3280cde12 (patch) | |
tree | a2f029e7c1ddf72bc1e179095426d9c4769ca4f0 | |
parent | 92f6eacb378fe0d3ee668dc6bf17511c6781bf52 (diff) | |
download | rdiff-backup-606bc949ff7c13e3873a6f69f7da22b3280cde12.tar.gz |
Added error checking when making special files
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@295 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r-- | rdiff-backup/rdiff_backup/increment.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/rdiff-backup/rdiff_backup/increment.py b/rdiff-backup/rdiff_backup/increment.py index 21612f8..40cb8d8 100644 --- a/rdiff-backup/rdiff_backup/increment.py +++ b/rdiff-backup/rdiff_backup/increment.py @@ -19,7 +19,7 @@ """Provides functions and *ITR classes, for writing increment files""" -import Globals, Time, rpath, Rdiff, log, statistics +import Globals, Time, rpath, Rdiff, log, statistics, robust def Increment(new, mirror, incpref): @@ -59,9 +59,18 @@ def iscompressed(mirror): def makesnapshot(mirror, incpref): """Copy mirror to incfile, since new is quite different""" compress = iscompressed(mirror) - if compress: snapshotrp = get_inc(incpref, "snapshot.gz") + if compress and mirror.isreg(): + snapshotrp = get_inc(incpref, "snapshot.gz") else: snapshotrp = get_inc(incpref, "snapshot") - rpath.copy_with_attribs(mirror, snapshotrp, compress) + + if mirror.isspecial(): # check for errors when creating special increments + eh = robust.get_error_handler("SpecialFileError") + if robust.check_common_error(eh, rpath.copy_with_attribs, + (mirror, snapshotrp, compress)) == 0: + snapshotrp.setdata() + if snapshotrp.lstat(): snapshotrp.delete() + snapshotrp.touch() + else: rpath.copy_with_attribs(mirror, snapshotrp, compress) return snapshotrp def makediff(new, mirror, incpref): |