[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[rdiff-backup-users] [PATCH] Support for backing up paths with trailing
From: |
Josh Nisly |
Subject: |
[rdiff-backup-users] [PATCH] Support for backing up paths with trailing slashes on Windows |
Date: |
Thu, 27 Nov 2008 10:02:07 -0600 |
User-agent: |
Thunderbird 2.0.0.18 (X11/20081125) |
The problem this fixes is most evident when trying to back up an entire
drive e.g. C:\, but the same problem occurs whenever there is a trailing
slash in the path. The issue is that rdiff-backup has support for using
\ as a way of escaping characters in the path specifier. This is all
fine and common on unix, but on Windows, the \ is obviously used as a
path separator. (There really is no way of escaping characters like this
on the Windows command line. It is expected that you simple quote
everything.) This patch simply disables escaping if the path separator
is a \.
This does remove some functionality: if you are backing up from Windows
to linux, you could have escaped the remote side of the connection, and
with this patch you can't. However, you can still quote the remote path,
and I believe that it's more important to allow trailing slashes,
especially with drive specifications, than supporting escaping for the
remote path.
(This problem was first reported here:
http://lists.gnu.org/archive/html/rdiff-backup-users/2008-08/msg00051.html.)
Thanks,
JoshN
--- rdiff_backup/SetConnections.py 9 Oct 2008 20:23:42 -0000 1.18
+++ rdiff_backup/SetConnections.py 27 Nov 2008 15:38:47 -0000
@@ -97,12 +97,14 @@
raise SetConnectionsException(
"Unexpected end to file description %s" %
file_desc)
+ allow_escaping = os.sep != '\\'
+
host_info_list, i, last_was_quoted = [], 0, None
while 1:
if i == len(file_desc):
return (None, file_desc)
- if file_desc[i] == '\\':
+ if file_desc[i] == '\\' and allow_escaping:
i = i+1
check_len(i)
last_was_quoted = 1
- [rdiff-backup-users] [PATCH] Support for backing up paths with trailing slashes on Windows,
Josh Nisly <=