summaryrefslogtreecommitdiff
path: root/rdiff-backup
diff options
context:
space:
mode:
Diffstat (limited to 'rdiff-backup')
-rw-r--r--rdiff-backup/CHANGELOG6
-rw-r--r--rdiff-backup/rdiff-backup.19
-rw-r--r--rdiff-backup/rdiff_backup/selection.py7
3 files changed, 20 insertions, 2 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index 33d7c48..f4daaa3 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,3 +1,9 @@
+New in v1.1.9 (????/??/??)
+--------------------------
+
+Glob escaping support via backslash. (Andrew Price)
+
+
New in v1.1.8 (2007/01/29)
--------------------------
diff --git a/rdiff-backup/rdiff-backup.1 b/rdiff-backup/rdiff-backup.1
index bd93703..a6725f0 100644
--- a/rdiff-backup/rdiff-backup.1
+++ b/rdiff-backup/rdiff-backup.1
@@ -738,6 +738,15 @@ insensitive), then this prefix will be removed and any character in
the string can be replaced with an upper- or lowercase version of
itself.
+If you need to match filenames which contain the above globbing
+characters, they may be escaped using a backslash "\\". The backslash
+will only escape the character following it so for
+.B **
+you will need
+to use "\\*\\*" to avoid escaping it to the
+.B *
+globbing character.
+
Remember that you may need to quote these characters when typing them
into a shell, so the shell does not interpret the globbing patterns
before rdiff-backup sees them.
diff --git a/rdiff-backup/rdiff_backup/selection.py b/rdiff-backup/rdiff_backup/selection.py
index 96b53aa..47bc1ef 100644
--- a/rdiff-backup/rdiff_backup/selection.py
+++ b/rdiff-backup/rdiff_backup/selection.py
@@ -77,7 +77,7 @@ class Select:
"""
# This re should not match normal filenames, but usually just globs
- glob_re = re.compile("(.*[*?[]|ignorecase\\:)", re.I | re.S)
+ glob_re = re.compile("(.*[*?[\\\\]|ignorecase\\:)", re.I | re.S)
def __init__(self, rootrp):
"""Select initializer. rpath is the root directory"""
@@ -640,7 +640,10 @@ probably isn't what you meant.""" %
while i < n:
c, s = pat[i], pat[i:i+2]
i = i+1
- if s == '**':
+ if c == '\\':
+ res = res + re.escape(s[-1])
+ i = i + 1
+ elif s == '**':
res = res + '.*'
i = i + 1
elif c == '*': res = res + '[^/]*'