Commit d59a4bb8 authored by bescoto's avatar bescoto

Changed remove_older_than errorlevel when no increments found


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@318 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent baa95139
...@@ -68,7 +68,7 @@ def init_quoting_regexps(): ...@@ -68,7 +68,7 @@ def init_quoting_regexps():
global chars_to_quote_regexp, unquoting_regexp global chars_to_quote_regexp, unquoting_regexp
try: try:
chars_to_quote_regexp = \ chars_to_quote_regexp = \
re.compile("[%s%s]" % (chars_to_quote, quoting_char), re.S) re.compile("[%s]|%s" % (chars_to_quote, quoting_char), re.S)
unquoting_regexp = re.compile("%s[0-9]{3}" % quoting_char, re.S) unquoting_regexp = re.compile("%s[0-9]{3}" % quoting_char, re.S)
except re.error: except re.error:
log.Log.FatalError("Error '%s' when processing char quote list %s" % log.Log.FatalError("Error '%s' when processing char quote list %s" %
......
...@@ -145,7 +145,7 @@ def parse_cmdlineoptions(arglist): ...@@ -145,7 +145,7 @@ def parse_cmdlineoptions(arglist):
sys.exit(0) sys.exit(0)
elif opt == "-v" or opt == "--verbosity": Log.setverbosity(arg) elif opt == "-v" or opt == "--verbosity": Log.setverbosity(arg)
elif opt == "--windows-mode": elif opt == "--windows-mode":
Globals.set('chars_to_quote', "A-Z:\\/*?\"<>|") Globals.set('chars_to_quote', "^a-z._ -")
Globals.set('quoting_enabled', 1) Globals.set('quoting_enabled', 1)
Globals.set('preserve_hardlinks', 0) Globals.set('preserve_hardlinks', 0)
Globals.set('change_ownership', 0) Globals.set('change_ownership', 0)
...@@ -535,7 +535,7 @@ def RemoveOlderThan(rootrp): ...@@ -535,7 +535,7 @@ def RemoveOlderThan(rootrp):
times_in_secs = filter(lambda t: t < time, times_in_secs) times_in_secs = filter(lambda t: t < time, times_in_secs)
if not times_in_secs: if not times_in_secs:
Log.FatalError("No increments older than %s found, exiting." Log.FatalError("No increments older than %s found, exiting."
% (timep,), 1) % (timep,), 1, errlevel = 0)
times_in_secs.sort() times_in_secs.sort()
inc_pretty_time = "\n".join(map(Time.timetopretty, times_in_secs)) inc_pretty_time = "\n".join(map(Time.timetopretty, times_in_secs))
......
...@@ -150,7 +150,7 @@ class Logger: ...@@ -150,7 +150,7 @@ class Logger:
self.log_to_term("%s %s (%d): %s" % self.log_to_term("%s %s (%d): %s" %
(conn_str, direction, req_num, result_repr), 9) (conn_str, direction, req_num, result_repr), 9)
def FatalError(self, message, no_fatal_message = 0): def FatalError(self, message, no_fatal_message = 0, errlevel = 1):
"""Log a fatal error and exit""" """Log a fatal error and exit"""
assert no_fatal_message == 0 or no_fatal_message == 1 assert no_fatal_message == 0 or no_fatal_message == 1
if no_fatal_message: prefix_string = "" if no_fatal_message: prefix_string = ""
...@@ -158,7 +158,7 @@ class Logger: ...@@ -158,7 +158,7 @@ class Logger:
self(prefix_string + message, 1) self(prefix_string + message, 1)
import Main import Main
Main.cleanup() Main.cleanup()
sys.exit(1) sys.exit(errlevel)
def exception_to_string(self, arglist = []): def exception_to_string(self, arglist = []):
"""Return string version of current exception plus what's in arglist""" """Return string version of current exception plus what's in arglist"""
......
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