Commit 14c49287 authored by ben's avatar ben

Fixed --include reporting bug, and added error checking to directory

listings so that "door" files would be skipped


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@91 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 6e677ef7
...@@ -268,7 +268,8 @@ class HLDestinationStruct: ...@@ -268,7 +268,8 @@ class HLDestinationStruct:
def check_skip_error(cls, thunk, dsrp): def check_skip_error(cls, thunk, dsrp):
"""Run thunk, catch certain errors skip files""" """Run thunk, catch certain errors skip files"""
try: return thunk() try: return thunk()
except (IOError, OSError, SkipFileException, DSRPPermError), exp: except (IOError, OSError, SkipFileException, DSRPPermError,
RPathException), exp:
Log.exception() Log.exception()
if (not isinstance(exp, IOError) or if (not isinstance(exp, IOError) or
(isinstance(exp, IOError) and (isinstance(exp, IOError) and
......
...@@ -580,7 +580,7 @@ class ResumeSessionInfo: ...@@ -580,7 +580,7 @@ class ResumeSessionInfo:
last_index - Last confirmed index processed by backup, or None last_index - Last confirmed index processed by backup, or None
last_definitive - True is we know last_index is really last last_definitive - True is we know last_index is really last
finalizer - the dsrp finalizer if available finalizer - the dsrp finalizer if available
ITR_state - For increment, ITM reducer (assume mirror if NA) ITR - For increment, ITM reducer (assume mirror if NA)
""" """
self.time = time self.time = time
......
...@@ -129,7 +129,8 @@ class Select: ...@@ -129,7 +129,8 @@ class Select:
new_dsrp = Robust.check_common_error( new_dsrp = Robust.check_common_error(
lambda: dsrpath.append(filename)) lambda: dsrpath.append(filename))
if not new_dsrp: if not new_dsrp:
Log("Error initializing file %s" % dsrpath.path, 2) Log("Error initializing file %s/%s" %
(dsrpath.path, filename), 2)
else: else:
for dsrp in rec_func(new_dsrp, rec_func, sel_func): for dsrp in rec_func(new_dsrp, rec_func, sel_func):
yield dsrp yield dsrp
...@@ -237,7 +238,7 @@ pattern (such as '**') which matches the base directory.""" % ...@@ -237,7 +238,7 @@ pattern (such as '**') which matches the base directory.""" %
only specifies that files be included. Because the default is to only specifies that files be included. Because the default is to
include all files, the expression is redundant. Exiting because this include all files, the expression is redundant. Exiting because this
probably isn't what you meant.""" % probably isn't what you meant.""" %
(self.selection_functions[-1].name, self.prefix)) (self.selection_functions[-1].name,))
def add_selection_func(self, sel_func, add_to_start = None): def add_selection_func(self, sel_func, add_to_start = None):
"""Add another selection function at the end or beginning""" """Add another selection function at the end or beginning"""
...@@ -380,7 +381,8 @@ probably isn't what you meant.""" % ...@@ -380,7 +381,8 @@ probably isn't what you meant.""" %
else: sel_func = self.glob_get_normal_sf(glob_str, include) else: sel_func = self.glob_get_normal_sf(glob_str, include)
sel_func.exclude = not include sel_func.exclude = not include
sel_func.name = "Command-line glob: %s" % glob_str sel_func.name = "Command-line %s glob: %s" % \
(include and "include" or "exclude", glob_str)
return sel_func return sel_func
def glob_get_filename_sf(self, filename, include): def glob_get_filename_sf(self, filename, include):
......
...@@ -268,7 +268,8 @@ class HLDestinationStruct: ...@@ -268,7 +268,8 @@ class HLDestinationStruct:
def check_skip_error(cls, thunk, dsrp): def check_skip_error(cls, thunk, dsrp):
"""Run thunk, catch certain errors skip files""" """Run thunk, catch certain errors skip files"""
try: return thunk() try: return thunk()
except (IOError, OSError, SkipFileException, DSRPPermError), exp: except (IOError, OSError, SkipFileException, DSRPPermError,
RPathException), exp:
Log.exception() Log.exception()
if (not isinstance(exp, IOError) or if (not isinstance(exp, IOError) or
(isinstance(exp, IOError) and (isinstance(exp, IOError) and
......
...@@ -580,7 +580,7 @@ class ResumeSessionInfo: ...@@ -580,7 +580,7 @@ class ResumeSessionInfo:
last_index - Last confirmed index processed by backup, or None last_index - Last confirmed index processed by backup, or None
last_definitive - True is we know last_index is really last last_definitive - True is we know last_index is really last
finalizer - the dsrp finalizer if available finalizer - the dsrp finalizer if available
ITR_state - For increment, ITM reducer (assume mirror if NA) ITR - For increment, ITM reducer (assume mirror if NA)
""" """
self.time = time self.time = time
......
...@@ -129,7 +129,8 @@ class Select: ...@@ -129,7 +129,8 @@ class Select:
new_dsrp = Robust.check_common_error( new_dsrp = Robust.check_common_error(
lambda: dsrpath.append(filename)) lambda: dsrpath.append(filename))
if not new_dsrp: if not new_dsrp:
Log("Error initializing file %s" % dsrpath.path, 2) Log("Error initializing file %s/%s" %
(dsrpath.path, filename), 2)
else: else:
for dsrp in rec_func(new_dsrp, rec_func, sel_func): for dsrp in rec_func(new_dsrp, rec_func, sel_func):
yield dsrp yield dsrp
...@@ -237,7 +238,7 @@ pattern (such as '**') which matches the base directory.""" % ...@@ -237,7 +238,7 @@ pattern (such as '**') which matches the base directory.""" %
only specifies that files be included. Because the default is to only specifies that files be included. Because the default is to
include all files, the expression is redundant. Exiting because this include all files, the expression is redundant. Exiting because this
probably isn't what you meant.""" % probably isn't what you meant.""" %
(self.selection_functions[-1].name, self.prefix)) (self.selection_functions[-1].name,))
def add_selection_func(self, sel_func, add_to_start = None): def add_selection_func(self, sel_func, add_to_start = None):
"""Add another selection function at the end or beginning""" """Add another selection function at the end or beginning"""
...@@ -380,7 +381,8 @@ probably isn't what you meant.""" % ...@@ -380,7 +381,8 @@ probably isn't what you meant.""" %
else: sel_func = self.glob_get_normal_sf(glob_str, include) else: sel_func = self.glob_get_normal_sf(glob_str, include)
sel_func.exclude = not include sel_func.exclude = not include
sel_func.name = "Command-line glob: %s" % glob_str sel_func.name = "Command-line %s glob: %s" % \
(include and "include" or "exclude", glob_str)
return sel_func return sel_func
def glob_get_filename_sf(self, filename, include): def glob_get_filename_sf(self, filename, include):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment