/[rdiff-backup]/rdiff-backup/rdiff_backup/Main.py
ViewVC logotype

Diff of /rdiff-backup/rdiff_backup/Main.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.89 by bescoto, Wed Oct 19 02:45:24 2005 UTC revision 1.90 by bescoto, Thu Oct 20 19:34:51 2005 UTC
# Line 33  remote_cmd, remote_schema = None, None Line 33  remote_cmd, remote_schema = None, None
33  force = None  force = None
34  select_opts = []  select_opts = []
35  select_files = []  select_files = []
36  user_mapping_filename, group_mapping_filename = None, None  user_mapping_filename, group_mapping_filename, preserve_numerical_ids = \
37                                               None, None, None
38    
39  # These are global because they are set while we are trying to figure  # These are global because they are set while we are trying to figure
40  # whether to restore or to backup  # whether to restore or to backup
41  restore_root, restore_index, restore_root_set = None, None, 0  restore_root, restore_index, restore_root_set = None, None, 0
# Line 43  def parse_cmdlineoptions(arglist): Line 45  def parse_cmdlineoptions(arglist):
45          """Parse argument list and set global preferences"""          """Parse argument list and set global preferences"""
46          global args, action, create_full_path, force, restore_timestr, remote_cmd          global args, action, create_full_path, force, restore_timestr, remote_cmd
47          global remote_schema, remove_older_than_string          global remote_schema, remove_older_than_string
48          global user_mapping_filename, group_mapping_filename          global user_mapping_filename, group_mapping_filename, \
49                       preserve_numerical_ids
50    
51          def sel_fl(filename):          def sel_fl(filename):
52                  """Helper function for including/excluding filelists below"""                  """Helper function for including/excluding filelists below"""
53                  try: return open(filename, "r")                  try: return open(filename, "r")
# Line 73  def parse_cmdlineoptions(arglist): Line 77  def parse_cmdlineoptions(arglist):
77                    "no-compression-regexp=", "no-eas", "no-file-statistics",                    "no-compression-regexp=", "no-eas", "no-file-statistics",
78                    "no-hard-links", "null-separator",                    "no-hard-links", "null-separator",
79                    "override-chars-to-quote=", "parsable-output",                    "override-chars-to-quote=", "parsable-output",
80                    "print-statistics", "remote-cmd=", "remote-schema=",                    "preserve-numerical-ids", "print-statistics",
81                      "remote-cmd=", "remote-schema=",
82                    "remove-older-than=", "restore-as-of=", "restrict=",                    "remove-older-than=", "restore-as-of=", "restrict=",
83                    "restrict-read-only=", "restrict-update-only=", "server",                    "restrict-read-only=", "restrict-update-only=", "server",
84                    "ssh-no-compression", "terminal-verbosity=", "test-server",                    "ssh-no-compression", "terminal-verbosity=", "test-server",
# Line 156  def parse_cmdlineoptions(arglist): Line 161  def parse_cmdlineoptions(arglist):
161                  elif opt == "--override-chars-to-quote":                  elif opt == "--override-chars-to-quote":
162                          Globals.set('chars_to_quote', arg)                          Globals.set('chars_to_quote', arg)
163                  elif opt == "--parsable-output": Globals.set('parsable_output', 1)                  elif opt == "--parsable-output": Globals.set('parsable_output', 1)
164                    elif opt == "--preserve-numerical-ids": preserve_numerical_ids = 1
165                  elif opt == "--print-statistics": Globals.set('print_statistics', 1)                  elif opt == "--print-statistics": Globals.set('print_statistics', 1)
166                  elif opt == "-r" or opt == "--restore-as-of":                  elif opt == "-r" or opt == "--restore-as-of":
167                          restore_timestr, action = arg, "restore-as-of"                          restore_timestr, action = arg, "restore-as-of"
# Line 233  def misc_setup(rps): Line 239  def misc_setup(rps):
239    
240  def init_user_group_mapping(destination_conn):  def init_user_group_mapping(destination_conn):
241          """Initialize user and group mapping on destination connection"""          """Initialize user and group mapping on destination connection"""
242          global user_mapping_filename, group_mapping_filename          global user_mapping_filename, group_mapping_filename, \
243                       preserve_numerical_ids
244          def get_string_from_file(filename):          def get_string_from_file(filename):
245                  if not filename: return None                  if not filename: return None
246                  rp = rpath.RPath(Globals.local_connection, filename)                  rp = rpath.RPath(Globals.local_connection, filename)
# Line 242  def init_user_group_mapping(destination_ Line 249  def init_user_group_mapping(destination_
249                          Log.FatalError("Error '%s' reading mapping file '%s'" %                          Log.FatalError("Error '%s' reading mapping file '%s'" %
250                                                     (str(e), filename))                                                     (str(e), filename))
251          user_mapping_string = get_string_from_file(user_mapping_filename)          user_mapping_string = get_string_from_file(user_mapping_filename)
252          destination_conn.user_group.init_user_mapping(user_mapping_string)          destination_conn.user_group.init_user_mapping(user_mapping_string,
253                                                                                                      preserve_numerical_ids)
254          group_mapping_string = get_string_from_file(group_mapping_filename)          group_mapping_string = get_string_from_file(group_mapping_filename)
255          destination_conn.user_group.init_group_mapping(group_mapping_string)          destination_conn.user_group.init_group_mapping(group_mapping_string,
256                                                                                                       preserve_numerical_ids)
257    
258  def take_action(rps):  def take_action(rps):
259          """Do whatever action says"""          """Do whatever action says"""

Legend:
Removed from v.1.89  
changed lines
  Added in v.1.90

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26