Skip to content

Commit 6a4cfdc

Browse files
authored
Merge pull request #9 from JedMeister/fix-spaces-in-limits
Fix spaces in limits
2 parents b210fee + d660f21 commit 6a4cfdc

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

cmd_restore.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135

136136
from string import Template
137137
import re
138+
import shlex
138139

139140
from os.path import *
140141
from restore import Restore
@@ -338,7 +339,7 @@ def main():
338339
elif opt == '--simulate':
339340
opt_simulate = True
340341
elif opt == '--limits':
341-
opt_limits += re.split(r'\s+', val)
342+
opt_limits += shlex.split(val)
342343
elif opt == '--keyfile':
343344
if not isfile(val):
344345
fatal("keyfile %s does not exist or is not a file" % `val`)

conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def fromfile(cls, inputfile):
3030
if not line:
3131
continue
3232

33-
limits += line.split()
33+
limits.append(line)
3434

3535
def is_legal(limit):
3636
if cls._is_db_limit(limit):

docs/tklbam-backup.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ ARGUMENTS
2323

2424
Overrides are usually configured in /etc/tklbam/overrides.
2525

26+
Note overrides that include a space in their path do NOT need to be escaped
27+
when included in /etc/tklbam/overrides (just put them on their own line).
28+
If excluding/including them from the commandline, they can be escaped or
29+
quoted. E.g. /path\ with\ space/ or "/path with space/".
30+
2631
Filesystem overrides
2732
--------------------
2833

docs/tklbam-restore.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ System restore options
8888
Preceding a limit with a minus sign
8989
turns it into an exclusion.
9090

91+
Mutliple items are space separated. Spaces in paths must be
92+
escaped. E.g. --limits="/path\ with\ spaces -/another\ path"
93+
9194
`LIMITS` := "``LIMIT``-1 .. ``LIMIT``-N"
9295

9396
``LIMIT`` := -?( /path/to/include/or/exclude |

0 commit comments

Comments
 (0)