summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-06-21 01:29:18 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-06-21 01:29:18 +0000
commit5015e6c7a84243200c00c467d892b1b2105ee9bb (patch)
tree46a6533237dbe77d60c46ac319730b80c0dd7d79 /rdiff-backup/rdiff_backup
parentf4da6ca2f3034ae3d5cd08062bb5d964f63789af (diff)
downloadrdiff-backup-5015e6c7a84243200c00c467d892b1b2105ee9bb.tar.gz
Fixed quoted hardlinks, added --windows-restore, fixed a couple tests
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@320 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup')
-rw-r--r--rdiff-backup/rdiff_backup/Hardlink.py3
-rw-r--r--rdiff-backup/rdiff_backup/Main.py7
-rw-r--r--rdiff-backup/rdiff_backup/Security.py1
-rw-r--r--rdiff-backup/rdiff_backup/backup.py8
-rw-r--r--rdiff-backup/rdiff_backup/rorpiter.py26
5 files changed, 28 insertions, 17 deletions
diff --git a/rdiff-backup/rdiff_backup/Hardlink.py b/rdiff-backup/rdiff_backup/Hardlink.py
index f9836fb..453672e 100644
--- a/rdiff-backup/rdiff_backup/Hardlink.py
+++ b/rdiff-backup/rdiff_backup/Hardlink.py
@@ -169,8 +169,7 @@ def restore_link(index, rpath):
def link_rp(diff_rorp, dest_rpath, dest_root = None):
"""Make dest_rpath into a link using link flag in diff_rorp"""
if not dest_root: dest_root = dest_rpath # use base of dest_rpath
- dest_link_rpath = rpath.RPath(dest_root.conn, dest_root.base,
- diff_rorp.get_link_flag())
+ dest_link_rpath = dest_root.new_index(diff_rorp.get_link_flag())
dest_rpath.hardlink(dest_link_rpath.path)
diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py
index 4fa911b..04ce247 100644
--- a/rdiff-backup/rdiff_backup/Main.py
+++ b/rdiff-backup/rdiff_backup/Main.py
@@ -60,7 +60,7 @@ def parse_cmdlineoptions(arglist):
"restrict=", "restrict-read-only=", "restrict-update-only=",
"server", "ssh-no-compression", "terminal-verbosity=",
"test-server", "verbosity=", "version", "windows-mode",
- "windows-time-format"])
+ "windows-restore"])
except getopt.error, e:
commandline_error("Bad commandline options: %s" % str(e))
@@ -145,12 +145,15 @@ def parse_cmdlineoptions(arglist):
sys.exit(0)
elif opt == "-v" or opt == "--verbosity": Log.setverbosity(arg)
elif opt == "--windows-mode":
- Globals.set('chars_to_quote', "^a-z._ -")
+ Globals.set('chars_to_quote', "^a-z0-9._ -")
Globals.set('quoting_enabled', 1)
Globals.set('preserve_hardlinks', 0)
Globals.set('change_ownership', 0)
Globals.set('change_permissions', 0)
Globals.set('fsync_directories', 0)
+ elif opt == '--windows-restore':
+ Globals.set('chars_to_quote', "^a-z0-9._ -")
+ Globals.set('quoting_enabled', 1)
else: Log.FatalError("Unknown option %s" % opt)
def isincfilename(path):
diff --git a/rdiff-backup/rdiff_backup/Security.py b/rdiff-backup/rdiff_backup/Security.py
index b1785d6..b02d335 100644
--- a/rdiff-backup/rdiff_backup/Security.py
+++ b/rdiff-backup/rdiff_backup/Security.py
@@ -121,6 +121,7 @@ def set_allowed_requests(sec_level):
elif sec_level == "read-only" or sec_level == "update-only":
allowed_requests.extend(
["C.make_file_dict",
+ "log.Log.log_to_file",
"os.getuid",
"os.listdir",
"Time.setcurtime_local",
diff --git a/rdiff-backup/rdiff_backup/backup.py b/rdiff-backup/rdiff_backup/backup.py
index cd46c5e..36a207d 100644
--- a/rdiff-backup/rdiff_backup/backup.py
+++ b/rdiff-backup/rdiff_backup/backup.py
@@ -283,8 +283,12 @@ class CacheCollatedPostProcess:
"""Remove one element from cache, possibly adding it to metadata"""
first_index = self.cache_indicies[0]
del self.cache_indicies[0]
- old_source_rorp, old_dest_rorp, changed_flag, success_flag, inc = \
- self.cache_dict[first_index]
+ try: (old_source_rorp, old_dest_rorp, changed_flag,
+ success_flag, inc) = self.cache_dict[first_index]
+ except KeyError: # probably caused by error in file system (dup)
+ log.Log("Warning index %s missing from CCPP cache" %
+ (first_index,),2)
+ return
del self.cache_dict[first_index]
self.post_process(old_source_rorp, old_dest_rorp,
changed_flag, success_flag, inc)
diff --git a/rdiff-backup/rdiff_backup/rorpiter.py b/rdiff-backup/rdiff_backup/rorpiter.py
index 7db4fea..d683650 100644
--- a/rdiff-backup/rdiff_backup/rorpiter.py
+++ b/rdiff-backup/rdiff_backup/rorpiter.py
@@ -30,7 +30,7 @@ files), where files is the number of files attached (usually 1 or
from __future__ import generators
import os, tempfile, UserList, types
-import Globals, rpath, iterfile
+import Globals, rpath, iterfile, log
def CollateIterators(*rorp_iters):
@@ -266,16 +266,20 @@ class IterTreeReducer:
else: self.root_branch.start_process(*args)
self.index = index
return 1
- assert index > self.index, "Index out of order"
-
- if self.finish_branches(index) is None:
- return None # We are no longer in the main tree
- last_branch = self.branches[-1]
- if last_branch.can_fast_process(*args):
- last_branch.fast_process(*args)
- else:
- branch = self.add_branch(index)
- branch.start_process(*args)
+ if index == self.index:
+ log.Log("Warning, repeated index %s, bad filesystem?"
+ % (index,), 2)
+ elif index < self.index:
+ assert 0, "Bad index order: %s >= %s" % (self.index, index)
+ else: # normal case
+ if self.finish_branches(index) is None:
+ return None # We are no longer in the main tree
+ last_branch = self.branches[-1]
+ if last_branch.can_fast_process(*args):
+ last_branch.fast_process(*args)
+ else:
+ branch = self.add_branch(index)
+ branch.start_process(*args)
self.index = index
return 1