From 178141703dba8dfa351df7e6294112c952bd9338 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 21 Mar 2002 08:41:26 +0000 Subject: updating now that default is preserve hardlinks fixed possible bug in remote device file handling git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@13 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/rdiff_backup/rpath.py | 3 +-- rdiff-backup/src/main.py | 13 +++++-------- rdiff-backup/src/rpath.py | 3 +-- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py index 6f81347..3f26ade 100644 --- a/rdiff-backup/rdiff_backup/rpath.py +++ b/rdiff-backup/rdiff_backup/rpath.py @@ -487,11 +487,10 @@ class RPath(RORPath): def _getdevnums(self): """Return tuple for special file (major, minor)""" - assert self.conn is Globals.local_connection if Globals.exclude_device_files: # No point in finding numbers because it will be excluded anyway return () - s = os.lstat(self.path).st_rdev + s = self.conn.reval("lambda path: os.lstat(path).st_rdev", self.path) return (s >> 8, s & 0xff) def chmod(self, permissions): diff --git a/rdiff-backup/src/main.py b/rdiff-backup/src/main.py index 2721f34..ba8302f 100755 --- a/rdiff-backup/src/main.py +++ b/rdiff-backup/src/main.py @@ -27,7 +27,7 @@ class Main: "include-from-stdin", "terminal-verbosity=", "exclude-device-files", "resume", "no-resume", "resume-window=", "windows-time-format", - "checkpoint-interval=", "hard-links", "current-time="]) + "checkpoint-interval=", "no-hard-links", "current-time="]) except getopt.error: self.commandline_error("Error parsing commandline options") @@ -45,7 +45,7 @@ class Main: elif opt == "--exclude-mirror": self.exclude_mirror_regstrs.append(arg) elif opt == "--force": self.force = 1 - elif opt == "--hard-links": Globals.set('preserve_hardlinks', 1) + elif opt == "--no-hard-links": Globals.set('preserve_hardlinks', 0) elif opt == "--include-from-stdin": Globals.include_from_stdin = 1 elif opt == "-l" or opt == "--list-increments": self.action = "list-increments" @@ -124,12 +124,9 @@ class Main: elif self.action == "backup": self.Backup(rps[0], rps[1]) elif self.action == "restore": apply(self.Restore, rps) elif self.action == "mirror": self.Mirror(rps[0], rps[1]) - elif self.action == "test-server": - SetConnections.TestConnections() - elif self.action == "list-increments": - self.ListIncrements(rps[0]) - elif self.action == "remove-older-than": - self.RemoveOlderThan(rps[0]) + elif self.action == "test-server": SetConnections.TestConnections() + elif self.action == "list-increments": self.ListIncrements(rps[0]) + elif self.action == "remove-older-than": self.RemoveOlderThan(rps[0]) else: raise AssertionError("Unknown action " + self.action) def cleanup(self): diff --git a/rdiff-backup/src/rpath.py b/rdiff-backup/src/rpath.py index 6f81347..3f26ade 100644 --- a/rdiff-backup/src/rpath.py +++ b/rdiff-backup/src/rpath.py @@ -487,11 +487,10 @@ class RPath(RORPath): def _getdevnums(self): """Return tuple for special file (major, minor)""" - assert self.conn is Globals.local_connection if Globals.exclude_device_files: # No point in finding numbers because it will be excluded anyway return () - s = os.lstat(self.path).st_rdev + s = self.conn.reval("lambda path: os.lstat(path).st_rdev", self.path) return (s >> 8, s & 0xff) def chmod(self, permissions): -- cgit v1.2.1