Merge lp:~aaron-whitehouse/duplicity/filelist_combine into lp:~duplicity-team/duplicity/0.7-series
- filelist_combine
- Merge into 0.7-series
Status: | Merged |
---|---|
Merged at revision: | 1081 |
Proposed branch: | lp:~aaron-whitehouse/duplicity/filelist_combine |
Merge into: | lp:~duplicity-team/duplicity/0.7-series |
Diff against target: |
2740 lines (+683/-919) 7 files modified
bin/duplicity.1 (+20/-82) duplicity/commandline.py (+27/-4) duplicity/selection.py (+27/-128) po/duplicity.pot (+99/-106) testing/functional/test_selection.py (+203/-193) testing/stdin_test.sh (+203/-0) testing/unit/test_selection.py (+104/-406) |
To merge this branch: | bzr merge lp:~aaron-whitehouse/duplicity/filelist_combine |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
duplicity-team | Pending | ||
Review via email: mp+252814@code.launchpad.net |
Commit message
Description of the change
Merged globbing and non-globbing filelists to use the same code path and all accept globbing characters. Added deprecation warning to the --exclude-
Note that this does trigger a change in behaviour for duplicity. Previously, include patterns in include-filelist did not match files in a directory that was included, so /usr/local in an include file would not have matched /usr/local/doc. Now, this folder would be included, as would occur if --include or the old --include-
Mark --include-
edso (ed.so) wrote : | # |
Kenneth Loafman (kenneth-loafman) wrote : | # |
1. He deprecated the in/exclude-
functionality into in/exclude-
2. We talked about this on the mailing list. This simplifies the number of
options we deal with and in general should make life easier. If you don't
use globbing, the selection should be simple still.
3. Yes, should have started with the current code for the merge.
On Thu, Mar 12, 2015 at 2:44 PM, edso <email address hidden> wrote:
> three point
>
> 1. wouldn't it make sense to either depreciate in-/exclude or
> in/exclude-globbing as they afre functional identical
>
> 2. not sure if we should want to have keep the old non-globbing selection
> for simple setups. easier to understand and done.
>
> 3. your branch clashes with the current dev branch. you probably need to
> rebase your changes.
>
> ..ede/duply.net
>
>
> --
>
> https:/
> You are subscribed to branch lp:duplicity.
>
edso (ed.so) wrote : | # |
1. so in/exclude-
2. right, but '/folder' is different from '/folder/**' now, although they might be perceived identical by a user. why not fold the whole way and only have one globbing filelist '--filelist' parameter which uses '+/-' to identify the rows as we had them already.
the reasons are
- simplification
- with the meaning change old filelists won't work the same way as before anymore, so a complete new parameter would force users to chack what has changed
of course the change needs to be documented properly in the manpage too.
3. jepp
..ede/duply.net
Aaron Whitehouse (aaron-whitehouse) wrote : | # |
Sorry about the conflict. I thought I had, but was updating against a branch instead of the dev branch - I'm still getting the hang of bzr. Next time I'll know to check the information on the merge page. Hopefully I've rebased it in the correct way, but please let me know if not.
Kenneth is right, I folded the functionality of globbing filelists into non-globbing filelists. What is called --include-filelist is what used to be --include-
I'm not sure that I follow your point that /folder is different from /folder/** now - do you mean that they are prior to the merge, or will be after the merge? Would you mind explaining a little further, please?
I was basing my view that there would be a functionality change on the manual, but in testing the current version (prior to this merge), I'm not sure that it works as I thought it did. The code below works on the current dev version, suggesting to me that at least in the case I've tested they are including the same things (which is all files and subfolders).
class TestOldInclude
def test_old_
"""This compares a backup using --include-filelist with one using --include-
with open("testfiles
restore_dir = 'testfiles/
restored = self.directory_
restore_dir = 'testfiles/
restored2 = self.directory_
I also just had a play around on my system version (0.6.21) to investigate the point from the manual:
"2. Include patterns do not match files in a directory that is included. So /usr/local in an include file will not match /usr/local/doc"
I created a test tree of:
===
usr:
clown local
usr/clown:
usr/local:
doc test1 test.txt
usr/local/doc:
usr/local/test1:
===
and a filelist of:
usr/local
- usr/clown
and ran:
duplicity --include-
On restoring it, my restore filetree is:
===
restore/:
local
restore/local:
doc test1 test.txt
restore/local/doc:
restore/
===
So usr/local in my include file _does_ in fact include the file usr/local/doc in my backup.
Maybe I'm missing the point of what it was supposed to do differently, but obviously if it wasn't actually doing it, we don't need to worry about a functionality change. I would appreciate any thoughts that you have from your much greater knowledge of the code/project!
Kenneth Loafman (kenneth-loafman) wrote : | # |
One of the reasons for --include / --exclude is the default handling for
non-specific names, ones without + or -, say the output of find or similar,
so I'm happy with that scenario. A lot of tools I use have similar
semantics.
One set of semantics I would like to explore is to do away with
--in/exclude-
1) simple filename or directory name
2) @filename to in/exclude by filename
3) - (dash) to in/exclude by stdin
To answer edso's next proposal we could make it --filename if we went with
--filename <spec> where <spec> is like above but preceded by '+' for
inclusion and '-' for exclusion. To avoid confusion we could always drop
#3 above. I know of no use for that option in real life.
On Fri, Mar 13, 2015 at 7:22 AM, <email address hidden> wrote:
> The proposal to merge lp:~aaron-whitehouse/duplicity/filelist_combine into
> lp:duplicity has been updated.
>
> Status: Needs review => Merged
>
> For more details, see:
>
> https:/
> --
> Your team duplicity-team is requested to review the proposed merge of
> lp:~aaron-whitehouse/duplicity/filelist_combine into lp:duplicity.
>
> _______
> Mailing list: https:/
> Post to : <email address hidden>
> Unsubscribe : https:/
> More help : https:/
>
Preview Diff
1 | === modified file 'bin/duplicity.1' | |||
2 | --- bin/duplicity.1 2015-02-08 16:43:23 +0000 | |||
3 | +++ bin/duplicity.1 2015-03-12 21:50:57 +0000 | |||
4 | @@ -481,28 +481,15 @@ | |||
5 | 481 | .TP | 481 | .TP |
6 | 482 | .BI "--exclude-filelist " filename | 482 | .BI "--exclude-filelist " filename |
7 | 483 | Excludes the files listed in | 483 | Excludes the files listed in |
26 | 484 | .IR filename . | 484 | .IR filename, |
27 | 485 | See the | 485 | with each line of the filelist interpreted according to the |
10 | 486 | .B FILE SELECTION | ||
11 | 487 | section for more information. | ||
12 | 488 | |||
13 | 489 | .TP | ||
14 | 490 | .BI --exclude-filelist-stdin | ||
15 | 491 | Like | ||
16 | 492 | .BI --exclude-filelist, | ||
17 | 493 | but the list of files will be read from standard input. See the | ||
18 | 494 | .B FILE SELECTION | ||
19 | 495 | section for more information. | ||
20 | 496 | |||
21 | 497 | .TP | ||
22 | 498 | .BR "--exclude-globbing-filelist " filename | ||
23 | 499 | Like | ||
24 | 500 | .BI --exclude-filelist | ||
25 | 501 | but each line of the filelist will be interpreted according to the | ||
28 | 502 | same rules as | 486 | same rules as |
29 | 503 | .BI --include | 487 | .BI --include |
30 | 504 | and | 488 | and |
31 | 505 | .BI --exclude. | 489 | .BI --exclude. |
32 | 490 | See the | ||
33 | 491 | .B FILE SELECTION | ||
34 | 492 | section for more information. | ||
35 | 506 | 493 | ||
36 | 507 | .TP | 494 | .TP |
37 | 508 | .BR "--exclude-if-present " filename | 495 | .BR "--exclude-if-present " filename |
38 | @@ -663,22 +650,6 @@ | |||
39 | 663 | section for more information. | 650 | section for more information. |
40 | 664 | 651 | ||
41 | 665 | .TP | 652 | .TP |
42 | 666 | .BI --include-filelist-stdin | ||
43 | 667 | Like | ||
44 | 668 | .BR --include-filelist , | ||
45 | 669 | but read the list of included files from standard input. | ||
46 | 670 | |||
47 | 671 | .TP | ||
48 | 672 | .BI "--include-globbing-filelist " filename | ||
49 | 673 | Like | ||
50 | 674 | .BI --include-filelist | ||
51 | 675 | but each line of the filelist will be interpreted according to the | ||
52 | 676 | same rules as | ||
53 | 677 | .BI --include | ||
54 | 678 | and | ||
55 | 679 | .BI --exclude. | ||
56 | 680 | |||
57 | 681 | .TP | ||
58 | 682 | .BI "--include-regexp " regexp | 653 | .BI "--include-regexp " regexp |
59 | 683 | Include files matching the regular expression | 654 | Include files matching the regular expression |
60 | 684 | .IR regexp . | 655 | .IR regexp . |
61 | @@ -746,7 +717,7 @@ | |||
62 | 746 | Use nulls (\\0) instead of newlines (\\n) as line separators, which | 717 | Use nulls (\\0) instead of newlines (\\n) as line separators, which |
63 | 747 | may help when dealing with filenames containing newlines. This | 718 | may help when dealing with filenames containing newlines. This |
64 | 748 | affects the expected format of the files specified by the | 719 | affects the expected format of the files specified by the |
66 | 749 | --{include|exclude}-filelist[-stdin] switches as well as the format of | 720 | --{include|exclude}-filelist switches as well as the format of |
67 | 750 | the directory statistics file. | 721 | the directory statistics file. |
68 | 751 | 722 | ||
69 | 752 | .TP | 723 | .TP |
70 | @@ -1337,10 +1308,6 @@ | |||
71 | 1337 | "03-05-2002", and "2002-3-05" all mean March 5th, 2002. | 1308 | "03-05-2002", and "2002-3-05" all mean March 5th, 2002. |
72 | 1338 | 1309 | ||
73 | 1339 | .SH FILE SELECTION | 1310 | .SH FILE SELECTION |
74 | 1340 | duplicity accepts the same file selection options | ||
75 | 1341 | .B rdiff-backup | ||
76 | 1342 | does, including --exclude, --exclude-filelist-stdin, etc. | ||
77 | 1343 | |||
78 | 1344 | When duplicity is run, it searches through the given source | 1311 | When duplicity is run, it searches through the given source |
79 | 1345 | directory and backs up all the files specified by the file selection | 1312 | directory and backs up all the files specified by the file selection |
80 | 1346 | system. The file selection system comprises a number of file | 1313 | system. The file selection system comprises a number of file |
81 | @@ -1353,20 +1320,12 @@ | |||
82 | 1353 | .br | 1320 | .br |
83 | 1354 | --exclude-filelist | 1321 | --exclude-filelist |
84 | 1355 | .br | 1322 | .br |
85 | 1356 | --exclude-filelist-stdin | ||
86 | 1357 | .br | ||
87 | 1358 | --exclude-globbing-filelist | ||
88 | 1359 | .br | ||
89 | 1360 | --exclude-regexp | 1323 | --exclude-regexp |
90 | 1361 | .br | 1324 | .br |
91 | 1362 | --include | 1325 | --include |
92 | 1363 | .br | 1326 | .br |
93 | 1364 | --include-filelist | 1327 | --include-filelist |
94 | 1365 | .br | 1328 | .br |
95 | 1366 | --include-filelist-stdin | ||
96 | 1367 | .br | ||
97 | 1368 | --include-globbing-filelist | ||
98 | 1369 | .br | ||
99 | 1370 | --include-regexp | 1329 | --include-regexp |
100 | 1371 | .RE | 1330 | .RE |
101 | 1372 | Each file selection condition either matches or doesn't match a given | 1331 | Each file selection condition either matches or doesn't match a given |
102 | @@ -1402,9 +1361,9 @@ | |||
103 | 1402 | The | 1361 | The |
104 | 1403 | .BR include , | 1362 | .BR include , |
105 | 1404 | .BR exclude , | 1363 | .BR exclude , |
107 | 1405 | .BR include-globbing-filelist , | 1364 | .BR include-filelist , |
108 | 1406 | and | 1365 | and |
110 | 1407 | .B exclude-globbing-filelist | 1366 | .B exclude-filelist |
111 | 1408 | options accept some | 1367 | options accept some |
112 | 1409 | .IR "extended shell globbing patterns" . | 1368 | .IR "extended shell globbing patterns" . |
113 | 1410 | These patterns can contain | 1369 | These patterns can contain |
114 | @@ -1493,34 +1452,18 @@ | |||
115 | 1493 | 1452 | ||
116 | 1494 | The | 1453 | The |
117 | 1495 | .BR --include-filelist , | 1454 | .BR --include-filelist , |
118 | 1496 | .BR --exclude-filelist , | ||
119 | 1497 | .BR --include-filelist-stdin , | ||
120 | 1498 | and | 1455 | and |
122 | 1499 | .BI --exclude-filelist-stdin | 1456 | .BI --exclude-filelist , |
123 | 1500 | options also introduce file selection conditions. They direct | 1457 | options also introduce file selection conditions. They direct |
124 | 1501 | duplicity to read in a file, each line of which is a file | 1458 | duplicity to read in a file, each line of which is a file |
125 | 1502 | specification, and to include or exclude the matching files. Lines | 1459 | specification, and to include or exclude the matching files. Lines |
126 | 1503 | are separated by newlines or nulls, depending on whether the | 1460 | are separated by newlines or nulls, depending on whether the |
137 | 1504 | --null-separator switch was given. Each line in a filelist is | 1461 | --null-separator switch was given. Each line in the filelist will be |
138 | 1505 | interpreted similarly to the way | 1462 | interpreted as a globbing pattern the way |
139 | 1506 | .I extended shell patterns | 1463 | .BI --include |
130 | 1507 | are, with a few exceptions: | ||
131 | 1508 | .PP | ||
132 | 1509 | .B 1. | ||
133 | 1510 | Globbing patterns like | ||
134 | 1511 | .BR * , | ||
135 | 1512 | .BR ** , | ||
136 | 1513 | .BR ? , | ||
140 | 1514 | and | 1464 | and |
150 | 1515 | .B [...] | 1465 | .BI --exclude |
151 | 1516 | are not expanded. | 1466 | options are interpreted, except that lines starting with "+ " are interpreted as include directives, even |
143 | 1517 | .br | ||
144 | 1518 | .B 2. | ||
145 | 1519 | Include patterns do not match files in a directory that is included. | ||
146 | 1520 | So /usr/local in an include file will not match /usr/local/doc. | ||
147 | 1521 | .br | ||
148 | 1522 | .B 3. | ||
149 | 1523 | Lines starting with "+ " are interpreted as include directives, even | ||
152 | 1524 | if found in a filelist referenced by | 1467 | if found in a filelist referenced by |
153 | 1525 | .BR --exclude-filelist . | 1468 | .BR --exclude-filelist . |
154 | 1526 | Similarly, lines starting with "- " exclude files even if they are | 1469 | Similarly, lines starting with "- " exclude files even if they are |
155 | @@ -1544,23 +1487,18 @@ | |||
156 | 1544 | .B "--include-filelist list.txt" | 1487 | .B "--include-filelist list.txt" |
157 | 1545 | would include /usr, /usr/local, and | 1488 | would include /usr, /usr/local, and |
158 | 1546 | /usr/local/bin. It would exclude /usr/local/doc, | 1489 | /usr/local/bin. It would exclude /usr/local/doc, |
162 | 1547 | /usr/local/doc/python, etc. It neither excludes nor includes | 1490 | /usr/local/doc/python, etc. It would also include |
163 | 1548 | /usr/local/man, leaving the fate of this directory to the next | 1491 | /usr/local/man, as this is included within /user/local. Finally, it is undefined what happens with |
161 | 1549 | specification condition. Finally, it is undefined what happens with | ||
164 | 1550 | /var. A single file list should not contain conflicting file | 1492 | /var. A single file list should not contain conflicting file |
165 | 1551 | specifications. | 1493 | specifications. |
166 | 1552 | 1494 | ||
172 | 1553 | The | 1495 | Each line in the filelist will also be |
168 | 1554 | .BI --include-globbing-filelist | ||
169 | 1555 | and | ||
170 | 1556 | .BI --exclude-globbing-filelist | ||
171 | 1557 | options also specify filelists, but each line in the filelist will be | ||
173 | 1558 | interpreted as a globbing pattern the way | 1496 | interpreted as a globbing pattern the way |
174 | 1559 | .BI --include | 1497 | .BI --include |
175 | 1560 | and | 1498 | and |
176 | 1561 | .BI --exclude | 1499 | .BI --exclude |
179 | 1562 | options are interpreted (although "+ " and "- " prefixing is still | 1500 | options are interpreted. |
180 | 1563 | allowed). For instance, if the file "globbing-list.txt" contains the | 1501 | For instance, if the file "list.txt" contains the |
181 | 1564 | lines: | 1502 | lines: |
182 | 1565 | 1503 | ||
183 | 1566 | .RS | 1504 | .RS |
184 | @@ -1572,7 +1510,7 @@ | |||
185 | 1572 | .RE | 1510 | .RE |
186 | 1573 | 1511 | ||
187 | 1574 | Then | 1512 | Then |
189 | 1575 | .B "--include-globbing-filelist globbing-list.txt" | 1513 | .B "--include-filelist list.txt" |
190 | 1576 | would be exactly the same as specifying | 1514 | would be exactly the same as specifying |
191 | 1577 | .B "--include dir/foo --include dir/bar --exclude **" | 1515 | .B "--include dir/foo --include dir/bar --exclude **" |
192 | 1578 | on the command line. | 1516 | on the command line. |
193 | 1579 | 1517 | ||
194 | === modified file 'duplicity/commandline.py' | |||
195 | --- duplicity/commandline.py 2015-01-31 23:30:49 +0000 | |||
196 | +++ duplicity/commandline.py 2015-03-12 21:50:57 +0000 | |||
197 | @@ -73,6 +73,21 @@ | |||
198 | 73 | "Use of default filenames is strongly suggested.") % opt, | 73 | "Use of default filenames is strongly suggested.") % opt, |
199 | 74 | log.ERROR, force_print=True) | 74 | log.ERROR, force_print=True) |
200 | 75 | 75 | ||
201 | 76 | def old_globbing_filelist_deprecation(opt): | ||
202 | 77 | log.Log(_("Warning: Option %s is pending deprecation and will be removed in a future release.\n" | ||
203 | 78 | "--include-filelist and --exclude-filelist now accept globbing characters and should " | ||
204 | 79 | "be used instead.") % opt, | ||
205 | 80 | log.ERROR, force_print=True) | ||
206 | 81 | |||
207 | 82 | def stdin_deprecation(opt): | ||
208 | 83 | # See https://bugs.launchpad.net/duplicity/+bug/1423367 | ||
209 | 84 | # In almost all Linux distros stdin is a file represented by /dev/stdin, | ||
210 | 85 | # so --exclude-file=/dev/stdin will work as a substitute. | ||
211 | 86 | log.Log(_("Warning: Option %s is pending deprecation and will be removed in a future release.\n" | ||
212 | 87 | "On many GNU/Linux systems, stdin is represented by /dev/stdin and\n" | ||
213 | 88 | "--include-filelist=/dev/stdin or --exclude-filelist=/dev/stdin could\n" | ||
214 | 89 | "be used as a substitute.") % opt, | ||
215 | 90 | log.ERROR, force_print=True) | ||
216 | 76 | 91 | ||
217 | 77 | def expand_fn(filename): | 92 | def expand_fn(filename): |
218 | 78 | return os.path.expanduser(os.path.expandvars(filename)) | 93 | return os.path.expanduser(os.path.expandvars(filename)) |
219 | @@ -307,10 +322,14 @@ | |||
220 | 307 | 322 | ||
221 | 308 | parser.add_option("--exclude-filelist-stdin", action="callback", dest="", | 323 | parser.add_option("--exclude-filelist-stdin", action="callback", dest="", |
222 | 309 | callback=lambda o, s, v, p: (select_opts.append(("--exclude-filelist", "standard input")), | 324 | callback=lambda o, s, v, p: (select_opts.append(("--exclude-filelist", "standard input")), |
224 | 310 | select_files.append(sys.stdin))) | 325 | select_files.append(sys.stdin), |
225 | 326 | stdin_deprecation(o)), | ||
226 | 327 | help=optparse.SUPPRESS_HELP) | ||
227 | 311 | 328 | ||
228 | 312 | parser.add_option("--exclude-globbing-filelist", type="file", metavar=_("filename"), | 329 | parser.add_option("--exclude-globbing-filelist", type="file", metavar=_("filename"), |
230 | 313 | dest="", action="callback", callback=add_filelist) | 330 | dest="", action="callback", callback=lambda o, s, v, p: (add_filelist(o, s, v, p), |
231 | 331 | old_globbing_filelist_deprecation(s)), | ||
232 | 332 | help=optparse.SUPPRESS_HELP) | ||
233 | 314 | 333 | ||
234 | 315 | # TRANSL: Used in usage help to represent the name of a file. Example: | 334 | # TRANSL: Used in usage help to represent the name of a file. Example: |
235 | 316 | # --log-file <filename> | 335 | # --log-file <filename> |
236 | @@ -409,9 +428,13 @@ | |||
237 | 409 | dest="", action="callback", callback=add_filelist) | 428 | dest="", action="callback", callback=add_filelist) |
238 | 410 | parser.add_option("--include-filelist-stdin", action="callback", dest="", | 429 | parser.add_option("--include-filelist-stdin", action="callback", dest="", |
239 | 411 | callback=lambda o, s, v, p: (select_opts.append(("--include-filelist", "standard input")), | 430 | callback=lambda o, s, v, p: (select_opts.append(("--include-filelist", "standard input")), |
241 | 412 | select_files.append(sys.stdin))) | 431 | select_files.append(sys.stdin), |
242 | 432 | stdin_deprecation(o)), | ||
243 | 433 | help=optparse.SUPPRESS_HELP) | ||
244 | 413 | parser.add_option("--include-globbing-filelist", type="file", metavar=_("filename"), | 434 | parser.add_option("--include-globbing-filelist", type="file", metavar=_("filename"), |
246 | 414 | dest="", action="callback", callback=add_filelist) | 435 | dest="", action="callback", callback=lambda o, s, v, p: (add_filelist(o, s, v, p), |
247 | 436 | old_globbing_filelist_deprecation(s)), | ||
248 | 437 | help=optparse.SUPPRESS_HELP) | ||
249 | 415 | parser.add_option("--include-regexp", metavar=_("regular_expression"), dest="", | 438 | parser.add_option("--include-regexp", metavar=_("regular_expression"), dest="", |
250 | 416 | type="string", action="callback", callback=add_selection) | 439 | type="string", action="callback", callback=add_selection) |
251 | 417 | 440 | ||
252 | 418 | 441 | ||
253 | === modified file 'duplicity/selection.py' | |||
254 | --- duplicity/selection.py 2015-01-31 23:30:49 +0000 | |||
255 | +++ duplicity/selection.py 2015-03-12 21:50:57 +0000 | |||
256 | @@ -102,6 +102,7 @@ | |||
257 | 102 | 102 | ||
258 | 103 | def set_iter(self): | 103 | def set_iter(self): |
259 | 104 | """Initialize generator, prepare to iterate.""" | 104 | """Initialize generator, prepare to iterate.""" |
260 | 105 | # Externally-accessed method | ||
261 | 105 | self.rootpath.setdata() # this may have changed since Select init | 106 | self.rootpath.setdata() # this may have changed since Select init |
262 | 106 | self.iter = self.Iterate(self.rootpath) | 107 | self.iter = self.Iterate(self.rootpath) |
263 | 107 | self.next = self.iter.next | 108 | self.next = self.iter.next |
264 | @@ -117,6 +118,7 @@ | |||
265 | 117 | scanning" bit. | 118 | scanning" bit. |
266 | 118 | 119 | ||
267 | 119 | """ | 120 | """ |
268 | 121 | # Only called by set_iter. Internal. | ||
269 | 120 | def error_handler(exc, path, filename): | 122 | def error_handler(exc, path, filename): |
270 | 121 | fullpath = os.path.join(path.name, filename) | 123 | fullpath = os.path.join(path.name, filename) |
271 | 122 | try: | 124 | try: |
272 | @@ -143,6 +145,7 @@ | |||
273 | 143 | and should be included iff something inside is included. | 145 | and should be included iff something inside is included. |
274 | 144 | 146 | ||
275 | 145 | """ | 147 | """ |
276 | 148 | # Only called by Iterate. Internal. | ||
277 | 146 | # todo: get around circular dependency issue by importing here | 149 | # todo: get around circular dependency issue by importing here |
278 | 147 | from duplicity import robust # @Reimport | 150 | from duplicity import robust # @Reimport |
279 | 148 | for filename in robust.listpath(path): | 151 | for filename in robust.listpath(path): |
280 | @@ -200,6 +203,7 @@ | |||
281 | 200 | 203 | ||
282 | 201 | def Select(self, path): | 204 | def Select(self, path): |
283 | 202 | """Run through the selection functions and return dominant val 0/1/2""" | 205 | """Run through the selection functions and return dominant val 0/1/2""" |
284 | 206 | # Only used by diryield and tests. Internal. | ||
285 | 203 | if not self.selection_functions: | 207 | if not self.selection_functions: |
286 | 204 | return 1 | 208 | return 1 |
287 | 205 | scan_pending = False | 209 | scan_pending = False |
288 | @@ -227,6 +231,7 @@ | |||
289 | 227 | (option-string, (additional argument, filelist_fp)). | 231 | (option-string, (additional argument, filelist_fp)). |
290 | 228 | 232 | ||
291 | 229 | """ | 233 | """ |
292 | 234 | # Called by commandline.py set_selection. External. | ||
293 | 230 | filelists_index = 0 | 235 | filelists_index = 0 |
294 | 231 | try: | 236 | try: |
295 | 232 | for opt, arg in argtuples: | 237 | for opt, arg in argtuples: |
296 | @@ -236,11 +241,9 @@ | |||
297 | 236 | self.add_selection_func(self.present_get_sf(arg, 0)) | 241 | self.add_selection_func(self.present_get_sf(arg, 0)) |
298 | 237 | elif opt == "--exclude-device-files": | 242 | elif opt == "--exclude-device-files": |
299 | 238 | self.add_selection_func(self.devfiles_get_sf()) | 243 | self.add_selection_func(self.devfiles_get_sf()) |
305 | 239 | elif opt == "--exclude-filelist": | 244 | elif (opt == "--exclude-filelist") or (opt == "--exclude-globbing-filelist"): |
306 | 240 | self.add_selection_func(self.filelist_get_sf( | 245 | # --exclude-globbing-filelist is now deprecated, as all filelists are globbing |
307 | 241 | filelists[filelists_index], 0, arg)) | 246 | # but keep this here for the short term for backwards-compatibility |
303 | 242 | filelists_index += 1 | ||
304 | 243 | elif opt == "--exclude-globbing-filelist": | ||
308 | 244 | for sf in self.filelist_globbing_get_sfs(filelists[filelists_index], 0, arg): | 247 | for sf in self.filelist_globbing_get_sfs(filelists[filelists_index], 0, arg): |
309 | 245 | self.add_selection_func(sf) | 248 | self.add_selection_func(sf) |
310 | 246 | filelists_index += 1 | 249 | filelists_index += 1 |
311 | @@ -252,11 +255,9 @@ | |||
312 | 252 | self.add_selection_func(self.exclude_older_get_sf(arg)) | 255 | self.add_selection_func(self.exclude_older_get_sf(arg)) |
313 | 253 | elif opt == "--include": | 256 | elif opt == "--include": |
314 | 254 | self.add_selection_func(self.glob_get_sf(arg, 1)) | 257 | self.add_selection_func(self.glob_get_sf(arg, 1)) |
320 | 255 | elif opt == "--include-filelist": | 258 | elif (opt == "--include-filelist") or (opt == "--include-globbing-filelist"): |
321 | 256 | self.add_selection_func(self.filelist_get_sf( | 259 | # --include-globbing-filelist is now deprecated, as all filelists are globbing |
322 | 257 | filelists[filelists_index], 1, arg)) | 260 | # but keep this here for the short term for backwards-compatibility |
318 | 258 | filelists_index += 1 | ||
319 | 259 | elif opt == "--include-globbing-filelist": | ||
323 | 260 | for sf in self.filelist_globbing_get_sfs(filelists[filelists_index], 1, arg): | 261 | for sf in self.filelist_globbing_get_sfs(filelists[filelists_index], 1, arg): |
324 | 261 | self.add_selection_func(sf) | 262 | self.add_selection_func(sf) |
325 | 262 | filelists_index += 1 | 263 | filelists_index += 1 |
326 | @@ -271,6 +272,7 @@ | |||
327 | 271 | 272 | ||
328 | 272 | def parse_catch_error(self, exc): | 273 | def parse_catch_error(self, exc): |
329 | 273 | """Deal with selection error exc""" | 274 | """Deal with selection error exc""" |
330 | 275 | # Internal, used by ParseArgs. | ||
331 | 274 | if isinstance(exc, FilePrefixError): | 276 | if isinstance(exc, FilePrefixError): |
332 | 275 | log.FatalError(_("""\ | 277 | log.FatalError(_("""\ |
333 | 276 | Fatal Error: The file specification | 278 | Fatal Error: The file specification |
334 | @@ -288,6 +290,7 @@ | |||
335 | 288 | 290 | ||
336 | 289 | def parse_last_excludes(self): | 291 | def parse_last_excludes(self): |
337 | 290 | """Exit with error if last selection function isn't an exclude""" | 292 | """Exit with error if last selection function isn't an exclude""" |
338 | 293 | # Internal. Used by ParseArgs. | ||
339 | 291 | if (self.selection_functions and | 294 | if (self.selection_functions and |
340 | 292 | not self.selection_functions[-1].exclude): | 295 | not self.selection_functions[-1].exclude): |
341 | 293 | log.FatalError(_("""\ | 296 | log.FatalError(_("""\ |
342 | @@ -301,76 +304,12 @@ | |||
343 | 301 | 304 | ||
344 | 302 | def add_selection_func(self, sel_func, add_to_start=None): | 305 | def add_selection_func(self, sel_func, add_to_start=None): |
345 | 303 | """Add another selection function at the end or beginning""" | 306 | """Add another selection function at the end or beginning""" |
346 | 307 | # Internal. Used by ParseArgs. | ||
347 | 304 | if add_to_start: | 308 | if add_to_start: |
348 | 305 | self.selection_functions.insert(0, sel_func) | 309 | self.selection_functions.insert(0, sel_func) |
349 | 306 | else: | 310 | else: |
350 | 307 | self.selection_functions.append(sel_func) | 311 | self.selection_functions.append(sel_func) |
351 | 308 | 312 | ||
352 | 309 | def filelist_get_sf(self, filelist_fp, inc_default, filelist_name): | ||
353 | 310 | """Return selection function by reading list of files | ||
354 | 311 | |||
355 | 312 | The format of the filelist is documented in the man page. | ||
356 | 313 | filelist_fp should be an (open) file object. | ||
357 | 314 | inc_default should be true if this is an include list, | ||
358 | 315 | false for an exclude list. | ||
359 | 316 | filelist_name is just a string used for logging. | ||
360 | 317 | |||
361 | 318 | """ | ||
362 | 319 | log.Notice(_("Reading filelist %s") % filelist_name) | ||
363 | 320 | tuple_list, something_excluded = \ | ||
364 | 321 | self.filelist_read(filelist_fp, inc_default, filelist_name) | ||
365 | 322 | log.Notice(_("Sorting filelist %s") % filelist_name) | ||
366 | 323 | tuple_list.sort() | ||
367 | 324 | i = [0] # We have to put index in list because of stupid scoping rules | ||
368 | 325 | |||
369 | 326 | def selection_function(path): | ||
370 | 327 | while 1: | ||
371 | 328 | if i[0] >= len(tuple_list): | ||
372 | 329 | return None | ||
373 | 330 | include, move_on = \ | ||
374 | 331 | self.filelist_pair_match(path, tuple_list[i[0]]) | ||
375 | 332 | if move_on: | ||
376 | 333 | i[0] += 1 | ||
377 | 334 | if include is None: | ||
378 | 335 | continue # later line may match | ||
379 | 336 | return include | ||
380 | 337 | |||
381 | 338 | selection_function.exclude = something_excluded or inc_default == 0 | ||
382 | 339 | selection_function.name = "Filelist: " + filelist_name | ||
383 | 340 | return selection_function | ||
384 | 341 | |||
385 | 342 | def filelist_read(self, filelist_fp, include, filelist_name): | ||
386 | 343 | """Read filelist from fp, return (tuplelist, something_excluded)""" | ||
387 | 344 | prefix_warnings = [0] | ||
388 | 345 | |||
389 | 346 | def incr_warnings(exc): | ||
390 | 347 | """Warn if prefix is incorrect""" | ||
391 | 348 | prefix_warnings[0] += 1 | ||
392 | 349 | if prefix_warnings[0] < 6: | ||
393 | 350 | log.Warn(_("Warning: file specification '%s' in filelist %s\n" | ||
394 | 351 | "doesn't start with correct prefix %s. Ignoring.") % | ||
395 | 352 | (exc, filelist_name, util.ufn(self.prefix))) | ||
396 | 353 | if prefix_warnings[0] == 5: | ||
397 | 354 | log.Warn(_("Future prefix errors will not be logged.")) | ||
398 | 355 | |||
399 | 356 | something_excluded, tuple_list = None, [] | ||
400 | 357 | separator = globals.null_separator and "\0" or "\n" | ||
401 | 358 | for line in filelist_fp.read().split(separator): | ||
402 | 359 | try: | ||
403 | 360 | tuple = self.filelist_parse_line(line, include) | ||
404 | 361 | except FilePrefixError as exc: | ||
405 | 362 | incr_warnings(exc) | ||
406 | 363 | continue | ||
407 | 364 | if not tuple: | ||
408 | 365 | # Skip blanks/full-line comments | ||
409 | 366 | continue | ||
410 | 367 | else: | ||
411 | 368 | tuple_list.append(tuple) | ||
412 | 369 | if not tuple[1]: | ||
413 | 370 | something_excluded = 1 | ||
414 | 371 | if filelist_fp not in (sys.stdin,) and filelist_fp.close(): | ||
415 | 372 | log.Warn(_("Error closing filelist %s") % filelist_name) | ||
416 | 373 | return (tuple_list, something_excluded) | ||
417 | 374 | 313 | ||
418 | 375 | def filelist_sanitise_line(self, line, include_default): | 314 | def filelist_sanitise_line(self, line, include_default): |
419 | 376 | """ | 315 | """ |
420 | @@ -379,6 +318,7 @@ | |||
421 | 379 | The aim is to parse filelists in a consistent way, prior to the interpretation of globbing statements. | 318 | The aim is to parse filelists in a consistent way, prior to the interpretation of globbing statements. |
422 | 380 | The function removes whitespace, comment lines and processes modifiers (leading +/-) and quotes. | 319 | The function removes whitespace, comment lines and processes modifiers (leading +/-) and quotes. |
423 | 381 | """ | 320 | """ |
424 | 321 | # Internal. Used by filelist_globbing_get_sfs | ||
425 | 382 | 322 | ||
426 | 383 | line = line.strip() | 323 | line = line.strip() |
427 | 384 | if not line: # skip blanks | 324 | if not line: # skip blanks |
428 | @@ -400,59 +340,6 @@ | |||
429 | 400 | 340 | ||
430 | 401 | return line, include | 341 | return line, include |
431 | 402 | 342 | ||
432 | 403 | def filelist_parse_line(self, line, include): | ||
433 | 404 | """Parse a single line of a filelist, returning a pair or None if the line is blank/a comment | ||
434 | 405 | |||
435 | 406 | Pair will be of form (index, include), where index is another | ||
436 | 407 | tuple, and include is 1 if the line specifies that we are | ||
437 | 408 | including a file. The default is given as an argument. | ||
438 | 409 | prefix is the string that the index is relative to. | ||
439 | 410 | |||
440 | 411 | """ | ||
441 | 412 | |||
442 | 413 | line, include = self.filelist_sanitise_line(line, include) | ||
443 | 414 | |||
444 | 415 | if not line: | ||
445 | 416 | # Skip blanks and comments | ||
446 | 417 | return None | ||
447 | 418 | |||
448 | 419 | if not line.startswith(self.prefix): | ||
449 | 420 | raise FilePrefixError(line) | ||
450 | 421 | line = line[len(self.prefix):] # Discard prefix | ||
451 | 422 | index = tuple(filter(lambda x: x, line.split("/"))) # remove empties | ||
452 | 423 | return (index, include) | ||
453 | 424 | |||
454 | 425 | def filelist_pair_match(self, path, pair): | ||
455 | 426 | """Matches a filelist tuple against a path | ||
456 | 427 | |||
457 | 428 | Returns a pair (include, move_on). include is None if the | ||
458 | 429 | tuple doesn't match either way, and 0/1 if the tuple excludes | ||
459 | 430 | or includes the path. | ||
460 | 431 | |||
461 | 432 | move_on is true if the tuple cannot match a later index, and | ||
462 | 433 | so we should move on to the next tuple in the index. | ||
463 | 434 | |||
464 | 435 | """ | ||
465 | 436 | index, include = pair | ||
466 | 437 | if include == 1: | ||
467 | 438 | if index < path.index: | ||
468 | 439 | return (None, True) | ||
469 | 440 | if index == path.index: | ||
470 | 441 | return (1, True) | ||
471 | 442 | elif index[:len(path.index)] == path.index: | ||
472 | 443 | return (1, False) # /foo/bar implicitly includes /foo | ||
473 | 444 | else: | ||
474 | 445 | return (None, False) # path greater, not initial sequence | ||
475 | 446 | elif include == 0: | ||
476 | 447 | if path.index[:len(index)] == index: | ||
477 | 448 | return (0, False) # /foo implicitly excludes /foo/bar | ||
478 | 449 | elif index < path.index: | ||
479 | 450 | return (None, True) | ||
480 | 451 | else: | ||
481 | 452 | return (None, False) # path greater, not initial sequence | ||
482 | 453 | else: | ||
483 | 454 | assert 0, "Include is %s, should be 0 or 1" % (include,) | ||
484 | 455 | |||
485 | 456 | def filelist_globbing_get_sfs(self, filelist_fp, inc_default, list_name): | 343 | def filelist_globbing_get_sfs(self, filelist_fp, inc_default, list_name): |
486 | 457 | """Return list of selection functions by reading fileobj | 344 | """Return list of selection functions by reading fileobj |
487 | 458 | 345 | ||
488 | @@ -462,6 +349,7 @@ | |||
489 | 462 | See the man page on --[include/exclude]-globbing-filelist | 349 | See the man page on --[include/exclude]-globbing-filelist |
490 | 463 | 350 | ||
491 | 464 | """ | 351 | """ |
492 | 352 | # Internal. Used by ParseArgs. | ||
493 | 465 | log.Notice(_("Reading globbing filelist %s") % list_name) | 353 | log.Notice(_("Reading globbing filelist %s") % list_name) |
494 | 466 | separator = globals.null_separator and "\0" or "\n" | 354 | separator = globals.null_separator and "\0" or "\n" |
495 | 467 | for line in filelist_fp.read().split(separator): | 355 | for line in filelist_fp.read().split(separator): |
496 | @@ -473,6 +361,7 @@ | |||
497 | 473 | 361 | ||
498 | 474 | def other_filesystems_get_sf(self, include): | 362 | def other_filesystems_get_sf(self, include): |
499 | 475 | """Return selection function matching files on other filesystems""" | 363 | """Return selection function matching files on other filesystems""" |
500 | 364 | # Internal. Used by ParseArgs and unit tests. | ||
501 | 476 | assert include == 0 or include == 1 | 365 | assert include == 0 or include == 1 |
502 | 477 | root_devloc = self.rootpath.getdevloc() | 366 | root_devloc = self.rootpath.getdevloc() |
503 | 478 | 367 | ||
504 | @@ -488,6 +377,7 @@ | |||
505 | 488 | 377 | ||
506 | 489 | def regexp_get_sf(self, regexp_string, include): | 378 | def regexp_get_sf(self, regexp_string, include): |
507 | 490 | """Return selection function given by regexp_string""" | 379 | """Return selection function given by regexp_string""" |
508 | 380 | # Internal. Used by ParseArgs and unit tests. | ||
509 | 491 | assert include == 0 or include == 1 | 381 | assert include == 0 or include == 1 |
510 | 492 | try: | 382 | try: |
511 | 493 | regexp = re.compile(regexp_string) | 383 | regexp = re.compile(regexp_string) |
512 | @@ -507,6 +397,7 @@ | |||
513 | 507 | 397 | ||
514 | 508 | def devfiles_get_sf(self): | 398 | def devfiles_get_sf(self): |
515 | 509 | """Return a selection function to exclude all dev files""" | 399 | """Return a selection function to exclude all dev files""" |
516 | 400 | # Internal. Used by ParseArgs. | ||
517 | 510 | if self.selection_functions: | 401 | if self.selection_functions: |
518 | 511 | log.Warn(_("Warning: exclude-device-files is not the first " | 402 | log.Warn(_("Warning: exclude-device-files is not the first " |
519 | 512 | "selector.\nThis may not be what you intended")) | 403 | "selector.\nThis may not be what you intended")) |
520 | @@ -523,6 +414,7 @@ | |||
521 | 523 | 414 | ||
522 | 524 | def glob_get_sf(self, glob_str, include): | 415 | def glob_get_sf(self, glob_str, include): |
523 | 525 | """Return selection function given by glob string""" | 416 | """Return selection function given by glob string""" |
524 | 417 | # Internal. Used by ParseArgs, filelist_globbing_get_sfs and unit tests. | ||
525 | 526 | assert include == 0 or include == 1 | 418 | assert include == 0 or include == 1 |
526 | 527 | if glob_str == "**": | 419 | if glob_str == "**": |
527 | 528 | sel_func = lambda path: include | 420 | sel_func = lambda path: include |
528 | @@ -539,6 +431,7 @@ | |||
529 | 539 | 431 | ||
530 | 540 | def present_get_sf(self, filename, include): | 432 | def present_get_sf(self, filename, include): |
531 | 541 | """Return selection function given by existence of a file in a directory""" | 433 | """Return selection function given by existence of a file in a directory""" |
532 | 434 | # Internal. Used by ParseArgs. | ||
533 | 542 | assert include == 0 or include == 1 | 435 | assert include == 0 or include == 1 |
534 | 543 | 436 | ||
535 | 544 | def exclude_sel_func(path): | 437 | def exclude_sel_func(path): |
536 | @@ -572,6 +465,7 @@ | |||
537 | 572 | globbing characters are used. | 465 | globbing characters are used. |
538 | 573 | 466 | ||
539 | 574 | """ | 467 | """ |
540 | 468 | # Internal. Used by glob_get_sf and unit tests. | ||
541 | 575 | if not filename.startswith(self.prefix): | 469 | if not filename.startswith(self.prefix): |
542 | 576 | raise FilePrefixError(filename) | 470 | raise FilePrefixError(filename) |
543 | 577 | index = tuple(filter(lambda x: x, | 471 | index = tuple(filter(lambda x: x, |
544 | @@ -580,6 +474,7 @@ | |||
545 | 580 | 474 | ||
546 | 581 | def glob_get_tuple_sf(self, tuple, include): | 475 | def glob_get_tuple_sf(self, tuple, include): |
547 | 582 | """Return selection function based on tuple""" | 476 | """Return selection function based on tuple""" |
548 | 477 | # Internal. Used by glob_get_filename_sf. | ||
549 | 583 | def include_sel_func(path): | 478 | def include_sel_func(path): |
550 | 584 | if (path.index == tuple[:len(path.index)] or | 479 | if (path.index == tuple[:len(path.index)] or |
551 | 585 | path.index[:len(tuple)] == tuple): | 480 | path.index[:len(tuple)] == tuple): |
552 | @@ -616,6 +511,7 @@ | |||
553 | 616 | things similar to this. | 511 | things similar to this. |
554 | 617 | 512 | ||
555 | 618 | """ | 513 | """ |
556 | 514 | # Internal. Used by glob_get_sf and unit tests. | ||
557 | 619 | if glob_str.lower().startswith("ignorecase:"): | 515 | if glob_str.lower().startswith("ignorecase:"): |
558 | 620 | re_comp = lambda r: re.compile(r, re.I | re.S) | 516 | re_comp = lambda r: re.compile(r, re.I | re.S) |
559 | 621 | glob_str = glob_str[len("ignorecase:"):] | 517 | glob_str = glob_str[len("ignorecase:"):] |
560 | @@ -656,6 +552,7 @@ | |||
561 | 656 | 552 | ||
562 | 657 | def exclude_older_get_sf(self, date): | 553 | def exclude_older_get_sf(self, date): |
563 | 658 | """Return selection function based on files older than modification date """ | 554 | """Return selection function based on files older than modification date """ |
564 | 555 | # Internal. Used by ParseArgs. | ||
565 | 659 | 556 | ||
566 | 660 | def sel_func(path): | 557 | def sel_func(path): |
567 | 661 | if not path.isreg(): | 558 | if not path.isreg(): |
568 | @@ -673,6 +570,7 @@ | |||
569 | 673 | 570 | ||
570 | 674 | def glob_get_prefix_res(self, glob_str): | 571 | def glob_get_prefix_res(self, glob_str): |
571 | 675 | """Return list of regexps equivalent to prefixes of glob_str""" | 572 | """Return list of regexps equivalent to prefixes of glob_str""" |
572 | 573 | # Internal. Used by glob_get_normal_sf. | ||
573 | 676 | glob_parts = glob_str.split("/") | 574 | glob_parts = glob_str.split("/") |
574 | 677 | if "" in glob_parts[1:-1]: | 575 | if "" in glob_parts[1:-1]: |
575 | 678 | # "" OK if comes first or last, as in /foo/ | 576 | # "" OK if comes first or last, as in /foo/ |
576 | @@ -696,6 +594,7 @@ | |||
577 | 696 | by Donovan Baarda. | 594 | by Donovan Baarda. |
578 | 697 | 595 | ||
579 | 698 | """ | 596 | """ |
580 | 597 | # Internal. Used by glob_get_normal_sf, glob_get_prefix_res and unit tests. | ||
581 | 699 | i, n, res = 0, len(pat), '' | 598 | i, n, res = 0, len(pat), '' |
582 | 700 | while i < n: | 599 | while i < n: |
583 | 701 | c, s = pat[i], pat[i:i + 2] | 600 | c, s = pat[i], pat[i:i + 2] |
584 | 702 | 601 | ||
585 | === modified file 'po/duplicity.pot' | |||
586 | --- po/duplicity.pot 2015-03-11 12:27:42 +0000 | |||
587 | +++ po/duplicity.pot 2015-03-12 21:50:57 +0000 | |||
588 | @@ -8,7 +8,7 @@ | |||
589 | 8 | msgstr "" | 8 | msgstr "" |
590 | 9 | "Project-Id-Version: PACKAGE VERSION\n" | 9 | "Project-Id-Version: PACKAGE VERSION\n" |
591 | 10 | "Report-Msgid-Bugs-To: Kenneth Loafman <kenneth@loafman.com>\n" | 10 | "Report-Msgid-Bugs-To: Kenneth Loafman <kenneth@loafman.com>\n" |
593 | 11 | "POT-Creation-Date: 2015-03-11 07:21-0500\n" | 11 | "POT-Creation-Date: 2015-03-12 21:43+0000\n" |
594 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
595 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
596 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
597 | @@ -371,7 +371,7 @@ | |||
598 | 371 | msgid "Backend error detail: %s" | 371 | msgid "Backend error detail: %s" |
599 | 372 | msgstr "" | 372 | msgstr "" |
600 | 373 | 373 | ||
602 | 374 | #: ../bin/rdiffdir:61 ../duplicity/commandline.py:241 | 374 | #: ../bin/rdiffdir:61 ../duplicity/commandline.py:256 |
603 | 375 | #, python-format | 375 | #, python-format |
604 | 376 | msgid "Error opening file %s" | 376 | msgid "Error opening file %s" |
605 | 377 | msgstr "" | 377 | msgstr "" |
606 | @@ -693,11 +693,30 @@ | |||
607 | 693 | "Use of default filenames is strongly suggested." | 693 | "Use of default filenames is strongly suggested." |
608 | 694 | msgstr "" | 694 | msgstr "" |
609 | 695 | 695 | ||
610 | 696 | #: ../duplicity/commandline.py:77 | ||
611 | 697 | #, python-format | ||
612 | 698 | msgid "" | ||
613 | 699 | "Warning: Option %s is pending deprecation and will be removed in a future " | ||
614 | 700 | "release.\n" | ||
615 | 701 | "--include-filelist and --exclude-filelist now accept globbing characters and " | ||
616 | 702 | "should be used instead." | ||
617 | 703 | msgstr "" | ||
618 | 704 | |||
619 | 705 | #: ../duplicity/commandline.py:86 | ||
620 | 706 | #, python-format | ||
621 | 707 | msgid "" | ||
622 | 708 | "Warning: Option %s is pending deprecation and will be removed in a future " | ||
623 | 709 | "release.\n" | ||
624 | 710 | "On many GNU/Linux systems, stdin is represented by /dev/stdin and\n" | ||
625 | 711 | "--include-filelist=/dev/stdin or --exclude-filelist=/dev/stdin could\n" | ||
626 | 712 | "be used as a substitute." | ||
627 | 713 | msgstr "" | ||
628 | 714 | |||
629 | 696 | #. Used in usage help to represent a Unix-style path name. Example: | 715 | #. Used in usage help to represent a Unix-style path name. Example: |
630 | 697 | #. --archive-dir <path> | 716 | #. --archive-dir <path> |
634 | 698 | #: ../duplicity/commandline.py:262 ../duplicity/commandline.py:272 | 717 | #: ../duplicity/commandline.py:277 ../duplicity/commandline.py:287 |
635 | 699 | #: ../duplicity/commandline.py:289 ../duplicity/commandline.py:359 | 718 | #: ../duplicity/commandline.py:304 ../duplicity/commandline.py:378 |
636 | 700 | #: ../duplicity/commandline.py:560 ../duplicity/commandline.py:774 | 719 | #: ../duplicity/commandline.py:583 ../duplicity/commandline.py:797 |
637 | 701 | msgid "path" | 720 | msgid "path" |
638 | 702 | msgstr "" | 721 | msgstr "" |
639 | 703 | 722 | ||
640 | @@ -707,9 +726,9 @@ | |||
641 | 707 | #. --hidden-encrypt-key <gpg_key_id> | 726 | #. --hidden-encrypt-key <gpg_key_id> |
642 | 708 | #. Used in usage help to represent an ID for a GnuPG key. Example: | 727 | #. Used in usage help to represent an ID for a GnuPG key. Example: |
643 | 709 | #. --encrypt-key <gpg_key_id> | 728 | #. --encrypt-key <gpg_key_id> |
647 | 710 | #: ../duplicity/commandline.py:284 ../duplicity/commandline.py:291 | 729 | #: ../duplicity/commandline.py:299 ../duplicity/commandline.py:306 |
648 | 711 | #: ../duplicity/commandline.py:381 ../duplicity/commandline.py:544 | 730 | #: ../duplicity/commandline.py:400 ../duplicity/commandline.py:567 |
649 | 712 | #: ../duplicity/commandline.py:747 | 731 | #: ../duplicity/commandline.py:770 |
650 | 713 | msgid "gpg-key-id" | 732 | msgid "gpg-key-id" |
651 | 714 | msgstr "" | 733 | msgstr "" |
652 | 715 | 734 | ||
653 | @@ -717,43 +736,43 @@ | |||
654 | 717 | #. matching one or more files, as described in the documentation. | 736 | #. matching one or more files, as described in the documentation. |
655 | 718 | #. Example: | 737 | #. Example: |
656 | 719 | #. --exclude <shell_pattern> | 738 | #. --exclude <shell_pattern> |
659 | 720 | #: ../duplicity/commandline.py:299 ../duplicity/commandline.py:406 | 739 | #: ../duplicity/commandline.py:314 ../duplicity/commandline.py:425 |
660 | 721 | #: ../duplicity/commandline.py:797 | 740 | #: ../duplicity/commandline.py:820 |
661 | 722 | msgid "shell_pattern" | 741 | msgid "shell_pattern" |
662 | 723 | msgstr "" | 742 | msgstr "" |
663 | 724 | 743 | ||
664 | 725 | #. Used in usage help to represent the name of a file. Example: | 744 | #. Used in usage help to represent the name of a file. Example: |
665 | 726 | #. --log-file <filename> | 745 | #. --log-file <filename> |
670 | 727 | #: ../duplicity/commandline.py:305 ../duplicity/commandline.py:312 | 746 | #: ../duplicity/commandline.py:320 ../duplicity/commandline.py:329 |
671 | 728 | #: ../duplicity/commandline.py:317 ../duplicity/commandline.py:408 | 747 | #: ../duplicity/commandline.py:336 ../duplicity/commandline.py:427 |
672 | 729 | #: ../duplicity/commandline.py:413 ../duplicity/commandline.py:424 | 748 | #: ../duplicity/commandline.py:434 ../duplicity/commandline.py:447 |
673 | 730 | #: ../duplicity/commandline.py:743 | 749 | #: ../duplicity/commandline.py:766 |
674 | 731 | msgid "filename" | 750 | msgid "filename" |
675 | 732 | msgstr "" | 751 | msgstr "" |
676 | 733 | 752 | ||
677 | 734 | #. Used in usage help to represent a regular expression (regexp). | 753 | #. Used in usage help to represent a regular expression (regexp). |
679 | 735 | #: ../duplicity/commandline.py:324 ../duplicity/commandline.py:415 | 754 | #: ../duplicity/commandline.py:343 ../duplicity/commandline.py:438 |
680 | 736 | msgid "regular_expression" | 755 | msgid "regular_expression" |
681 | 737 | msgstr "" | 756 | msgstr "" |
682 | 738 | 757 | ||
683 | 739 | #. Used in usage help to represent a time spec for a previous | 758 | #. Used in usage help to represent a time spec for a previous |
684 | 740 | #. point in time, as described in the documentation. Example: | 759 | #. point in time, as described in the documentation. Example: |
685 | 741 | #. duplicity remove-older-than time [options] target_url | 760 | #. duplicity remove-older-than time [options] target_url |
688 | 742 | #: ../duplicity/commandline.py:328 ../duplicity/commandline.py:371 | 761 | #: ../duplicity/commandline.py:347 ../duplicity/commandline.py:390 |
689 | 743 | #: ../duplicity/commandline.py:486 ../duplicity/commandline.py:829 | 762 | #: ../duplicity/commandline.py:509 ../duplicity/commandline.py:852 |
690 | 744 | msgid "time" | 763 | msgid "time" |
691 | 745 | msgstr "" | 764 | msgstr "" |
692 | 746 | 765 | ||
693 | 747 | #. Used in usage help. (Should be consistent with the "Options:" | 766 | #. Used in usage help. (Should be consistent with the "Options:" |
694 | 748 | #. header.) Example: | 767 | #. header.) Example: |
695 | 749 | #. duplicity [full|incremental] [options] source_dir target_url | 768 | #. duplicity [full|incremental] [options] source_dir target_url |
699 | 750 | #: ../duplicity/commandline.py:377 ../duplicity/commandline.py:466 | 769 | #: ../duplicity/commandline.py:396 ../duplicity/commandline.py:489 |
700 | 751 | #: ../duplicity/commandline.py:489 ../duplicity/commandline.py:552 | 770 | #: ../duplicity/commandline.py:512 ../duplicity/commandline.py:575 |
701 | 752 | #: ../duplicity/commandline.py:762 | 771 | #: ../duplicity/commandline.py:785 |
702 | 753 | msgid "options" | 772 | msgid "options" |
703 | 754 | msgstr "" | 773 | msgstr "" |
704 | 755 | 774 | ||
706 | 756 | #: ../duplicity/commandline.py:392 | 775 | #: ../duplicity/commandline.py:411 |
707 | 757 | #, python-format | 776 | #, python-format |
708 | 758 | msgid "" | 777 | msgid "" |
709 | 759 | "Running in 'ignore errors' mode due to %s; please re-consider if this was " | 778 | "Running in 'ignore errors' mode due to %s; please re-consider if this was " |
710 | @@ -761,152 +780,152 @@ | |||
711 | 761 | msgstr "" | 780 | msgstr "" |
712 | 762 | 781 | ||
713 | 763 | #. Used in usage help to represent an imap mailbox | 782 | #. Used in usage help to represent an imap mailbox |
715 | 764 | #: ../duplicity/commandline.py:404 | 783 | #: ../duplicity/commandline.py:423 |
716 | 765 | msgid "imap_mailbox" | 784 | msgid "imap_mailbox" |
717 | 766 | msgstr "" | 785 | msgstr "" |
718 | 767 | 786 | ||
720 | 768 | #: ../duplicity/commandline.py:418 | 787 | #: ../duplicity/commandline.py:441 |
721 | 769 | msgid "file_descriptor" | 788 | msgid "file_descriptor" |
722 | 770 | msgstr "" | 789 | msgstr "" |
723 | 771 | 790 | ||
724 | 772 | #. Used in usage help to represent a desired number of | 791 | #. Used in usage help to represent a desired number of |
725 | 773 | #. something. Example: | 792 | #. something. Example: |
726 | 774 | #. --num-retries <number> | 793 | #. --num-retries <number> |
732 | 775 | #: ../duplicity/commandline.py:429 ../duplicity/commandline.py:451 | 794 | #: ../duplicity/commandline.py:452 ../duplicity/commandline.py:474 |
733 | 776 | #: ../duplicity/commandline.py:463 ../duplicity/commandline.py:472 | 795 | #: ../duplicity/commandline.py:486 ../duplicity/commandline.py:495 |
734 | 777 | #: ../duplicity/commandline.py:510 ../duplicity/commandline.py:515 | 796 | #: ../duplicity/commandline.py:533 ../duplicity/commandline.py:538 |
735 | 778 | #: ../duplicity/commandline.py:519 ../duplicity/commandline.py:588 | 797 | #: ../duplicity/commandline.py:542 ../duplicity/commandline.py:611 |
736 | 779 | #: ../duplicity/commandline.py:757 | 798 | #: ../duplicity/commandline.py:780 |
737 | 780 | msgid "number" | 799 | msgid "number" |
738 | 781 | msgstr "" | 800 | msgstr "" |
739 | 782 | 801 | ||
740 | 783 | #. Used in usage help (noun) | 802 | #. Used in usage help (noun) |
742 | 784 | #: ../duplicity/commandline.py:432 | 803 | #: ../duplicity/commandline.py:455 |
743 | 785 | msgid "backup name" | 804 | msgid "backup name" |
744 | 786 | msgstr "" | 805 | msgstr "" |
745 | 787 | 806 | ||
746 | 788 | #. noun | 807 | #. noun |
749 | 789 | #: ../duplicity/commandline.py:528 ../duplicity/commandline.py:531 | 808 | #: ../duplicity/commandline.py:551 ../duplicity/commandline.py:554 |
750 | 790 | #: ../duplicity/commandline.py:728 | 809 | #: ../duplicity/commandline.py:751 |
751 | 791 | msgid "command" | 810 | msgid "command" |
752 | 792 | msgstr "" | 811 | msgstr "" |
753 | 793 | 812 | ||
755 | 794 | #: ../duplicity/commandline.py:534 | 813 | #: ../duplicity/commandline.py:557 |
756 | 795 | msgid "pyrax|cloudfiles" | 814 | msgid "pyrax|cloudfiles" |
757 | 796 | msgstr "" | 815 | msgstr "" |
758 | 797 | 816 | ||
760 | 798 | #: ../duplicity/commandline.py:555 | 817 | #: ../duplicity/commandline.py:578 |
761 | 799 | msgid "pem formatted bundle of certificate authorities" | 818 | msgid "pem formatted bundle of certificate authorities" |
762 | 800 | msgstr "" | 819 | msgstr "" |
763 | 801 | 820 | ||
764 | 802 | #. Used in usage help. Example: | 821 | #. Used in usage help. Example: |
765 | 803 | #. --timeout <seconds> | 822 | #. --timeout <seconds> |
767 | 804 | #: ../duplicity/commandline.py:565 ../duplicity/commandline.py:791 | 823 | #: ../duplicity/commandline.py:588 ../duplicity/commandline.py:814 |
768 | 805 | msgid "seconds" | 824 | msgid "seconds" |
769 | 806 | msgstr "" | 825 | msgstr "" |
770 | 807 | 826 | ||
771 | 808 | #. abbreviation for "character" (noun) | 827 | #. abbreviation for "character" (noun) |
773 | 809 | #: ../duplicity/commandline.py:571 ../duplicity/commandline.py:725 | 828 | #: ../duplicity/commandline.py:594 ../duplicity/commandline.py:748 |
774 | 810 | msgid "char" | 829 | msgid "char" |
775 | 811 | msgstr "" | 830 | msgstr "" |
776 | 812 | 831 | ||
778 | 813 | #: ../duplicity/commandline.py:691 | 832 | #: ../duplicity/commandline.py:714 |
779 | 814 | #, python-format | 833 | #, python-format |
780 | 815 | msgid "Using archive dir: %s" | 834 | msgid "Using archive dir: %s" |
781 | 816 | msgstr "" | 835 | msgstr "" |
782 | 817 | 836 | ||
784 | 818 | #: ../duplicity/commandline.py:692 | 837 | #: ../duplicity/commandline.py:715 |
785 | 819 | #, python-format | 838 | #, python-format |
786 | 820 | msgid "Using backup name: %s" | 839 | msgid "Using backup name: %s" |
787 | 821 | msgstr "" | 840 | msgstr "" |
788 | 822 | 841 | ||
790 | 823 | #: ../duplicity/commandline.py:699 | 842 | #: ../duplicity/commandline.py:722 |
791 | 824 | #, python-format | 843 | #, python-format |
792 | 825 | msgid "Command line error: %s" | 844 | msgid "Command line error: %s" |
793 | 826 | msgstr "" | 845 | msgstr "" |
794 | 827 | 846 | ||
796 | 828 | #: ../duplicity/commandline.py:700 | 847 | #: ../duplicity/commandline.py:723 |
797 | 829 | msgid "Enter 'duplicity --help' for help screen." | 848 | msgid "Enter 'duplicity --help' for help screen." |
798 | 830 | msgstr "" | 849 | msgstr "" |
799 | 831 | 850 | ||
800 | 832 | #. Used in usage help to represent a Unix-style path name. Example: | 851 | #. Used in usage help to represent a Unix-style path name. Example: |
801 | 833 | #. rsync://user[:password]@other_host[:port]//absolute_path | 852 | #. rsync://user[:password]@other_host[:port]//absolute_path |
803 | 834 | #: ../duplicity/commandline.py:713 | 853 | #: ../duplicity/commandline.py:736 |
804 | 835 | msgid "absolute_path" | 854 | msgid "absolute_path" |
805 | 836 | msgstr "" | 855 | msgstr "" |
806 | 837 | 856 | ||
807 | 838 | #. Used in usage help. Example: | 857 | #. Used in usage help. Example: |
808 | 839 | #. tahoe://alias/some_dir | 858 | #. tahoe://alias/some_dir |
810 | 840 | #: ../duplicity/commandline.py:717 | 859 | #: ../duplicity/commandline.py:740 |
811 | 841 | msgid "alias" | 860 | msgid "alias" |
812 | 842 | msgstr "" | 861 | msgstr "" |
813 | 843 | 862 | ||
814 | 844 | #. Used in help to represent a "bucket name" for Amazon Web | 863 | #. Used in help to represent a "bucket name" for Amazon Web |
815 | 845 | #. Services' Simple Storage Service (S3). Example: | 864 | #. Services' Simple Storage Service (S3). Example: |
816 | 846 | #. s3://other.host/bucket_name[/prefix] | 865 | #. s3://other.host/bucket_name[/prefix] |
818 | 847 | #: ../duplicity/commandline.py:722 | 866 | #: ../duplicity/commandline.py:745 |
819 | 848 | msgid "bucket_name" | 867 | msgid "bucket_name" |
820 | 849 | msgstr "" | 868 | msgstr "" |
821 | 850 | 869 | ||
822 | 851 | #. Used in usage help to represent the name of a container in | 870 | #. Used in usage help to represent the name of a container in |
823 | 852 | #. Amazon Web Services' Cloudfront. Example: | 871 | #. Amazon Web Services' Cloudfront. Example: |
824 | 853 | #. cf+http://container_name | 872 | #. cf+http://container_name |
826 | 854 | #: ../duplicity/commandline.py:733 | 873 | #: ../duplicity/commandline.py:756 |
827 | 855 | msgid "container_name" | 874 | msgid "container_name" |
828 | 856 | msgstr "" | 875 | msgstr "" |
829 | 857 | 876 | ||
830 | 858 | #. noun | 877 | #. noun |
832 | 859 | #: ../duplicity/commandline.py:736 | 878 | #: ../duplicity/commandline.py:759 |
833 | 860 | msgid "count" | 879 | msgid "count" |
834 | 861 | msgstr "" | 880 | msgstr "" |
835 | 862 | 881 | ||
836 | 863 | #. Used in usage help to represent the name of a file directory | 882 | #. Used in usage help to represent the name of a file directory |
838 | 864 | #: ../duplicity/commandline.py:739 | 883 | #: ../duplicity/commandline.py:762 |
839 | 865 | msgid "directory" | 884 | msgid "directory" |
840 | 866 | msgstr "" | 885 | msgstr "" |
841 | 867 | 886 | ||
842 | 868 | #. Used in usage help, e.g. to represent the name of a code | 887 | #. Used in usage help, e.g. to represent the name of a code |
843 | 869 | #. module. Example: | 888 | #. module. Example: |
844 | 870 | #. rsync://user[:password]@other.host[:port]::/module/some_dir | 889 | #. rsync://user[:password]@other.host[:port]::/module/some_dir |
846 | 871 | #: ../duplicity/commandline.py:752 | 890 | #: ../duplicity/commandline.py:775 |
847 | 872 | msgid "module" | 891 | msgid "module" |
848 | 873 | msgstr "" | 892 | msgstr "" |
849 | 874 | 893 | ||
850 | 875 | #. Used in usage help to represent an internet hostname. Example: | 894 | #. Used in usage help to represent an internet hostname. Example: |
851 | 876 | #. ftp://user[:password]@other.host[:port]/some_dir | 895 | #. ftp://user[:password]@other.host[:port]/some_dir |
853 | 877 | #: ../duplicity/commandline.py:766 | 896 | #: ../duplicity/commandline.py:789 |
854 | 878 | msgid "other.host" | 897 | msgid "other.host" |
855 | 879 | msgstr "" | 898 | msgstr "" |
856 | 880 | 899 | ||
857 | 881 | #. Used in usage help. Example: | 900 | #. Used in usage help. Example: |
858 | 882 | #. ftp://user[:password]@other.host[:port]/some_dir | 901 | #. ftp://user[:password]@other.host[:port]/some_dir |
860 | 883 | #: ../duplicity/commandline.py:770 | 902 | #: ../duplicity/commandline.py:793 |
861 | 884 | msgid "password" | 903 | msgid "password" |
862 | 885 | msgstr "" | 904 | msgstr "" |
863 | 886 | 905 | ||
864 | 887 | #. Used in usage help to represent a TCP port number. Example: | 906 | #. Used in usage help to represent a TCP port number. Example: |
865 | 888 | #. ftp://user[:password]@other.host[:port]/some_dir | 907 | #. ftp://user[:password]@other.host[:port]/some_dir |
867 | 889 | #: ../duplicity/commandline.py:778 | 908 | #: ../duplicity/commandline.py:801 |
868 | 890 | msgid "port" | 909 | msgid "port" |
869 | 891 | msgstr "" | 910 | msgstr "" |
870 | 892 | 911 | ||
871 | 893 | #. Used in usage help. This represents a string to be used as a | 912 | #. Used in usage help. This represents a string to be used as a |
872 | 894 | #. prefix to names for backup files created by Duplicity. Example: | 913 | #. prefix to names for backup files created by Duplicity. Example: |
873 | 895 | #. s3://other.host/bucket_name[/prefix] | 914 | #. s3://other.host/bucket_name[/prefix] |
875 | 896 | #: ../duplicity/commandline.py:783 | 915 | #: ../duplicity/commandline.py:806 |
876 | 897 | msgid "prefix" | 916 | msgid "prefix" |
877 | 898 | msgstr "" | 917 | msgstr "" |
878 | 899 | 918 | ||
879 | 900 | #. Used in usage help to represent a Unix-style path name. Example: | 919 | #. Used in usage help to represent a Unix-style path name. Example: |
880 | 901 | #. rsync://user[:password]@other.host[:port]/relative_path | 920 | #. rsync://user[:password]@other.host[:port]/relative_path |
882 | 902 | #: ../duplicity/commandline.py:787 | 921 | #: ../duplicity/commandline.py:810 |
883 | 903 | msgid "relative_path" | 922 | msgid "relative_path" |
884 | 904 | msgstr "" | 923 | msgstr "" |
885 | 905 | 924 | ||
886 | 906 | #. Used in usage help to represent the name of a single file | 925 | #. Used in usage help to represent the name of a single file |
887 | 907 | #. directory or a Unix-style path to a directory. Example: | 926 | #. directory or a Unix-style path to a directory. Example: |
888 | 908 | #. file:///some_dir | 927 | #. file:///some_dir |
890 | 909 | #: ../duplicity/commandline.py:802 | 928 | #: ../duplicity/commandline.py:825 |
891 | 910 | msgid "some_dir" | 929 | msgid "some_dir" |
892 | 911 | msgstr "" | 930 | msgstr "" |
893 | 912 | 931 | ||
894 | @@ -914,14 +933,14 @@ | |||
895 | 914 | #. directory or a Unix-style path to a directory where files will be | 933 | #. directory or a Unix-style path to a directory where files will be |
896 | 915 | #. coming FROM. Example: | 934 | #. coming FROM. Example: |
897 | 916 | #. duplicity [full|incremental] [options] source_dir target_url | 935 | #. duplicity [full|incremental] [options] source_dir target_url |
899 | 917 | #: ../duplicity/commandline.py:808 | 936 | #: ../duplicity/commandline.py:831 |
900 | 918 | msgid "source_dir" | 937 | msgid "source_dir" |
901 | 919 | msgstr "" | 938 | msgstr "" |
902 | 920 | 939 | ||
903 | 921 | #. Used in usage help to represent a URL files will be coming | 940 | #. Used in usage help to represent a URL files will be coming |
904 | 922 | #. FROM. Example: | 941 | #. FROM. Example: |
905 | 923 | #. duplicity [restore] [options] source_url target_dir | 942 | #. duplicity [restore] [options] source_url target_dir |
907 | 924 | #: ../duplicity/commandline.py:813 | 943 | #: ../duplicity/commandline.py:836 |
908 | 925 | msgid "source_url" | 944 | msgid "source_url" |
909 | 926 | msgstr "" | 945 | msgstr "" |
910 | 927 | 946 | ||
911 | @@ -929,75 +948,75 @@ | |||
912 | 929 | #. directory or a Unix-style path to a directory. where files will be | 948 | #. directory or a Unix-style path to a directory. where files will be |
913 | 930 | #. going TO. Example: | 949 | #. going TO. Example: |
914 | 931 | #. duplicity [restore] [options] source_url target_dir | 950 | #. duplicity [restore] [options] source_url target_dir |
916 | 932 | #: ../duplicity/commandline.py:819 | 951 | #: ../duplicity/commandline.py:842 |
917 | 933 | msgid "target_dir" | 952 | msgid "target_dir" |
918 | 934 | msgstr "" | 953 | msgstr "" |
919 | 935 | 954 | ||
920 | 936 | #. Used in usage help to represent a URL files will be going TO. | 955 | #. Used in usage help to represent a URL files will be going TO. |
921 | 937 | #. Example: | 956 | #. Example: |
922 | 938 | #. duplicity [full|incremental] [options] source_dir target_url | 957 | #. duplicity [full|incremental] [options] source_dir target_url |
924 | 939 | #: ../duplicity/commandline.py:824 | 958 | #: ../duplicity/commandline.py:847 |
925 | 940 | msgid "target_url" | 959 | msgid "target_url" |
926 | 941 | msgstr "" | 960 | msgstr "" |
927 | 942 | 961 | ||
928 | 943 | #. Used in usage help to represent a user name (i.e. login). | 962 | #. Used in usage help to represent a user name (i.e. login). |
929 | 944 | #. Example: | 963 | #. Example: |
930 | 945 | #. ftp://user[:password]@other.host[:port]/some_dir | 964 | #. ftp://user[:password]@other.host[:port]/some_dir |
932 | 946 | #: ../duplicity/commandline.py:834 | 965 | #: ../duplicity/commandline.py:857 |
933 | 947 | msgid "user" | 966 | msgid "user" |
934 | 948 | msgstr "" | 967 | msgstr "" |
935 | 949 | 968 | ||
936 | 950 | #. Header in usage help | 969 | #. Header in usage help |
938 | 951 | #: ../duplicity/commandline.py:852 | 970 | #: ../duplicity/commandline.py:875 |
939 | 952 | msgid "Backends and their URL formats:" | 971 | msgid "Backends and their URL formats:" |
940 | 953 | msgstr "" | 972 | msgstr "" |
941 | 954 | 973 | ||
942 | 955 | #. Header in usage help | 974 | #. Header in usage help |
944 | 956 | #: ../duplicity/commandline.py:881 | 975 | #: ../duplicity/commandline.py:904 |
945 | 957 | msgid "Commands:" | 976 | msgid "Commands:" |
946 | 958 | msgstr "" | 977 | msgstr "" |
947 | 959 | 978 | ||
949 | 960 | #: ../duplicity/commandline.py:905 | 979 | #: ../duplicity/commandline.py:928 |
950 | 961 | #, python-format | 980 | #, python-format |
951 | 962 | msgid "Specified archive directory '%s' does not exist, or is not a directory" | 981 | msgid "Specified archive directory '%s' does not exist, or is not a directory" |
952 | 963 | msgstr "" | 982 | msgstr "" |
953 | 964 | 983 | ||
955 | 965 | #: ../duplicity/commandline.py:914 | 984 | #: ../duplicity/commandline.py:937 |
956 | 966 | #, python-format | 985 | #, python-format |
957 | 967 | msgid "" | 986 | msgid "" |
958 | 968 | "Sign key should be an 8, 16 alt. 40 character hex string, like 'AA0E73D2'.\n" | 987 | "Sign key should be an 8, 16 alt. 40 character hex string, like 'AA0E73D2'.\n" |
959 | 969 | "Received '%s' instead." | 988 | "Received '%s' instead." |
960 | 970 | msgstr "" | 989 | msgstr "" |
961 | 971 | 990 | ||
963 | 972 | #: ../duplicity/commandline.py:974 | 991 | #: ../duplicity/commandline.py:997 |
964 | 973 | #, python-format | 992 | #, python-format |
965 | 974 | msgid "" | 993 | msgid "" |
966 | 975 | "Restore destination directory %s already exists.\n" | 994 | "Restore destination directory %s already exists.\n" |
967 | 976 | "Will not overwrite." | 995 | "Will not overwrite." |
968 | 977 | msgstr "" | 996 | msgstr "" |
969 | 978 | 997 | ||
971 | 979 | #: ../duplicity/commandline.py:979 | 998 | #: ../duplicity/commandline.py:1002 |
972 | 980 | #, python-format | 999 | #, python-format |
973 | 981 | msgid "Verify directory %s does not exist" | 1000 | msgid "Verify directory %s does not exist" |
974 | 982 | msgstr "" | 1001 | msgstr "" |
975 | 983 | 1002 | ||
977 | 984 | #: ../duplicity/commandline.py:985 | 1003 | #: ../duplicity/commandline.py:1008 |
978 | 985 | #, python-format | 1004 | #, python-format |
979 | 986 | msgid "Backup source directory %s does not exist." | 1005 | msgid "Backup source directory %s does not exist." |
980 | 987 | msgstr "" | 1006 | msgstr "" |
981 | 988 | 1007 | ||
983 | 989 | #: ../duplicity/commandline.py:1016 | 1008 | #: ../duplicity/commandline.py:1039 |
984 | 990 | #, python-format | 1009 | #, python-format |
985 | 991 | msgid "Command line warning: %s" | 1010 | msgid "Command line warning: %s" |
986 | 992 | msgstr "" | 1011 | msgstr "" |
987 | 993 | 1012 | ||
989 | 994 | #: ../duplicity/commandline.py:1016 | 1013 | #: ../duplicity/commandline.py:1039 |
990 | 995 | msgid "" | 1014 | msgid "" |
991 | 996 | "Selection options --exclude/--include\n" | 1015 | "Selection options --exclude/--include\n" |
992 | 997 | "currently work only when backing up,not restoring." | 1016 | "currently work only when backing up,not restoring." |
993 | 998 | msgstr "" | 1017 | msgstr "" |
994 | 999 | 1018 | ||
996 | 1000 | #: ../duplicity/commandline.py:1064 | 1019 | #: ../duplicity/commandline.py:1087 |
997 | 1001 | #, python-format | 1020 | #, python-format |
998 | 1002 | msgid "" | 1021 | msgid "" |
999 | 1003 | "Bad URL '%s'.\n" | 1022 | "Bad URL '%s'.\n" |
1000 | @@ -1005,7 +1024,7 @@ | |||
1001 | 1005 | "\"file:///usr/local\". See the man page for more information." | 1024 | "\"file:///usr/local\". See the man page for more information." |
1002 | 1006 | msgstr "" | 1025 | msgstr "" |
1003 | 1007 | 1026 | ||
1005 | 1008 | #: ../duplicity/commandline.py:1089 | 1027 | #: ../duplicity/commandline.py:1112 |
1006 | 1009 | msgid "Main action: " | 1028 | msgid "Main action: " |
1007 | 1010 | msgstr "" | 1029 | msgstr "" |
1008 | 1011 | 1030 | ||
1009 | @@ -1240,33 +1259,33 @@ | |||
1010 | 1240 | msgid "Error listing directory %s" | 1259 | msgid "Error listing directory %s" |
1011 | 1241 | msgstr "" | 1260 | msgstr "" |
1012 | 1242 | 1261 | ||
1014 | 1243 | #: ../duplicity/selection.py:125 | 1262 | #: ../duplicity/selection.py:127 |
1015 | 1244 | #, python-format | 1263 | #, python-format |
1016 | 1245 | msgid "Skipping socket %s" | 1264 | msgid "Skipping socket %s" |
1017 | 1246 | msgstr "" | 1265 | msgstr "" |
1018 | 1247 | 1266 | ||
1020 | 1248 | #: ../duplicity/selection.py:129 | 1267 | #: ../duplicity/selection.py:131 |
1021 | 1249 | #, python-format | 1268 | #, python-format |
1022 | 1250 | msgid "Error initializing file %s" | 1269 | msgid "Error initializing file %s" |
1023 | 1251 | msgstr "" | 1270 | msgstr "" |
1024 | 1252 | 1271 | ||
1026 | 1253 | #: ../duplicity/selection.py:133 ../duplicity/selection.py:154 | 1272 | #: ../duplicity/selection.py:135 ../duplicity/selection.py:157 |
1027 | 1254 | #, python-format | 1273 | #, python-format |
1028 | 1255 | msgid "Error accessing possibly locked file %s" | 1274 | msgid "Error accessing possibly locked file %s" |
1029 | 1256 | msgstr "" | 1275 | msgstr "" |
1030 | 1257 | 1276 | ||
1032 | 1258 | #: ../duplicity/selection.py:169 | 1277 | #: ../duplicity/selection.py:172 |
1033 | 1259 | #, python-format | 1278 | #, python-format |
1034 | 1260 | msgid "Warning: base %s doesn't exist, continuing" | 1279 | msgid "Warning: base %s doesn't exist, continuing" |
1035 | 1261 | msgstr "" | 1280 | msgstr "" |
1036 | 1262 | 1281 | ||
1039 | 1263 | #: ../duplicity/selection.py:172 ../duplicity/selection.py:190 | 1282 | #: ../duplicity/selection.py:175 ../duplicity/selection.py:193 |
1040 | 1264 | #: ../duplicity/selection.py:193 | 1283 | #: ../duplicity/selection.py:196 |
1041 | 1265 | #, python-format | 1284 | #, python-format |
1042 | 1266 | msgid "Selecting %s" | 1285 | msgid "Selecting %s" |
1043 | 1267 | msgstr "" | 1286 | msgstr "" |
1044 | 1268 | 1287 | ||
1046 | 1269 | #: ../duplicity/selection.py:275 | 1288 | #: ../duplicity/selection.py:277 |
1047 | 1270 | #, python-format | 1289 | #, python-format |
1048 | 1271 | msgid "" | 1290 | msgid "" |
1049 | 1272 | "Fatal Error: The file specification\n" | 1291 | "Fatal Error: The file specification\n" |
1050 | @@ -1277,14 +1296,14 @@ | |||
1051 | 1277 | "pattern (such as '**') which matches the base directory." | 1296 | "pattern (such as '**') which matches the base directory." |
1052 | 1278 | msgstr "" | 1297 | msgstr "" |
1053 | 1279 | 1298 | ||
1055 | 1280 | #: ../duplicity/selection.py:284 | 1299 | #: ../duplicity/selection.py:286 |
1056 | 1281 | #, python-format | 1300 | #, python-format |
1057 | 1282 | msgid "" | 1301 | msgid "" |
1058 | 1283 | "Fatal Error while processing expression\n" | 1302 | "Fatal Error while processing expression\n" |
1059 | 1284 | "%s" | 1303 | "%s" |
1060 | 1285 | msgstr "" | 1304 | msgstr "" |
1061 | 1286 | 1305 | ||
1063 | 1287 | #: ../duplicity/selection.py:293 | 1306 | #: ../duplicity/selection.py:296 |
1064 | 1288 | #, python-format | 1307 | #, python-format |
1065 | 1289 | msgid "" | 1308 | msgid "" |
1066 | 1290 | "Last selection expression:\n" | 1309 | "Last selection expression:\n" |
1067 | @@ -1294,43 +1313,17 @@ | |||
1068 | 1294 | "probably isn't what you meant." | 1313 | "probably isn't what you meant." |
1069 | 1295 | msgstr "" | 1314 | msgstr "" |
1070 | 1296 | 1315 | ||
1098 | 1297 | #: ../duplicity/selection.py:319 | 1316 | #: ../duplicity/selection.py:353 |
1072 | 1298 | #, python-format | ||
1073 | 1299 | msgid "Reading filelist %s" | ||
1074 | 1300 | msgstr "" | ||
1075 | 1301 | |||
1076 | 1302 | #: ../duplicity/selection.py:322 | ||
1077 | 1303 | #, python-format | ||
1078 | 1304 | msgid "Sorting filelist %s" | ||
1079 | 1305 | msgstr "" | ||
1080 | 1306 | |||
1081 | 1307 | #: ../duplicity/selection.py:350 | ||
1082 | 1308 | #, python-format | ||
1083 | 1309 | msgid "" | ||
1084 | 1310 | "Warning: file specification '%s' in filelist %s\n" | ||
1085 | 1311 | "doesn't start with correct prefix %s. Ignoring." | ||
1086 | 1312 | msgstr "" | ||
1087 | 1313 | |||
1088 | 1314 | #: ../duplicity/selection.py:354 | ||
1089 | 1315 | msgid "Future prefix errors will not be logged." | ||
1090 | 1316 | msgstr "" | ||
1091 | 1317 | |||
1092 | 1318 | #: ../duplicity/selection.py:372 | ||
1093 | 1319 | #, python-format | ||
1094 | 1320 | msgid "Error closing filelist %s" | ||
1095 | 1321 | msgstr "" | ||
1096 | 1322 | |||
1097 | 1323 | #: ../duplicity/selection.py:465 | ||
1099 | 1324 | #, python-format | 1317 | #, python-format |
1100 | 1325 | msgid "Reading globbing filelist %s" | 1318 | msgid "Reading globbing filelist %s" |
1101 | 1326 | msgstr "" | 1319 | msgstr "" |
1102 | 1327 | 1320 | ||
1104 | 1328 | #: ../duplicity/selection.py:495 | 1321 | #: ../duplicity/selection.py:385 |
1105 | 1329 | #, python-format | 1322 | #, python-format |
1106 | 1330 | msgid "Error compiling regular expression %s" | 1323 | msgid "Error compiling regular expression %s" |
1107 | 1331 | msgstr "" | 1324 | msgstr "" |
1108 | 1332 | 1325 | ||
1110 | 1333 | #: ../duplicity/selection.py:511 | 1326 | #: ../duplicity/selection.py:402 |
1111 | 1334 | msgid "" | 1327 | msgid "" |
1112 | 1335 | "Warning: exclude-device-files is not the first selector.\n" | 1328 | "Warning: exclude-device-files is not the first selector.\n" |
1113 | 1336 | "This may not be what you intended" | 1329 | "This may not be what you intended" |
1114 | 1337 | 1330 | ||
1115 | === modified file 'testing/functional/test_selection.py' | |||
1116 | --- testing/functional/test_selection.py 2015-01-31 16:19:46 +0000 | |||
1117 | +++ testing/functional/test_selection.py 2015-03-12 21:50:57 +0000 | |||
1118 | @@ -24,7 +24,6 @@ | |||
1119 | 24 | 24 | ||
1120 | 25 | from . import FunctionalTestCase | 25 | from . import FunctionalTestCase |
1121 | 26 | 26 | ||
1122 | 27 | |||
1123 | 28 | class IncludeExcludeFunctionalTest(FunctionalTestCase): | 27 | class IncludeExcludeFunctionalTest(FunctionalTestCase): |
1124 | 29 | """ | 28 | """ |
1125 | 30 | This contains methods used in the tests below for testing the include, exclude and various filelist features. | 29 | This contains methods used in the tests below for testing the include, exclude and various filelist features. |
1126 | @@ -235,13 +234,13 @@ | |||
1127 | 235 | self.assertEqual(restored, self.expected_restored_tree_with_trailing_space) | 234 | self.assertEqual(restored, self.expected_restored_tree_with_trailing_space) |
1128 | 236 | 235 | ||
1129 | 237 | 236 | ||
1131 | 238 | class TestExcludeGlobbingFilelistTest(IncludeExcludeFunctionalTest): | 237 | class TestExcludeFilelistTest(IncludeExcludeFunctionalTest): |
1132 | 239 | """ | 238 | """ |
1134 | 240 | Test --exclude-globbing-filelist using duplicity binary. | 239 | Test --exclude-filelist using duplicity binary. |
1135 | 241 | """ | 240 | """ |
1136 | 242 | 241 | ||
1139 | 243 | def test_exclude_globbing_filelist(self): | 242 | def test_exclude_filelist(self): |
1140 | 244 | """Test that exclude globbing filelist works in the basic case """ | 243 | """Test that exclude filelist works in the basic case """ |
1141 | 245 | # As this is an exclude filelist any lines with no +/- modifier should be treated as if they have a -. | 244 | # As this is an exclude filelist any lines with no +/- modifier should be treated as if they have a -. |
1142 | 246 | # Create a filelist | 245 | # Create a filelist |
1143 | 247 | with open('testfiles/exclude.txt', 'w') as f: | 246 | with open('testfiles/exclude.txt', 'w') as f: |
1144 | @@ -264,7 +263,50 @@ | |||
1145 | 264 | '+ testfiles/select2/3\n' | 263 | '+ testfiles/select2/3\n' |
1146 | 265 | '+ testfiles/select2/1\n' | 264 | '+ testfiles/select2/1\n' |
1147 | 266 | 'testfiles/select2/**') | 265 | 'testfiles/select2/**') |
1149 | 267 | self.backup("full", "testfiles/select2", options=["--exclude-globbing-filelist=testfiles/exclude.txt"]) | 266 | self.backup("full", "testfiles/select2", options=["--exclude-filelist=testfiles/exclude.txt"]) |
1150 | 267 | self.restore() | ||
1151 | 268 | restore_dir = 'testfiles/restore_out' | ||
1152 | 269 | restored = self.directory_tree_to_list_of_lists(restore_dir) | ||
1153 | 270 | self.assertEqual(restored, self.expected_restored_tree) | ||
1154 | 271 | |||
1155 | 272 | def test_exclude_filelist_combined_imperfections(self): | ||
1156 | 273 | """Test that exclude filelist works with imperfections in the input file""" | ||
1157 | 274 | # This is a combined test for speed reasons. The individual imperfections are tested as unittests in | ||
1158 | 275 | # unit/test_selection. | ||
1159 | 276 | # Imperfections tested are; | ||
1160 | 277 | # * Leading space/spaces before the modifier | ||
1161 | 278 | # * Trailing space/spaces after the filename (but before the newline) | ||
1162 | 279 | # * Blank lines (newline character only) | ||
1163 | 280 | # * Line only containing spaces | ||
1164 | 281 | # * Full-line comments with # as the first character and with leading/trailing spaces | ||
1165 | 282 | # * Unnecessarily quoted filenames with/without modifier (both " and ') | ||
1166 | 283 | |||
1167 | 284 | # Create a filelist | ||
1168 | 285 | with open('testfiles/exclude.txt', 'w') as f: | ||
1169 | 286 | f.write('+ testfiles/select2/3/3sub3/3sub3sub2/3sub3sub2_file.txt\n' | ||
1170 | 287 | 'testfiles/select2/3/3sub3/3sub3sub2\n' | ||
1171 | 288 | '+ testfiles/select2/3/3sub2/3sub2sub2\n' | ||
1172 | 289 | ' + testfiles/select2/3/3sub3\n' # Note leading space added here | ||
1173 | 290 | '- testfiles/select2/3/3sub1\n' | ||
1174 | 291 | ' testfiles/select2/2/2sub1/2sub1sub3\n' # Note leading spaces added here | ||
1175 | 292 | '\n' | ||
1176 | 293 | 'testfiles/select2/2/2sub1/2sub1sub2\n' | ||
1177 | 294 | ' + testfiles/select2/2/2sub1 \n' # Note added trailing/leading space here | ||
1178 | 295 | '- "testfiles/select2/1/1sub3/1sub3sub2"\n' # Unnecessary quotes | ||
1179 | 296 | '# Testing a full-line comment\n' | ||
1180 | 297 | "'testfiles/select2/1/1sub3/1sub3sub1' \n" # Note added spaces and quotes here | ||
1181 | 298 | 'testfiles/select2/1/1sub2/1sub2sub3\n' | ||
1182 | 299 | ' \n' | ||
1183 | 300 | '+ testfiles/select2/1/1sub2/1sub2sub1\n' | ||
1184 | 301 | '- testfiles/select2/1/1sub1/1sub1sub3/1sub1sub3_file.txt\n' | ||
1185 | 302 | 'testfiles/select2/1/1sub1/1sub1sub2\n' | ||
1186 | 303 | ' # Testing a full-line comment with leading and trailing spaces \n' | ||
1187 | 304 | 'testfiles/select2/1/1sub2 \n' # Note added spaces here | ||
1188 | 305 | '+ testfiles/select2/1.py\n' | ||
1189 | 306 | '+ testfiles/select2/3 \n' # Note added space here | ||
1190 | 307 | '+ testfiles/select2/1\n' | ||
1191 | 308 | '- testfiles/select2/**') | ||
1192 | 309 | self.backup("full", "testfiles/select2", options=["--exclude-filelist=testfiles/exclude.txt"]) | ||
1193 | 268 | self.restore() | 310 | self.restore() |
1194 | 269 | restore_dir = 'testfiles/restore_out' | 311 | restore_dir = 'testfiles/restore_out' |
1195 | 270 | restored = self.directory_tree_to_list_of_lists(restore_dir) | 312 | restored = self.directory_tree_to_list_of_lists(restore_dir) |
1196 | @@ -272,6 +314,8 @@ | |||
1197 | 272 | 314 | ||
1198 | 273 | def test_exclude_globbing_filelist_combined_imperfections(self): | 315 | def test_exclude_globbing_filelist_combined_imperfections(self): |
1199 | 274 | """Test that exclude globbing filelist works with imperfections in the input file""" | 316 | """Test that exclude globbing filelist works with imperfections in the input file""" |
1200 | 317 | # Identical to test_exclude_filelist_combined_imperfections and included to ensure that | ||
1201 | 318 | # the deprecated --exclude-globbing-filelist function works as expected until it is deliberately removed. | ||
1202 | 275 | # This is a combined test for speed reasons. The individual imperfections are tested as unittests in | 319 | # This is a combined test for speed reasons. The individual imperfections are tested as unittests in |
1203 | 276 | # unit/test_selection. | 320 | # unit/test_selection. |
1204 | 277 | # Imperfections tested are; | 321 | # Imperfections tested are; |
1205 | @@ -313,7 +357,7 @@ | |||
1206 | 313 | restored = self.directory_tree_to_list_of_lists(restore_dir) | 357 | restored = self.directory_tree_to_list_of_lists(restore_dir) |
1207 | 314 | self.assertEqual(restored, self.expected_restored_tree) | 358 | self.assertEqual(restored, self.expected_restored_tree) |
1208 | 315 | 359 | ||
1210 | 316 | def test_exclude_globbing_filelist_trailing_whitespace_folders_work_with_quotes(self): | 360 | def test_exclude_filelist_trailing_whitespace_folders_work_with_quotes(self): |
1211 | 317 | """Test that folders with trailing whitespace in the names work correctly if they are enclosed in quotes""" | 361 | """Test that folders with trailing whitespace in the names work correctly if they are enclosed in quotes""" |
1212 | 318 | # Create a filelist | 362 | # Create a filelist |
1213 | 319 | with open('testfiles/exclude.txt', 'w') as f: | 363 | with open('testfiles/exclude.txt', 'w') as f: |
1214 | @@ -339,17 +383,17 @@ | |||
1215 | 339 | '+ testfiles/select2/3\n' | 383 | '+ testfiles/select2/3\n' |
1216 | 340 | '+ testfiles/select2/1\n' | 384 | '+ testfiles/select2/1\n' |
1217 | 341 | 'testfiles/select2/**') | 385 | 'testfiles/select2/**') |
1219 | 342 | self.backup("full", "testfiles/select2", options=["--exclude-globbing-filelist=testfiles/exclude.txt"]) | 386 | self.backup("full", "testfiles/select2", options=["--exclude-filelist=testfiles/exclude.txt"]) |
1220 | 343 | self.restore() | 387 | self.restore() |
1221 | 344 | restore_dir = 'testfiles/restore_out' | 388 | restore_dir = 'testfiles/restore_out' |
1222 | 345 | restored = self.directory_tree_to_list_of_lists(restore_dir) | 389 | restored = self.directory_tree_to_list_of_lists(restore_dir) |
1223 | 346 | self.assertEqual(restored, self.expected_restored_tree_with_trailing_space) | 390 | self.assertEqual(restored, self.expected_restored_tree_with_trailing_space) |
1224 | 347 | 391 | ||
1225 | 348 | @unittest.expectedFailure | 392 | @unittest.expectedFailure |
1228 | 349 | def test_exclude_globbing_filelist_progress_option(self): | 393 | def test_exclude_filelist_progress_option(self): |
1229 | 350 | """Test that exclude globbing filelist is unaffected by the --progress option""" | 394 | """Test that exclude filelist is unaffected by the --progress option""" |
1230 | 351 | # ToDo - currently fails. Bug #1264744 (https://bugs.launchpad.net/duplicity/+bug/1264744) | 395 | # ToDo - currently fails. Bug #1264744 (https://bugs.launchpad.net/duplicity/+bug/1264744) |
1232 | 352 | # Create a filelist identical to that used in test_exclude_globbing_filelist | 396 | # Create a filelist identical to that used in test_exclude_filelist |
1233 | 353 | with open('testfiles/exclude.txt', 'w') as f: | 397 | with open('testfiles/exclude.txt', 'w') as f: |
1234 | 354 | f.write('+ testfiles/select2/3/3sub3/3sub3sub2/3sub3sub2_file.txt\n' | 398 | f.write('+ testfiles/select2/3/3sub3/3sub3sub2/3sub3sub2_file.txt\n' |
1235 | 355 | 'testfiles/select2/3/3sub3/3sub3sub2\n' | 399 | 'testfiles/select2/3/3sub3/3sub3sub2\n' |
1236 | @@ -371,170 +415,94 @@ | |||
1237 | 371 | '+ testfiles/select2/1\n' | 415 | '+ testfiles/select2/1\n' |
1238 | 372 | 'testfiles/select2/**') | 416 | 'testfiles/select2/**') |
1239 | 373 | 417 | ||
1242 | 374 | # Backup the files exactly as in test_exclude_globbing_filelist, but with the --progress option | 418 | # Backup the files exactly as in test_exclude_filelist, but with the --progress option |
1243 | 375 | self.backup("full", "testfiles/select2", options=["--exclude-globbing-filelist=testfiles/exclude.txt", | 419 | self.backup("full", "testfiles/select2", options=["--exclude-filelist=testfiles/exclude.txt", |
1244 | 376 | "--progress"]) | 420 | "--progress"]) |
1245 | 377 | self.restore() | 421 | self.restore() |
1246 | 378 | restore_dir = 'testfiles/restore_out' | 422 | restore_dir = 'testfiles/restore_out' |
1247 | 379 | restored = self.directory_tree_to_list_of_lists(restore_dir) | 423 | restored = self.directory_tree_to_list_of_lists(restore_dir) |
1329 | 380 | # The restored files should match those restored in test_exclude_globbing_filelist | 424 | # The restored files should match those restored in test_exclude_filelist |
1330 | 381 | self.assertEqual(restored, self.expected_restored_tree) | 425 | self.assertEqual(restored, self.expected_restored_tree) |
1250 | 382 | |||
1251 | 383 | class TestIncludeGlobbingFilelistTest(IncludeExcludeFunctionalTest): | ||
1252 | 384 | """ | ||
1253 | 385 | Test --include-globbing-filelist using duplicity binary. | ||
1254 | 386 | """ | ||
1255 | 387 | |||
1256 | 388 | def test_include_globbing_filelist(self): | ||
1257 | 389 | """Test that include globbing filelist works in the basic case""" | ||
1258 | 390 | # See test_exclude_globbing_filelist above for explanation of what is expected. As this is an include filelist | ||
1259 | 391 | # any lines with no +/- modifier should be treated as if they have a +. | ||
1260 | 392 | # Create a filelist | ||
1261 | 393 | with open('testfiles/include.txt', 'w') as f: | ||
1262 | 394 | f.write('testfiles/select2/3/3sub3/3sub3sub2/3sub3sub2_file.txt\n' | ||
1263 | 395 | '- testfiles/select2/3/3sub3/3sub3sub2\n' | ||
1264 | 396 | 'testfiles/select2/3/3sub2/3sub2sub2\n' | ||
1265 | 397 | '+ testfiles/select2/3/3sub3\n' # + added to ensure it makes no difference | ||
1266 | 398 | '- testfiles/select2/3/3sub1\n' | ||
1267 | 399 | '- testfiles/select2/2/2sub1/2sub1sub3\n' | ||
1268 | 400 | '- testfiles/select2/2/2sub1/2sub1sub2\n' | ||
1269 | 401 | 'testfiles/select2/2/2sub1\n' | ||
1270 | 402 | '- testfiles/select2/1/1sub3/1sub3sub2\n' | ||
1271 | 403 | '- testfiles/select2/1/1sub3/1sub3sub1\n' | ||
1272 | 404 | '- testfiles/select2/1/1sub2/1sub2sub3\n' | ||
1273 | 405 | '+ testfiles/select2/1/1sub2/1sub2sub1\n' # + added to ensure it makes no difference | ||
1274 | 406 | '- testfiles/select2/1/1sub1/1sub1sub3/1sub1sub3_file.txt\n' | ||
1275 | 407 | '- testfiles/select2/1/1sub1/1sub1sub2\n' | ||
1276 | 408 | '- testfiles/select2/1/1sub2\n' | ||
1277 | 409 | 'testfiles/select2/1.py\n' | ||
1278 | 410 | 'testfiles/select2/3\n' | ||
1279 | 411 | 'testfiles/select2/1\n' | ||
1280 | 412 | '- testfiles/select2/**') | ||
1281 | 413 | self.backup("full", "testfiles/select2", options=["--include-globbing-filelist=testfiles/include.txt"]) | ||
1282 | 414 | self.restore() | ||
1283 | 415 | restore_dir = 'testfiles/restore_out' | ||
1284 | 416 | restored = self.directory_tree_to_list_of_lists(restore_dir) | ||
1285 | 417 | self.assertEqual(restored, self.expected_restored_tree) | ||
1286 | 418 | |||
1287 | 419 | def test_include_globbing_filelist_combined_imperfections(self): | ||
1288 | 420 | """Test that include globbing filelist works with imperfections in the input file""" | ||
1289 | 421 | # This is a combined test for speed reasons. The individual imperfections are tested as unittests in | ||
1290 | 422 | # unit/test_selection. | ||
1291 | 423 | # Imperfections tested are; | ||
1292 | 424 | # * Leading space/spaces before the modifier | ||
1293 | 425 | # * Trailing space/spaces after the filename (but before the newline) | ||
1294 | 426 | # * Blank lines (newline character only) | ||
1295 | 427 | # * Line only containing spaces | ||
1296 | 428 | # * Full-line comments with # as the first character and with leading/trailing spaces | ||
1297 | 429 | # * Unnecessarily quoted filenames with/without modifier (both " and ') | ||
1298 | 430 | # Create a filelist | ||
1299 | 431 | with open('testfiles/include.txt', 'w') as f: | ||
1300 | 432 | f.write('testfiles/select2/3/3sub3/3sub3sub2/3sub3sub2_file.txt\n' | ||
1301 | 433 | '- testfiles/select2/3/3sub3/3sub3sub2\n' | ||
1302 | 434 | '"testfiles/select2/3/3sub2/3sub2sub2"\n' | ||
1303 | 435 | ' + testfiles/select2/3/3sub3\n' # + added to ensure it makes no difference | ||
1304 | 436 | '- testfiles/select2/3/3sub1\n' | ||
1305 | 437 | '- testfiles/select2/2/2sub1/2sub1sub3\n' | ||
1306 | 438 | ' - "testfiles/select2/2/2sub1/2sub1sub2"\n' | ||
1307 | 439 | 'testfiles/select2/2/2sub1 \n' | ||
1308 | 440 | '\n' | ||
1309 | 441 | '- testfiles/select2/1/1sub3/1sub3sub2\n' | ||
1310 | 442 | '- testfiles/select2/1/1sub3/1sub3sub1 \n' | ||
1311 | 443 | "- 'testfiles/select2/1/1sub2/1sub2sub3'\n" | ||
1312 | 444 | ' \n' | ||
1313 | 445 | ' + testfiles/select2/1/1sub2/1sub2sub1 \n' # + added to ensure it makes no difference | ||
1314 | 446 | '- testfiles/select2/1/1sub1/1sub1sub3/1sub1sub3_file.txt\n' | ||
1315 | 447 | ' - testfiles/select2/1/1sub1/1sub1sub2 \n' | ||
1316 | 448 | '# Testing full-line comment\n' | ||
1317 | 449 | '- testfiles/select2/1/1sub2\n' | ||
1318 | 450 | "'testfiles/select2/1.py'\n" | ||
1319 | 451 | 'testfiles/select2/3\n' | ||
1320 | 452 | ' # Testing another full-line comment \n' | ||
1321 | 453 | 'testfiles/select2/1\n' | ||
1322 | 454 | '- testfiles/select2/**') | ||
1323 | 455 | self.backup("full", "testfiles/select2", options=["--include-globbing-filelist=testfiles/include.txt"]) | ||
1324 | 456 | self.restore() | ||
1325 | 457 | restore_dir = 'testfiles/restore_out' | ||
1326 | 458 | restored = self.directory_tree_to_list_of_lists(restore_dir) | ||
1327 | 459 | self.assertEqual(restored, self.expected_restored_tree) | ||
1328 | 460 | |||
1331 | 461 | 426 | ||
1332 | 462 | class TestIncludeFilelistTest(IncludeExcludeFunctionalTest): | 427 | class TestIncludeFilelistTest(IncludeExcludeFunctionalTest): |
1333 | 463 | """ | 428 | """ |
1334 | 464 | Test --include-filelist using duplicity binary. | 429 | Test --include-filelist using duplicity binary. |
1335 | 465 | """ | 430 | """ |
1337 | 466 | @unittest.expectedFailure | 431 | |
1338 | 467 | def test_include_filelist(self): | 432 | def test_include_filelist(self): |
1339 | 468 | """Test that include filelist works in the basic case""" | 433 | """Test that include filelist works in the basic case""" |
1341 | 469 | # See test_exclude_globbing_filelist above for explanation of what is expected. As this is an include filelist | 434 | # See test_exclude_filelist above for explanation of what is expected. As this is an include filelist |
1342 | 470 | # any lines with no +/- modifier should be treated as if they have a +. | 435 | # any lines with no +/- modifier should be treated as if they have a +. |
1410 | 471 | # ToDo Currently fails - Bug #1408411 (https://bugs.launchpad.net/duplicity/+bug/1408411) | 436 | # Create a filelist |
1411 | 472 | # Create a filelist | 437 | with open('testfiles/include.txt', 'w') as f: |
1412 | 473 | with open('testfiles/include.txt', 'w') as f: | 438 | f.write('testfiles/select2/3/3sub3/3sub3sub2/3sub3sub2_file.txt\n' |
1413 | 474 | f.write('testfiles/select2/3/3sub3/3sub3sub2/3sub3sub2_file.txt\n' | 439 | '- testfiles/select2/3/3sub3/3sub3sub2\n' |
1414 | 475 | '- testfiles/select2/3/3sub3/3sub3sub2\n' | 440 | 'testfiles/select2/3/3sub2/3sub2sub2\n' |
1415 | 476 | 'testfiles/select2/3/3sub2/3sub2sub2\n' | 441 | '+ testfiles/select2/3/3sub3\n' # + added to ensure it makes no difference |
1416 | 477 | '+ testfiles/select2/3/3sub3\n' # + added to ensure it makes no difference | 442 | '- testfiles/select2/3/3sub1\n' |
1417 | 478 | '- testfiles/select2/3/3sub1\n' | 443 | '- testfiles/select2/2/2sub1/2sub1sub3\n' |
1418 | 479 | '- testfiles/select2/2/2sub1/2sub1sub3\n' | 444 | '- testfiles/select2/2/2sub1/2sub1sub2\n' |
1419 | 480 | '- testfiles/select2/2/2sub1/2sub1sub2\n' | 445 | 'testfiles/select2/2/2sub1\n' |
1420 | 481 | 'testfiles/select2/2/2sub1\n' | 446 | '- testfiles/select2/1/1sub3/1sub3sub2\n' |
1421 | 482 | '- testfiles/select2/1/1sub3/1sub3sub2\n' | 447 | '- testfiles/select2/1/1sub3/1sub3sub1\n' |
1422 | 483 | '- testfiles/select2/1/1sub3/1sub3sub1\n' | 448 | '- testfiles/select2/1/1sub2/1sub2sub3\n' |
1423 | 484 | '- testfiles/select2/1/1sub2/1sub2sub3\n' | 449 | '+ testfiles/select2/1/1sub2/1sub2sub1\n' # + added to ensure it makes no difference |
1424 | 485 | '+ testfiles/select2/1/1sub2/1sub2sub1\n' # + added to ensure it makes no difference | 450 | '- testfiles/select2/1/1sub1/1sub1sub3/1sub1sub3_file.txt\n' |
1425 | 486 | '- testfiles/select2/1/1sub1/1sub1sub3/1sub1sub3_file.txt\n' | 451 | '- testfiles/select2/1/1sub1/1sub1sub2\n' |
1426 | 487 | '- testfiles/select2/1/1sub1/1sub1sub2\n' | 452 | '- testfiles/select2/1/1sub2\n' |
1427 | 488 | '- testfiles/select2/1/1sub2\n' | 453 | 'testfiles/select2/1.py\n' |
1428 | 489 | 'testfiles/select2/1.py\n' | 454 | 'testfiles/select2/3\n' |
1429 | 490 | 'testfiles/select2/3\n' | 455 | 'testfiles/select2/1\n' |
1430 | 491 | '- testfiles/select2/2\n' # es instead of ea as no globbing - ** | 456 | '- testfiles/select2/**') |
1431 | 492 | 'testfiles/select2/1\n' | 457 | self.backup("full", "testfiles/select2", options=["--include-filelist=testfiles/include.txt"]) |
1432 | 493 | '- "testfiles/select2/trailing_space "\n' # es instead of ea as no globbing - ** | 458 | self.restore() |
1433 | 494 | '- testfiles/select2/1.doc') # es instead of ea as no globbing - ** | 459 | restore_dir = 'testfiles/restore_out' |
1434 | 495 | self.backup("full", "testfiles/select2", options=["--include-filelist=testfiles/include.txt"]) | 460 | restored = self.directory_tree_to_list_of_lists(restore_dir) |
1435 | 496 | self.restore() | 461 | self.assertEqual(restored, self.expected_restored_tree) |
1436 | 497 | restore_dir = 'testfiles/restore_out' | 462 | |
1437 | 498 | restored = self.directory_tree_to_list_of_lists(restore_dir) | 463 | def test_include_filelist_combined_imperfections(self): |
1438 | 499 | self.assertEqual(restored, self.expected_restored_tree) | 464 | """Test that include filelist works with imperfections in the input file""" |
1439 | 500 | 465 | # This is a combined test for speed reasons. The individual imperfections are tested as unittests in | |
1440 | 501 | def test_include_filelist_workaround(self): | 466 | # unit/test_selection. |
1441 | 502 | """Test that include filelist works in the basic case""" | 467 | # Imperfections tested are; |
1442 | 503 | # This is a modified version of test_include_filelist that passes, despite Bug #1408411 | 468 | # * Leading space/spaces before the modifier |
1443 | 504 | # It is still a valid test, it just does not test as many selection features as the above. | 469 | # * Trailing space/spaces after the filename (but before the newline) |
1444 | 505 | # Create a filelist | 470 | # * Blank lines (newline character only) |
1445 | 506 | with open('testfiles/include.txt', 'w') as f: | 471 | # * Line only containing spaces |
1446 | 507 | f.write('testfiles/select2/3/3sub3/3sub3sub2/3sub3sub2_file.txt\n' | 472 | # * Full-line comments with # as the first character and with leading/trailing spaces |
1447 | 508 | # '- testfiles/select2/3/3sub3/3sub3sub2\n' # Commented out because of Bug #1408411 | 473 | # * Unnecessarily quoted filenames with/without modifier (both " and ') |
1448 | 509 | 'testfiles/select2/3/3sub2/3sub2sub2\n' | 474 | # Create a filelist |
1449 | 510 | '+ testfiles/select2/3/3sub3\n' # + added to ensure it makes no difference | 475 | with open('testfiles/include.txt', 'w') as f: |
1450 | 511 | '- testfiles/select2/3/3sub1\n' | 476 | f.write('testfiles/select2/3/3sub3/3sub3sub2/3sub3sub2_file.txt\n' |
1451 | 512 | '- testfiles/select2/2/2sub1/2sub1sub3\n' | 477 | '- testfiles/select2/3/3sub3/3sub3sub2\n' |
1452 | 513 | '- testfiles/select2/2/2sub1/2sub1sub2\n' | 478 | '"testfiles/select2/3/3sub2/3sub2sub2"\n' |
1453 | 514 | 'testfiles/select2/2/2sub1\n' | 479 | ' + testfiles/select2/3/3sub3\n' # + added to ensure it makes no difference |
1454 | 515 | '- testfiles/select2/2/2sub3\n' # Added because of Bug #1408411 | 480 | '- testfiles/select2/3/3sub1\n' |
1455 | 516 | '- testfiles/select2/2/2sub2\n' # Added because of Bug #1408411 | 481 | '- testfiles/select2/2/2sub1/2sub1sub3\n' |
1456 | 517 | '- testfiles/select2/1/1sub3/1sub3sub2\n' | 482 | ' - "testfiles/select2/2/2sub1/2sub1sub2"\n' |
1457 | 518 | '- testfiles/select2/1/1sub3/1sub3sub1\n' | 483 | 'testfiles/select2/2/2sub1 \n' |
1458 | 519 | '- testfiles/select2/1/1sub2/1sub2sub3\n' | 484 | '\n' |
1459 | 520 | '- testfiles/select2/1/1sub2/1sub2sub2\n' # Added because of Bug #1408411 | 485 | '- testfiles/select2/1/1sub3/1sub3sub2\n' |
1460 | 521 | '+ testfiles/select2/1/1sub2/1sub2sub1\n' # + added to ensure it makes no difference | 486 | '- testfiles/select2/1/1sub3/1sub3sub1 \n' |
1461 | 522 | '- testfiles/select2/1/1sub1/1sub1sub3/1sub1sub3_file.txt\n' | 487 | "- 'testfiles/select2/1/1sub2/1sub2sub3'\n" |
1462 | 523 | '- testfiles/select2/1/1sub1/1sub1sub2\n' | 488 | ' \n' |
1463 | 524 | # '- testfiles/select2/1/1sub2\n' # Commented out because of Bug #1408411 | 489 | ' + testfiles/select2/1/1sub2/1sub2sub1 \n' # + added to ensure it makes no difference |
1464 | 525 | 'testfiles/select2/1.py\n' | 490 | '- testfiles/select2/1/1sub1/1sub1sub3/1sub1sub3_file.txt\n' |
1465 | 526 | 'testfiles/select2/3\n' | 491 | ' - testfiles/select2/1/1sub1/1sub1sub2 \n' |
1466 | 527 | # '- testfiles/select2/2\n' # Commented out because of Bug #1408411 | 492 | '# Testing full-line comment\n' |
1467 | 528 | 'testfiles/select2/1\n' | 493 | '- testfiles/select2/1/1sub2\n' |
1468 | 529 | '- "testfiles/select2/trailing_space "\n' # es instead of ea as no globbing - ** | 494 | "'testfiles/select2/1.py'\n" |
1469 | 530 | '- testfiles/select2/1.doc') # es instead of ea as no globbing - ** | 495 | 'testfiles/select2/3\n' |
1470 | 531 | self.backup("full", "testfiles/select2", options=["--include-filelist=testfiles/include.txt"]) | 496 | ' # Testing another full-line comment \n' |
1471 | 532 | self.restore() | 497 | 'testfiles/select2/1\n' |
1472 | 533 | restore_dir = 'testfiles/restore_out' | 498 | '- testfiles/select2/**') |
1473 | 534 | restored = self.directory_tree_to_list_of_lists(restore_dir) | 499 | self.backup("full", "testfiles/select2", options=["--include-filelist=testfiles/include.txt"]) |
1474 | 535 | self.assertEqual(restored, self.expected_restored_tree) | 500 | self.restore() |
1475 | 536 | 501 | restore_dir = 'testfiles/restore_out' | |
1476 | 537 | def test_include_filelist_workaround_combined_imperfections(self): | 502 | restored = self.directory_tree_to_list_of_lists(restore_dir) |
1477 | 503 | self.assertEqual(restored, self.expected_restored_tree) | ||
1478 | 504 | |||
1479 | 505 | def test_include_filelist_workaround_combined_imperfections_no_wildcards(self): | ||
1480 | 538 | """Test that include filelist works with imperfections in the input file""" | 506 | """Test that include filelist works with imperfections in the input file""" |
1481 | 539 | # This is a modified version of test_include_filelist that passes, despite Bug #1408411 | 507 | # This is a modified version of test_include_filelist that passes, despite Bug #1408411 |
1482 | 540 | # It is still a valid test, it just does not test as many selection features as the above. | 508 | # It is still a valid test, it just does not test as many selection features as the above. |
1483 | @@ -574,14 +542,58 @@ | |||
1484 | 574 | 'testfiles/select2/3\n' | 542 | 'testfiles/select2/3\n' |
1485 | 575 | # '- testfiles/select2/2\n' # Commented out because of Bug #1408411 | 543 | # '- testfiles/select2/2\n' # Commented out because of Bug #1408411 |
1486 | 576 | 'testfiles/select2/1\n' | 544 | 'testfiles/select2/1\n' |
1489 | 577 | '- "testfiles/select2/trailing_space "\n' # es instead of ea as no globbing - ** | 545 | '- "testfiles/select2/trailing_space "\n' # es instead of ea as no wildcard - ** |
1490 | 578 | '- testfiles/select2/1.doc') # es instead of ea as no globbing - ** | 546 | '- testfiles/select2/1.doc') # es instead of ea as no wildcard - ** |
1491 | 579 | self.backup("full", "testfiles/select2", options=["--include-filelist=testfiles/include.txt"]) | 547 | self.backup("full", "testfiles/select2", options=["--include-filelist=testfiles/include.txt"]) |
1492 | 580 | self.restore() | 548 | self.restore() |
1493 | 581 | restore_dir = 'testfiles/restore_out' | 549 | restore_dir = 'testfiles/restore_out' |
1494 | 582 | restored = self.directory_tree_to_list_of_lists(restore_dir) | 550 | restored = self.directory_tree_to_list_of_lists(restore_dir) |
1495 | 583 | self.assertEqual(restored, self.expected_restored_tree) | 551 | self.assertEqual(restored, self.expected_restored_tree) |
1496 | 584 | 552 | ||
1497 | 553 | def test_include_globbing_filelist_combined_imperfections(self): | ||
1498 | 554 | """Test that include globbing filelist works with imperfections in the input file""" | ||
1499 | 555 | # Identical to test_include_filelist_combined_imperfections and included to ensure that | ||
1500 | 556 | # the deprecated --include-globbing-filelist function works as expected until it is deliberately removed. | ||
1501 | 557 | # This is a combined test for speed reasons. The individual imperfections are tested as unittests in | ||
1502 | 558 | # unit/test_selection. | ||
1503 | 559 | # Imperfections tested are; | ||
1504 | 560 | # * Leading space/spaces before the modifier | ||
1505 | 561 | # * Trailing space/spaces after the filename (but before the newline) | ||
1506 | 562 | # * Blank lines (newline character only) | ||
1507 | 563 | # * Line only containing spaces | ||
1508 | 564 | # * Full-line comments with # as the first character and with leading/trailing spaces | ||
1509 | 565 | # * Unnecessarily quoted filenames with/without modifier (both " and ') | ||
1510 | 566 | # Create a filelist | ||
1511 | 567 | with open('testfiles/include.txt', 'w') as f: | ||
1512 | 568 | f.write('testfiles/select2/3/3sub3/3sub3sub2/3sub3sub2_file.txt\n' | ||
1513 | 569 | '- testfiles/select2/3/3sub3/3sub3sub2\n' | ||
1514 | 570 | '"testfiles/select2/3/3sub2/3sub2sub2"\n' | ||
1515 | 571 | ' + testfiles/select2/3/3sub3\n' # + added to ensure it makes no difference | ||
1516 | 572 | '- testfiles/select2/3/3sub1\n' | ||
1517 | 573 | '- testfiles/select2/2/2sub1/2sub1sub3\n' | ||
1518 | 574 | ' - "testfiles/select2/2/2sub1/2sub1sub2"\n' | ||
1519 | 575 | 'testfiles/select2/2/2sub1 \n' | ||
1520 | 576 | '\n' | ||
1521 | 577 | '- testfiles/select2/1/1sub3/1sub3sub2\n' | ||
1522 | 578 | '- testfiles/select2/1/1sub3/1sub3sub1 \n' | ||
1523 | 579 | "- 'testfiles/select2/1/1sub2/1sub2sub3'\n" | ||
1524 | 580 | ' \n' | ||
1525 | 581 | ' + testfiles/select2/1/1sub2/1sub2sub1 \n' # + added to ensure it makes no difference | ||
1526 | 582 | '- testfiles/select2/1/1sub1/1sub1sub3/1sub1sub3_file.txt\n' | ||
1527 | 583 | ' - testfiles/select2/1/1sub1/1sub1sub2 \n' | ||
1528 | 584 | '# Testing full-line comment\n' | ||
1529 | 585 | '- testfiles/select2/1/1sub2\n' | ||
1530 | 586 | "'testfiles/select2/1.py'\n" | ||
1531 | 587 | 'testfiles/select2/3\n' | ||
1532 | 588 | ' # Testing another full-line comment \n' | ||
1533 | 589 | 'testfiles/select2/1\n' | ||
1534 | 590 | '- testfiles/select2/**') | ||
1535 | 591 | self.backup("full", "testfiles/select2", options=["--include-globbing-filelist=testfiles/include.txt"]) | ||
1536 | 592 | self.restore() | ||
1537 | 593 | restore_dir = 'testfiles/restore_out' | ||
1538 | 594 | restored = self.directory_tree_to_list_of_lists(restore_dir) | ||
1539 | 595 | self.assertEqual(restored, self.expected_restored_tree) | ||
1540 | 596 | |||
1541 | 585 | 597 | ||
1542 | 586 | class TestIncludeExcludedForContents(IncludeExcludeFunctionalTest): | 598 | class TestIncludeExcludedForContents(IncludeExcludeFunctionalTest): |
1543 | 587 | """ Test to check that folders that are excluded are included if they contain includes of higher priority. | 599 | """ Test to check that folders that are excluded are included if they contain includes of higher priority. |
1544 | @@ -614,28 +626,28 @@ | |||
1545 | 614 | 626 | ||
1546 | 615 | def test_include_globbing_filelist(self): | 627 | def test_include_globbing_filelist(self): |
1547 | 616 | """test an excluded folder is included for included contents with an include-globbing-filelist """ | 628 | """test an excluded folder is included for included contents with an include-globbing-filelist """ |
1548 | 629 | # Deprecated, but include for now to ensure it keeps working until it is deliberately removed. | ||
1549 | 617 | self.write_filelist("testfiles/include.txt") | 630 | self.write_filelist("testfiles/include.txt") |
1550 | 618 | self.backup("full", "testfiles/select/1", options=["--include-globbing-filelist=testfiles/include.txt"]) | 631 | self.backup("full", "testfiles/select/1", options=["--include-globbing-filelist=testfiles/include.txt"]) |
1551 | 619 | self.restore_and_check() | 632 | self.restore_and_check() |
1552 | 620 | 633 | ||
1553 | 621 | def test_exclude_globbing_filelist(self): | 634 | def test_exclude_globbing_filelist(self): |
1554 | 622 | """test an excluded folder is included for included contents with an exclude-globbing-filelist """ | 635 | """test an excluded folder is included for included contents with an exclude-globbing-filelist """ |
1555 | 636 | # Deprecated, but include for now to ensure it keeps working until it is deliberately removed. | ||
1556 | 623 | self.write_filelist("testfiles/exclude.txt") | 637 | self.write_filelist("testfiles/exclude.txt") |
1557 | 624 | self.backup("full", "testfiles/select/1", options=["--exclude-globbing-filelist=testfiles/exclude.txt"]) | 638 | self.backup("full", "testfiles/select/1", options=["--exclude-globbing-filelist=testfiles/exclude.txt"]) |
1558 | 625 | self.restore_and_check() | 639 | self.restore_and_check() |
1559 | 626 | 640 | ||
1560 | 627 | @unittest.expectedFailure | ||
1561 | 628 | def test_include_filelist(self): | 641 | def test_include_filelist(self): |
1562 | 629 | """test an excluded folder is included for included contents with an include-filelist (non-globbing) """ | 642 | """test an excluded folder is included for included contents with an include-filelist (non-globbing) """ |
1564 | 630 | # ToDo - currently fails - Bug #1408411 (https://bugs.launchpad.net/duplicity/+bug/1408411) | 643 | # Regression test for Bug #1408411 (https://bugs.launchpad.net/duplicity/+bug/1408411) |
1565 | 631 | self.write_filelist("testfiles/include.txt") | 644 | self.write_filelist("testfiles/include.txt") |
1566 | 632 | self.backup("full", "testfiles/select/1", options=["--include-filelist=testfiles/include.txt"]) | 645 | self.backup("full", "testfiles/select/1", options=["--include-filelist=testfiles/include.txt"]) |
1567 | 633 | self.restore_and_check() | 646 | self.restore_and_check() |
1568 | 634 | 647 | ||
1569 | 635 | @unittest.expectedFailure | ||
1570 | 636 | def test_exclude_filelist(self): | 648 | def test_exclude_filelist(self): |
1571 | 637 | """test an excluded folder is included for included contents with an exclude-filelist (non-globbing) """ | 649 | """test an excluded folder is included for included contents with an exclude-filelist (non-globbing) """ |
1573 | 638 | # ToDo - currently fails - Bug #1408411 (https://bugs.launchpad.net/duplicity/+bug/1408411) | 650 | # Regression test for Bug #1408411 (https://bugs.launchpad.net/duplicity/+bug/1408411) |
1574 | 639 | self.write_filelist("testfiles/exclude.txt") | 651 | self.write_filelist("testfiles/exclude.txt") |
1575 | 640 | self.backup("full", "testfiles/select/1", options=["--exclude-filelist=testfiles/exclude.txt"]) | 652 | self.backup("full", "testfiles/select/1", options=["--exclude-filelist=testfiles/exclude.txt"]) |
1576 | 641 | self.restore_and_check() | 653 | self.restore_and_check() |
1577 | @@ -653,38 +665,38 @@ | |||
1578 | 653 | restored = self.directory_tree_to_list_of_lists(restore_dir) | 665 | restored = self.directory_tree_to_list_of_lists(restore_dir) |
1579 | 654 | self.assertEqual(restored, [['2'], ['1']]) | 666 | self.assertEqual(restored, [['2'], ['1']]) |
1580 | 655 | 667 | ||
1583 | 656 | def test_exclude_globbing_filelist_asterisks_none(self): | 668 | def test_exclude_filelist_asterisks_none(self): |
1584 | 657 | """Basic exclude globbing filelist.""" | 669 | """Basic exclude filelist.""" |
1585 | 658 | with open("testfiles/filelist.txt", 'w') as f: | 670 | with open("testfiles/filelist.txt", 'w') as f: |
1586 | 659 | f.write("+ testfiles/select/1/2/1\n" | 671 | f.write("+ testfiles/select/1/2/1\n" |
1587 | 660 | "- testfiles/select/1/2\n" | 672 | "- testfiles/select/1/2\n" |
1588 | 661 | "- testfiles/select/1/1\n" | 673 | "- testfiles/select/1/1\n" |
1589 | 662 | "- testfiles/select/1/3") | 674 | "- testfiles/select/1/3") |
1591 | 663 | self.backup("full", "testfiles/select/1", options=["--exclude-globbing-filelist=testfiles/filelist.txt"]) | 675 | self.backup("full", "testfiles/select/1", options=["--exclude-filelist=testfiles/filelist.txt"]) |
1592 | 664 | self.restore_and_check() | 676 | self.restore_and_check() |
1593 | 665 | 677 | ||
1594 | 666 | @unittest.expectedFailure | 678 | @unittest.expectedFailure |
1597 | 667 | def test_exclude_globbing_filelist_asterisks_single(self): | 679 | def test_exclude_filelist_asterisks_single(self): |
1598 | 668 | """Exclude globbing filelist with asterisks replacing folders.""" | 680 | """Exclude filelist with asterisks replacing folders.""" |
1599 | 669 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) | 681 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) |
1600 | 670 | with open("testfiles/filelist.txt", 'w') as f: | 682 | with open("testfiles/filelist.txt", 'w') as f: |
1601 | 671 | f.write("+ */select/1/2/1\n" | 683 | f.write("+ */select/1/2/1\n" |
1602 | 672 | "- */select/1/2\n" | 684 | "- */select/1/2\n" |
1603 | 673 | "- testfiles/*/1/1\n" | 685 | "- testfiles/*/1/1\n" |
1604 | 674 | "- */*/1/3") | 686 | "- */*/1/3") |
1606 | 675 | self.backup("full", "testfiles/select/1", options=["--exclude-globbing-filelist=testfiles/filelist.txt"]) | 687 | self.backup("full", "testfiles/select/1", options=["--exclude-filelist=testfiles/filelist.txt"]) |
1607 | 676 | self.restore_and_check() | 688 | self.restore_and_check() |
1608 | 677 | 689 | ||
1609 | 678 | @unittest.expectedFailure | 690 | @unittest.expectedFailure |
1612 | 679 | def test_exclude_globbing_filelist_asterisks_double_asterisks(self): | 691 | def test_exclude_filelist_asterisks_double_asterisks(self): |
1613 | 680 | """Exclude globbing filelist with double asterisks replacing folders.""" | 692 | """Exclude filelist with double asterisks replacing folders.""" |
1614 | 681 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) | 693 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) |
1615 | 682 | with open("testfiles/filelist.txt", 'w') as f: | 694 | with open("testfiles/filelist.txt", 'w') as f: |
1616 | 683 | f.write("+ **/1/2/1\n" | 695 | f.write("+ **/1/2/1\n" |
1617 | 684 | "- **/1/2\n" | 696 | "- **/1/2\n" |
1618 | 685 | "- **/select/1/1\n" | 697 | "- **/select/1/1\n" |
1619 | 686 | "- testfiles/select/1/3") | 698 | "- testfiles/select/1/3") |
1621 | 687 | self.backup("full", "testfiles/select/1", options=["--exclude-globbing-filelist=testfiles/filelist.txt"]) | 699 | self.backup("full", "testfiles/select/1", options=["--exclude-filelist=testfiles/filelist.txt"]) |
1622 | 688 | self.restore_and_check() | 700 | self.restore_and_check() |
1623 | 689 | 701 | ||
1624 | 690 | def test_commandline_asterisks_single_excludes_only(self): | 702 | def test_commandline_asterisks_single_excludes_only(self): |
1625 | @@ -738,43 +750,43 @@ | |||
1626 | 738 | restored = self.directory_tree_to_list_of_lists(restore_dir) | 750 | restored = self.directory_tree_to_list_of_lists(restore_dir) |
1627 | 739 | self.assertEqual(restored, [['2'], ['1']]) | 751 | self.assertEqual(restored, [['2'], ['1']]) |
1628 | 740 | 752 | ||
1631 | 741 | def test_exclude_globbing_filelist_trailing_slashes(self): | 753 | def test_exclude_filelist_trailing_slashes(self): |
1632 | 742 | """test_exclude_globbing_filelist_asterisks_none with trailing slashes.""" | 754 | """test_exclude_filelist_asterisks_none with trailing slashes.""" |
1633 | 743 | with open("testfiles/filelist.txt", 'w') as f: | 755 | with open("testfiles/filelist.txt", 'w') as f: |
1634 | 744 | f.write("+ testfiles/select/1/2/1/\n" | 756 | f.write("+ testfiles/select/1/2/1/\n" |
1635 | 745 | "- testfiles/select/1/2/\n" | 757 | "- testfiles/select/1/2/\n" |
1636 | 746 | "- testfiles/select/1/1/\n" | 758 | "- testfiles/select/1/1/\n" |
1637 | 747 | "- testfiles/select/1/3/") | 759 | "- testfiles/select/1/3/") |
1639 | 748 | self.backup("full", "testfiles/select/1", options=["--exclude-globbing-filelist=testfiles/filelist.txt"]) | 760 | self.backup("full", "testfiles/select/1", options=["--exclude-filelist=testfiles/filelist.txt"]) |
1640 | 749 | self.restore_and_check() | 761 | self.restore_and_check() |
1641 | 750 | 762 | ||
1642 | 751 | @unittest.expectedFailure | 763 | @unittest.expectedFailure |
1645 | 752 | def test_exclude_globbing_filelist_trailing_slashes_single_wildcards_excludes(self): | 764 | def test_exclude_filelist_trailing_slashes_single_wildcards_excludes(self): |
1646 | 753 | """test_exclude_globbing_filelist_trailing_slashes with single wildcards in excludes.""" | 765 | """test_exclude_filelist_trailing_slashes with single wildcards in excludes.""" |
1647 | 754 | # Todo: Bug #932482 (https://bugs.launchpad.net/duplicity/+bug/932482) | 766 | # Todo: Bug #932482 (https://bugs.launchpad.net/duplicity/+bug/932482) |
1648 | 755 | with open("testfiles/filelist.txt", 'w') as f: | 767 | with open("testfiles/filelist.txt", 'w') as f: |
1649 | 756 | f.write("+ testfiles/select/1/2/1/\n" | 768 | f.write("+ testfiles/select/1/2/1/\n" |
1650 | 757 | "- */select/1/2/\n" | 769 | "- */select/1/2/\n" |
1651 | 758 | "- testfiles/*/1/1/\n" | 770 | "- testfiles/*/1/1/\n" |
1652 | 759 | "- */*/1/3/") | 771 | "- */*/1/3/") |
1654 | 760 | self.backup("full", "testfiles/select/1", options=["--exclude-globbing-filelist=testfiles/filelist.txt"]) | 772 | self.backup("full", "testfiles/select/1", options=["--exclude-filelist=testfiles/filelist.txt"]) |
1655 | 761 | self.restore_and_check() | 773 | self.restore_and_check() |
1656 | 762 | 774 | ||
1657 | 763 | @unittest.expectedFailure | 775 | @unittest.expectedFailure |
1660 | 764 | def test_exclude_globbing_filelist_trailing_slashes_double_wildcards_excludes(self): | 776 | def test_exclude_filelist_trailing_slashes_double_wildcards_excludes(self): |
1661 | 765 | """test_exclude_globbing_filelist_trailing_slashes with double wildcards in excludes.""" | 777 | """test_exclude_filelist_trailing_slashes with double wildcards in excludes.""" |
1662 | 766 | # Todo: Bug #932482 (https://bugs.launchpad.net/duplicity/+bug/932482) | 778 | # Todo: Bug #932482 (https://bugs.launchpad.net/duplicity/+bug/932482) |
1663 | 767 | with open("testfiles/filelist.txt", 'w') as f: | 779 | with open("testfiles/filelist.txt", 'w') as f: |
1664 | 768 | f.write("+ testfiles/select/1/2/1/\n" | 780 | f.write("+ testfiles/select/1/2/1/\n" |
1665 | 769 | "- **/1/2/\n" | 781 | "- **/1/2/\n" |
1666 | 770 | "- **/1/1/\n" | 782 | "- **/1/1/\n" |
1667 | 771 | "- **/1/3/") | 783 | "- **/1/3/") |
1669 | 772 | self.backup("full", "testfiles/select/1", options=["--exclude-globbing-filelist=testfiles/filelist.txt"]) | 784 | self.backup("full", "testfiles/select/1", options=["--exclude-filelist=testfiles/filelist.txt"]) |
1670 | 773 | self.restore_and_check() | 785 | self.restore_and_check() |
1671 | 774 | 786 | ||
1672 | 775 | @unittest.expectedFailure | 787 | @unittest.expectedFailure |
1675 | 776 | def test_exclude_globbing_filelist_trailing_slashes_double_wildcards_excludes(self): | 788 | def test_exclude_filelist_trailing_slashes_double_wildcards_excludes(self): |
1676 | 777 | """test_exclude_globbing_filelist_trailing_slashes with double wildcards in excludes.""" | 789 | """test_exclude_filelist_trailing_slashes with double wildcards in excludes.""" |
1677 | 778 | # Todo: Bug #932482 (https://bugs.launchpad.net/duplicity/+bug/932482) and likely | 790 | # Todo: Bug #932482 (https://bugs.launchpad.net/duplicity/+bug/932482) and likely |
1678 | 779 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) | 791 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) |
1679 | 780 | with open("testfiles/filelist.txt", 'w') as f: | 792 | with open("testfiles/filelist.txt", 'w') as f: |
1680 | @@ -782,11 +794,11 @@ | |||
1681 | 782 | "- **/1/2/\n" | 794 | "- **/1/2/\n" |
1682 | 783 | "- **/1/1/\n" | 795 | "- **/1/1/\n" |
1683 | 784 | "- **/1/3/") | 796 | "- **/1/3/") |
1685 | 785 | self.backup("full", "testfiles/select/1", options=["--exclude-globbing-filelist=testfiles/filelist.txt"]) | 797 | self.backup("full", "testfiles/select/1", options=["--exclude-filelist=testfiles/filelist.txt"]) |
1686 | 786 | self.restore_and_check() | 798 | self.restore_and_check() |
1687 | 787 | 799 | ||
1688 | 788 | @unittest.expectedFailure | 800 | @unittest.expectedFailure |
1690 | 789 | def test_exclude_globbing_filelist_trailing_slashes_wildcards(self): | 801 | def test_exclude_filelist_trailing_slashes_wildcards(self): |
1691 | 790 | """test_commandline_asterisks_single_excludes_only with trailing slashes.""" | 802 | """test_commandline_asterisks_single_excludes_only with trailing slashes.""" |
1692 | 791 | # Todo: Bug #932482 (https://bugs.launchpad.net/duplicity/+bug/932482) | 803 | # Todo: Bug #932482 (https://bugs.launchpad.net/duplicity/+bug/932482) |
1693 | 792 | self.backup("full", "testfiles/select/1", | 804 | self.backup("full", "testfiles/select/1", |
1694 | @@ -796,7 +808,5 @@ | |||
1695 | 796 | "--exclude", "*/select/1/3/"]) | 808 | "--exclude", "*/select/1/3/"]) |
1696 | 797 | self.restore_and_check() | 809 | self.restore_and_check() |
1697 | 798 | 810 | ||
1698 | 799 | |||
1699 | 800 | |||
1700 | 801 | if __name__ == "__main__": | 811 | if __name__ == "__main__": |
1701 | 802 | unittest.main() | 812 | unittest.main() |
1702 | 803 | 813 | ||
1703 | === added file 'testing/stdin_test.sh' | |||
1704 | --- testing/stdin_test.sh 1970-01-01 00:00:00 +0000 | |||
1705 | +++ testing/stdin_test.sh 2015-03-12 21:50:57 +0000 | |||
1706 | @@ -0,0 +1,203 @@ | |||
1707 | 1 | #!/bin/sh | ||
1708 | 2 | # Script to show the current behaviour of duplicity's --include/exclude-filelist-stdin | ||
1709 | 3 | # function. This is currently hard to show in functional tests because the stdin-processing | ||
1710 | 4 | # logic is in the commandline parser. | ||
1711 | 5 | # (c) 2015 Aaron Whitehouse <aaron@whitehouse.kiwi.nz> | ||
1712 | 6 | # GPLv2 or any later version | ||
1713 | 7 | export PASSPHRASE=test | ||
1714 | 8 | |||
1715 | 9 | TESTDIR=/tmp/duplicity_test | ||
1716 | 10 | mkdir $TESTDIR | ||
1717 | 11 | SOURCEDIR=$TESTDIR/dup_source | ||
1718 | 12 | mkdir $SOURCEDIR | ||
1719 | 13 | TARGETDIR=$TESTDIR/dup_target | ||
1720 | 14 | mkdir $TARGETDIR | ||
1721 | 15 | RESTOREDIR=$TESTDIR/dup_restore | ||
1722 | 16 | mkdir $RESTOREDIR | ||
1723 | 17 | |||
1724 | 18 | tar -C $SOURCEDIR -xvf testfiles.tar.gz testfiles/select | ||
1725 | 19 | |||
1726 | 20 | DUPLICITY_CMD="../bin/duplicity" | ||
1727 | 21 | export PYTHONPATH=../ | ||
1728 | 22 | |||
1729 | 23 | $DUPLICITY_CMD -V | ||
1730 | 24 | |||
1731 | 25 | echo "===========" | ||
1732 | 26 | echo "FIRST TEST." | ||
1733 | 27 | echo "===========" | ||
1734 | 28 | TEST1="Test with exclude-globbing" | ||
1735 | 29 | echo "${TEST1}" | ||
1736 | 30 | echo "+ $SOURCEDIR/testfiles/select/1/1" > $TESTDIR/exclude.txt | ||
1737 | 31 | echo "- $SOURCEDIR/testfiles/select/1/2" >> $TESTDIR/exclude.txt | ||
1738 | 32 | echo "+ $SOURCEDIR/testfiles/select/1/3" >> $TESTDIR/exclude.txt | ||
1739 | 33 | echo "- $SOURCEDIR/testfiles/select/3" >> $TESTDIR/exclude.txt | ||
1740 | 34 | echo "- $SOURCEDIR/**" >> $TESTDIR/exclude.txt | ||
1741 | 35 | |||
1742 | 36 | $DUPLICITY_CMD --exclude-globbing-filelist $TESTDIR/exclude.txt $SOURCEDIR file://$TARGETDIR | ||
1743 | 37 | $DUPLICITY_CMD file://$TARGETDIR $RESTOREDIR | ||
1744 | 38 | echo "Number of files/folders:" | ||
1745 | 39 | OUTPUT_TEST1="$(find $RESTOREDIR | wc -l)" | ||
1746 | 40 | echo "${OUTPUT_TEST1}" | ||
1747 | 41 | |||
1748 | 42 | rm -r $TESTDIR | ||
1749 | 43 | |||
1750 | 44 | echo "===========" | ||
1751 | 45 | echo "SECOND TEST." | ||
1752 | 46 | echo "===========" | ||
1753 | 47 | TEST2="Test with exclude" | ||
1754 | 48 | echo "${TEST2}" | ||
1755 | 49 | |||
1756 | 50 | mkdir $TESTDIR | ||
1757 | 51 | mkdir $SOURCEDIR | ||
1758 | 52 | mkdir $TARGETDIR | ||
1759 | 53 | mkdir $RESTOREDIR | ||
1760 | 54 | tar -C $SOURCEDIR -xvf testfiles.tar.gz testfiles/select | ||
1761 | 55 | |||
1762 | 56 | echo "+ $SOURCEDIR/testfiles/select/1/1" > $TESTDIR/exclude.txt | ||
1763 | 57 | echo "- $SOURCEDIR/testfiles/select/1/2" >> $TESTDIR/exclude.txt | ||
1764 | 58 | echo "+ $SOURCEDIR/testfiles/select/1/3" >> $TESTDIR/exclude.txt | ||
1765 | 59 | echo "- $SOURCEDIR/testfiles/select/3" >> $TESTDIR/exclude.txt | ||
1766 | 60 | echo "- $SOURCEDIR/**" >> $TESTDIR/exclude.txt | ||
1767 | 61 | |||
1768 | 62 | $DUPLICITY_CMD --exclude-filelist $TESTDIR/exclude.txt $SOURCEDIR file://$TARGETDIR | ||
1769 | 63 | $DUPLICITY_CMD file://$TARGETDIR $RESTOREDIR | ||
1770 | 64 | echo "Number of files/folders:" | ||
1771 | 65 | find $RESTOREDIR | wc -l | ||
1772 | 66 | OUTPUT_TEST2="$(find $RESTOREDIR | wc -l)" | ||
1773 | 67 | echo "${OUTPUT_TEST2}" | ||
1774 | 68 | |||
1775 | 69 | rm -r $TESTDIR | ||
1776 | 70 | |||
1777 | 71 | echo "===========" | ||
1778 | 72 | echo "THIRD TEST." | ||
1779 | 73 | echo "===========" | ||
1780 | 74 | TEST3="Test with stdin with exclude" | ||
1781 | 75 | echo "${TEST3}" | ||
1782 | 76 | mkdir $TESTDIR | ||
1783 | 77 | mkdir $SOURCEDIR | ||
1784 | 78 | mkdir $TARGETDIR | ||
1785 | 79 | mkdir $RESTOREDIR | ||
1786 | 80 | tar -C $SOURCEDIR -xvf testfiles.tar.gz testfiles/select | ||
1787 | 81 | |||
1788 | 82 | echo "+ $SOURCEDIR/testfiles/select/1/1" > $TESTDIR/exclude.txt | ||
1789 | 83 | echo "- $SOURCEDIR/testfiles/select/1/2" >> $TESTDIR/exclude.txt | ||
1790 | 84 | echo "+ $SOURCEDIR/testfiles/select/1/3" >> $TESTDIR/exclude.txt | ||
1791 | 85 | echo "- $SOURCEDIR/testfiles/select/3" >> $TESTDIR/exclude.txt | ||
1792 | 86 | echo "- $SOURCEDIR/**" >> $TESTDIR/exclude.txt | ||
1793 | 87 | |||
1794 | 88 | cat $TESTDIR/exclude.txt | $DUPLICITY_CMD --exclude-filelist-stdin $SOURCEDIR file://$TARGETDIR | ||
1795 | 89 | $DUPLICITY_CMD file://$TARGETDIR $RESTOREDIR | ||
1796 | 90 | echo "Number of files/folders:" | ||
1797 | 91 | OUTPUT_TEST3="$(find $RESTOREDIR | wc -l)" | ||
1798 | 92 | echo "${OUTPUT_TEST3}" | ||
1799 | 93 | |||
1800 | 94 | rm -r $TESTDIR | ||
1801 | 95 | |||
1802 | 96 | echo "===========" | ||
1803 | 97 | echo "FOURTH TEST." | ||
1804 | 98 | echo "===========" | ||
1805 | 99 | TEST4="Test with nothing" | ||
1806 | 100 | echo "${TEST4}" | ||
1807 | 101 | mkdir $TESTDIR | ||
1808 | 102 | mkdir $SOURCEDIR | ||
1809 | 103 | mkdir $TARGETDIR | ||
1810 | 104 | mkdir $RESTOREDIR | ||
1811 | 105 | tar -C $SOURCEDIR -xvf testfiles.tar.gz testfiles/select | ||
1812 | 106 | |||
1813 | 107 | echo "+ $SOURCEDIR/testfiles/select/1/1" > $TESTDIR/exclude.txt | ||
1814 | 108 | echo "- $SOURCEDIR/testfiles/select/1/2" >> $TESTDIR/exclude.txt | ||
1815 | 109 | echo "+ $SOURCEDIR/testfiles/select/1/3" >> $TESTDIR/exclude.txt | ||
1816 | 110 | echo "- $SOURCEDIR/testfiles/select/3" >> $TESTDIR/exclude.txt | ||
1817 | 111 | echo "- $SOURCEDIR/**" >> $TESTDIR/exclude.txt | ||
1818 | 112 | |||
1819 | 113 | $DUPLICITY_CMD $SOURCEDIR file://$TARGETDIR | ||
1820 | 114 | $DUPLICITY_CMD file://$TARGETDIR $RESTOREDIR | ||
1821 | 115 | echo "Number of files/folders:" | ||
1822 | 116 | OUTPUT_TEST4="$(find $RESTOREDIR | wc -l)" | ||
1823 | 117 | echo "${OUTPUT_TEST4}" | ||
1824 | 118 | |||
1825 | 119 | rm -r $TESTDIR | ||
1826 | 120 | |||
1827 | 121 | echo "===========" | ||
1828 | 122 | echo "FIFTH TEST." | ||
1829 | 123 | echo "===========" | ||
1830 | 124 | TEST5="Test using /dev/stdin as a substitute for --exclude-filelist-stdin" | ||
1831 | 125 | echo "${TEST5}" | ||
1832 | 126 | mkdir $TESTDIR | ||
1833 | 127 | mkdir $SOURCEDIR | ||
1834 | 128 | mkdir $TARGETDIR | ||
1835 | 129 | mkdir $RESTOREDIR | ||
1836 | 130 | tar -C $SOURCEDIR -xvf testfiles.tar.gz testfiles/select | ||
1837 | 131 | |||
1838 | 132 | echo "+ $SOURCEDIR/testfiles/select/1/1" > $TESTDIR/exclude.txt | ||
1839 | 133 | echo "- $SOURCEDIR/testfiles/select/1/2" >> $TESTDIR/exclude.txt | ||
1840 | 134 | echo "+ $SOURCEDIR/testfiles/select/1/3" >> $TESTDIR/exclude.txt | ||
1841 | 135 | echo "- $SOURCEDIR/testfiles/select/3" >> $TESTDIR/exclude.txt | ||
1842 | 136 | echo "- $SOURCEDIR/**" >> $TESTDIR/exclude.txt | ||
1843 | 137 | |||
1844 | 138 | cat $TESTDIR/exclude.txt | $DUPLICITY_CMD --exclude-filelist /dev/stdin $SOURCEDIR file://$TARGETDIR | ||
1845 | 139 | $DUPLICITY_CMD file://$TARGETDIR $RESTOREDIR | ||
1846 | 140 | echo "Number of files/folders:" | ||
1847 | 141 | OUTPUT_TEST5="$(find $RESTOREDIR | wc -l)" | ||
1848 | 142 | echo "${OUTPUT_TEST5}" | ||
1849 | 143 | |||
1850 | 144 | rm -r $TESTDIR | ||
1851 | 145 | |||
1852 | 146 | echo "===========" | ||
1853 | 147 | echo "SIXTH TEST." | ||
1854 | 148 | echo "===========" | ||
1855 | 149 | TEST6="Test with stdin with include" | ||
1856 | 150 | echo "${TEST6}" | ||
1857 | 151 | mkdir $TESTDIR | ||
1858 | 152 | mkdir $SOURCEDIR | ||
1859 | 153 | mkdir $TARGETDIR | ||
1860 | 154 | mkdir $RESTOREDIR | ||
1861 | 155 | tar -C $SOURCEDIR -xvf testfiles.tar.gz testfiles/select | ||
1862 | 156 | |||
1863 | 157 | echo "+ $SOURCEDIR/testfiles/select/1/1" > $TESTDIR/include.txt | ||
1864 | 158 | echo "- $SOURCEDIR/testfiles/select/1/2" >> $TESTDIR/include.txt | ||
1865 | 159 | echo "+ $SOURCEDIR/testfiles/select/1/3" >> $TESTDIR/include.txt | ||
1866 | 160 | echo "- $SOURCEDIR/testfiles/select/3" >> $TESTDIR/include.txt | ||
1867 | 161 | echo "- $SOURCEDIR/**" >> $TESTDIR/include.txt | ||
1868 | 162 | |||
1869 | 163 | cat $TESTDIR/include.txt | $DUPLICITY_CMD --include-filelist-stdin $SOURCEDIR file://$TARGETDIR | ||
1870 | 164 | $DUPLICITY_CMD file://$TARGETDIR $RESTOREDIR | ||
1871 | 165 | echo "Number of files/folders:" | ||
1872 | 166 | OUTPUT_TEST6="$(find $RESTOREDIR | wc -l)" | ||
1873 | 167 | echo "${OUTPUT_TEST6}" | ||
1874 | 168 | |||
1875 | 169 | rm -r $TESTDIR | ||
1876 | 170 | |||
1877 | 171 | echo "============" | ||
1878 | 172 | echo "SEVENTH TEST." | ||
1879 | 173 | echo "============" | ||
1880 | 174 | TEST7="Test using /dev/stdin as a substitute for --include-filelist-stdin" | ||
1881 | 175 | echo "${TEST7}" | ||
1882 | 176 | mkdir $TESTDIR | ||
1883 | 177 | mkdir $SOURCEDIR | ||
1884 | 178 | mkdir $TARGETDIR | ||
1885 | 179 | mkdir $RESTOREDIR | ||
1886 | 180 | tar -C $SOURCEDIR -xvf testfiles.tar.gz testfiles/select | ||
1887 | 181 | |||
1888 | 182 | echo "+ $SOURCEDIR/testfiles/select/1/1" > $TESTDIR/include.txt | ||
1889 | 183 | echo "- $SOURCEDIR/testfiles/select/1/2" >> $TESTDIR/include.txt | ||
1890 | 184 | echo "+ $SOURCEDIR/testfiles/select/1/3" >> $TESTDIR/include.txt | ||
1891 | 185 | echo "- $SOURCEDIR/testfiles/select/3" >> $TESTDIR/include.txt | ||
1892 | 186 | echo "- $SOURCEDIR/**" >> $TESTDIR/include.txt | ||
1893 | 187 | |||
1894 | 188 | cat $TESTDIR/include.txt | $DUPLICITY_CMD --include-filelist /dev/stdin $SOURCEDIR file://$TARGETDIR | ||
1895 | 189 | $DUPLICITY_CMD file://$TARGETDIR $RESTOREDIR | ||
1896 | 190 | echo "Number of files/folders:" | ||
1897 | 191 | OUTPUT_TEST7="$(find $RESTOREDIR | wc -l)" | ||
1898 | 192 | echo "${OUTPUT_TEST7}" | ||
1899 | 193 | |||
1900 | 194 | rm -r $TESTDIR | ||
1901 | 195 | |||
1902 | 196 | unset PASSPHRASE | ||
1903 | 197 | echo "1.""${TEST1}" "${OUTPUT_TEST1}" | ||
1904 | 198 | echo "2.""${TEST2}" "${OUTPUT_TEST2}" | ||
1905 | 199 | echo "3.""${TEST3}" "${OUTPUT_TEST3}" | ||
1906 | 200 | echo "4.""${TEST4}" "${OUTPUT_TEST4}" | ||
1907 | 201 | echo "5.""${TEST5}" "${OUTPUT_TEST5}" | ||
1908 | 202 | echo "6.""${TEST6}" "${OUTPUT_TEST6}" | ||
1909 | 203 | echo "7.""${TEST7}" "${OUTPUT_TEST7}" | ||
1910 | 0 | 204 | ||
1911 | === modified file 'testing/unit/test_selection.py' | |||
1912 | --- testing/unit/test_selection.py 2015-02-01 17:37:37 +0000 | |||
1913 | +++ testing/unit/test_selection.py 2015-03-12 21:50:57 +0000 | |||
1914 | @@ -102,311 +102,6 @@ | |||
1915 | 102 | assert sf2(self.makeext("what/ever.py")) == 0 | 102 | assert sf2(self.makeext("what/ever.py")) == 0 |
1916 | 103 | assert sf2(self.makeext("what/ever.py/foo")) == 0 | 103 | assert sf2(self.makeext("what/ever.py/foo")) == 0 |
1917 | 104 | 104 | ||
1918 | 105 | def testFilelistInclude(self): | ||
1919 | 106 | """Test included filelist""" | ||
1920 | 107 | fp = StringIO.StringIO(""" | ||
1921 | 108 | testfiles/select/1/2 | ||
1922 | 109 | testfiles/select/1 | ||
1923 | 110 | testfiles/select/1/2/3 | ||
1924 | 111 | testfiles/select/3/3/2""") | ||
1925 | 112 | sf = self.Select.filelist_get_sf(fp, 1, "test") | ||
1926 | 113 | assert sf(self.root) == 1 | ||
1927 | 114 | assert sf(self.makeext("1")) == 1 | ||
1928 | 115 | assert sf(self.makeext("1/1")) is None | ||
1929 | 116 | assert sf(self.makeext("1/2/3")) == 1 | ||
1930 | 117 | assert sf(self.makeext("2/2")) is None | ||
1931 | 118 | assert sf(self.makeext("3")) == 1 | ||
1932 | 119 | assert sf(self.makeext("3/3")) == 1 | ||
1933 | 120 | assert sf(self.makeext("3/3/3")) is None | ||
1934 | 121 | |||
1935 | 122 | def test_filelist_include_1_trailing_white_space(self): | ||
1936 | 123 | """Test trailing whitespace is ignored in included filelist (1 space)""" | ||
1937 | 124 | fp = StringIO.StringIO("testfiles/select/1/2\n" | ||
1938 | 125 | "testfiles/select/1 \n" | ||
1939 | 126 | "testfiles/select/1/2/3\n" | ||
1940 | 127 | "testfiles/select/3/3/2") | ||
1941 | 128 | sf = self.Select.filelist_get_sf(fp, 1, "test") | ||
1942 | 129 | assert sf(self.root) == 1 | ||
1943 | 130 | assert sf(self.makeext("1")) == 1 | ||
1944 | 131 | assert sf(self.makeext("1/1")) is None | ||
1945 | 132 | assert sf(self.makeext("1/2/3")) == 1 | ||
1946 | 133 | assert sf(self.makeext("2/2")) is None | ||
1947 | 134 | assert sf(self.makeext("3")) == 1 | ||
1948 | 135 | assert sf(self.makeext("3/3")) == 1 | ||
1949 | 136 | assert sf(self.makeext("3/3/3")) is None | ||
1950 | 137 | |||
1951 | 138 | def test_filelist_include_2_trailing_white_spaces(self): | ||
1952 | 139 | """Test trailing whitespace is ignored in included filelist (2 space)""" | ||
1953 | 140 | fp = StringIO.StringIO("testfiles/select/1/2\n" | ||
1954 | 141 | "testfiles/select/1\n" | ||
1955 | 142 | "testfiles/select/1/2/3 \n" | ||
1956 | 143 | "testfiles/select/3/3/2") | ||
1957 | 144 | sf = self.Select.filelist_get_sf(fp, 1, "test") | ||
1958 | 145 | assert sf(self.root) == 1 | ||
1959 | 146 | assert sf(self.makeext("1")) == 1 | ||
1960 | 147 | assert sf(self.makeext("1/1")) is None | ||
1961 | 148 | assert sf(self.makeext("1/2/3")) == 1 | ||
1962 | 149 | assert sf(self.makeext("2/2")) is None | ||
1963 | 150 | assert sf(self.makeext("3")) == 1 | ||
1964 | 151 | assert sf(self.makeext("3/3")) == 1 | ||
1965 | 152 | assert sf(self.makeext("3/3/3")) is None | ||
1966 | 153 | |||
1967 | 154 | def test_filelist_include_1_leading_white_space(self): | ||
1968 | 155 | """Test leading whitespace is ignored in included filelist (1 space)""" | ||
1969 | 156 | fp = StringIO.StringIO(" testfiles/select/1/2\n" | ||
1970 | 157 | "testfiles/select/1\n" | ||
1971 | 158 | "testfiles/select/1/2/3\n" | ||
1972 | 159 | "testfiles/select/3/3/2") | ||
1973 | 160 | sf = self.Select.filelist_get_sf(fp, 1, "test") | ||
1974 | 161 | assert sf(self.root) == 1 | ||
1975 | 162 | assert sf(self.makeext("1")) == 1 | ||
1976 | 163 | assert sf(self.makeext("1/1")) is None | ||
1977 | 164 | assert sf(self.makeext("1/2/3")) == 1 | ||
1978 | 165 | assert sf(self.makeext("2/2")) is None | ||
1979 | 166 | assert sf(self.makeext("3")) == 1 | ||
1980 | 167 | assert sf(self.makeext("3/3")) == 1 | ||
1981 | 168 | assert sf(self.makeext("3/3/3")) is None | ||
1982 | 169 | |||
1983 | 170 | def test_filelist_include_2_leading_white_spaces(self): | ||
1984 | 171 | """Test leading whitespace is ignored in included filelist (1 space)""" | ||
1985 | 172 | fp = StringIO.StringIO("testfiles/select/1/2\n" | ||
1986 | 173 | "testfiles/select/1\n" | ||
1987 | 174 | "testfiles/select/1/2/3\n" | ||
1988 | 175 | " testfiles/select/3/3/2") | ||
1989 | 176 | sf = self.Select.filelist_get_sf(fp, 1, "test") | ||
1990 | 177 | assert sf(self.root) == 1 | ||
1991 | 178 | assert sf(self.makeext("1")) == 1 | ||
1992 | 179 | assert sf(self.makeext("1/1")) is None | ||
1993 | 180 | assert sf(self.makeext("1/2/3")) == 1 | ||
1994 | 181 | assert sf(self.makeext("2/2")) is None | ||
1995 | 182 | assert sf(self.makeext("3")) == 1 | ||
1996 | 183 | assert sf(self.makeext("3/3")) == 1 | ||
1997 | 184 | assert sf(self.makeext("3/3/3")) is None | ||
1998 | 185 | |||
1999 | 186 | def testFilelistIncludeNullSep(self): | ||
2000 | 187 | """Test included filelist but with null_separator set""" | ||
2001 | 188 | fp = StringIO.StringIO("""\0testfiles/select/1/2\0testfiles/select/1\0testfiles/select/1/2/3\0testfiles/select/3/3/2\0testfiles/select/hello\nthere\0""") | ||
2002 | 189 | self.set_global('null_separator', 1) | ||
2003 | 190 | sf = self.Select.filelist_get_sf(fp, 1, "test") | ||
2004 | 191 | assert sf(self.root) == 1 | ||
2005 | 192 | assert sf(self.makeext("1")) == 1 | ||
2006 | 193 | assert sf(self.makeext("1/1")) is None | ||
2007 | 194 | assert sf(self.makeext("1/2/3")) == 1 | ||
2008 | 195 | assert sf(self.makeext("2/2")) is None | ||
2009 | 196 | assert sf(self.makeext("3")) == 1 | ||
2010 | 197 | assert sf(self.makeext("3/3")) == 1 | ||
2011 | 198 | assert sf(self.makeext("3/3/3")) is None | ||
2012 | 199 | assert sf(self.makeext("hello\nthere")) == 1 | ||
2013 | 200 | |||
2014 | 201 | def testFilelistExclude(self): | ||
2015 | 202 | """Test included filelist""" | ||
2016 | 203 | fp = StringIO.StringIO(""" | ||
2017 | 204 | testfiles/select/1/2 | ||
2018 | 205 | testfiles/select/1 | ||
2019 | 206 | this is a badly formed line which should be ignored | ||
2020 | 207 | |||
2021 | 208 | testfiles/select/1/2/3 | ||
2022 | 209 | testfiles/select/3/3/2""") | ||
2023 | 210 | sf = self.Select.filelist_get_sf(fp, 0, "test") | ||
2024 | 211 | assert sf(self.root) is None | ||
2025 | 212 | assert sf(self.makeext("1")) == 0 | ||
2026 | 213 | assert sf(self.makeext("1/1")) == 0 | ||
2027 | 214 | assert sf(self.makeext("1/2/3")) == 0 | ||
2028 | 215 | assert sf(self.makeext("2/2")) is None | ||
2029 | 216 | assert sf(self.makeext("3")) is None | ||
2030 | 217 | assert sf(self.makeext("3/3/2")) == 0 | ||
2031 | 218 | assert sf(self.makeext("3/3/3")) is None | ||
2032 | 219 | |||
2033 | 220 | def testFilelistInclude2(self): | ||
2034 | 221 | """testFilelistInclude2 - with modifiers""" | ||
2035 | 222 | fp = StringIO.StringIO(""" | ||
2036 | 223 | testfiles/select/1/1 | ||
2037 | 224 | - testfiles/select/1/2 | ||
2038 | 225 | + testfiles/select/1/3 | ||
2039 | 226 | - testfiles/select/3""") | ||
2040 | 227 | sf = self.Select.filelist_get_sf(fp, 1, "test1") | ||
2041 | 228 | assert sf(self.makeext("1")) == 1 | ||
2042 | 229 | assert sf(self.makeext("1/1")) == 1 | ||
2043 | 230 | assert sf(self.makeext("1/1/2")) is None | ||
2044 | 231 | assert sf(self.makeext("1/2")) == 0 | ||
2045 | 232 | assert sf(self.makeext("1/2/3")) == 0 | ||
2046 | 233 | assert sf(self.makeext("1/3")) == 1 | ||
2047 | 234 | assert sf(self.makeext("2")) is None | ||
2048 | 235 | assert sf(self.makeext("3")) == 0 | ||
2049 | 236 | |||
2050 | 237 | def testFilelistInclude3(self): | ||
2051 | 238 | """testFilelistInclude3 - with modifiers to check - works as expected""" | ||
2052 | 239 | fp = StringIO.StringIO(""" | ||
2053 | 240 | testfiles/select/1/1 | ||
2054 | 241 | - testfiles/select/1/2 | ||
2055 | 242 | + testfiles/select/1/3 | ||
2056 | 243 | testfiles/select/1""") | ||
2057 | 244 | sf = self.Select.filelist_get_sf(fp, 1, "test1") | ||
2058 | 245 | assert sf(self.makeext("1")) == 1 | ||
2059 | 246 | assert sf(self.makeext("1/1")) == 1 | ||
2060 | 247 | assert sf(self.makeext("1/1/2")) is None | ||
2061 | 248 | assert sf(self.makeext("1/2")) == 0 | ||
2062 | 249 | assert sf(self.makeext("1/2/3")) == 0 | ||
2063 | 250 | assert sf(self.makeext("1/3")) == 1 | ||
2064 | 251 | assert sf(self.makeext("2")) is None | ||
2065 | 252 | assert sf(self.makeext("3")) is None | ||
2066 | 253 | |||
2067 | 254 | # def test_filelist_include_excluded_folder_with_included_contents(self): | ||
2068 | 255 | # """Check that excluded folder is included if subfolder is included at higher priority. """ | ||
2069 | 256 | # # ToDo - currently fails. 1/2 should be included (scanned) because 1/2/1 is. Commandline --include/--exclude | ||
2070 | 257 | # # ToDo - and globbing filelists work this way | ||
2071 | 258 | # fp = StringIO.StringIO(""" | ||
2072 | 259 | # + testfiles/select/1/2/1 | ||
2073 | 260 | # - testfiles/select/1/2 | ||
2074 | 261 | # + testfiles/select/1/3 | ||
2075 | 262 | # testfiles/select/1""") | ||
2076 | 263 | # sf = self.Select.filelist_get_sf(fp, 1, "test1") | ||
2077 | 264 | # assert sf(self.makeext("1")) == 1 | ||
2078 | 265 | # assert sf(self.makeext("1/1")) is None | ||
2079 | 266 | # assert sf(self.makeext("1/2/1")) == 1 | ||
2080 | 267 | # assert sf(self.makeext("1/2")) == 0 # ToDo - what should this return? | ||
2081 | 268 | # assert sf(self.makeext("1/2/3")) == 0 | ||
2082 | 269 | # assert sf(self.makeext("1/3")) == 1 | ||
2083 | 270 | # assert sf(self.makeext("2")) is None | ||
2084 | 271 | # assert sf(self.makeext("3")) is None | ||
2085 | 272 | |||
2086 | 273 | def testFilelistExclude2(self): | ||
2087 | 274 | """testFilelistExclude2 - with modifiers""" | ||
2088 | 275 | fp = StringIO.StringIO(""" | ||
2089 | 276 | testfiles/select/1/1 | ||
2090 | 277 | - testfiles/select/1/2 | ||
2091 | 278 | + testfiles/select/1/3 | ||
2092 | 279 | - testfiles/select/3""") | ||
2093 | 280 | sf = self.Select.filelist_get_sf(fp, 0, "test1") | ||
2094 | 281 | sf_val1 = sf(self.root) | ||
2095 | 282 | assert sf_val1 == 1 or sf_val1 is None # either is OK | ||
2096 | 283 | sf_val2 = sf(self.makeext("1")) | ||
2097 | 284 | assert sf_val2 == 1 or sf_val2 is None | ||
2098 | 285 | assert sf(self.makeext("1/1")) == 0 | ||
2099 | 286 | assert sf(self.makeext("1/1/2")) == 0 | ||
2100 | 287 | assert sf(self.makeext("1/2")) == 0 | ||
2101 | 288 | assert sf(self.makeext("1/2/3")) == 0 | ||
2102 | 289 | assert sf(self.makeext("1/3")) == 1 | ||
2103 | 290 | assert sf(self.makeext("2")) is None | ||
2104 | 291 | assert sf(self.makeext("3")) == 0 | ||
2105 | 292 | |||
2106 | 293 | def test_filelist_exclude_2_with_trailing_white_space(self): | ||
2107 | 294 | """testFilelistExclude2 with modifiers - test trailing whitespace is ignored (1 and 2 spaces)""" | ||
2108 | 295 | fp = StringIO.StringIO("testfiles/select/1/1\n" | ||
2109 | 296 | "- testfiles/select/1/2 \n" | ||
2110 | 297 | "+ testfiles/select/1/3 \n" | ||
2111 | 298 | "- testfiles/select/3") | ||
2112 | 299 | sf = self.Select.filelist_get_sf(fp, 0, "test1") | ||
2113 | 300 | sf_val1 = sf(self.root) | ||
2114 | 301 | assert sf_val1 == 1 or sf_val1 is None # either is OK | ||
2115 | 302 | sf_val2 = sf(self.makeext("1")) | ||
2116 | 303 | assert sf_val2 == 1 or sf_val2 is None | ||
2117 | 304 | assert sf(self.makeext("1/1")) == 0 | ||
2118 | 305 | assert sf(self.makeext("1/1/2")) == 0 | ||
2119 | 306 | assert sf(self.makeext("1/2")) == 0 | ||
2120 | 307 | assert sf(self.makeext("1/2/3")) == 0 | ||
2121 | 308 | assert sf(self.makeext("1/3")) == 1 | ||
2122 | 309 | assert sf(self.makeext("2")) is None | ||
2123 | 310 | assert sf(self.makeext("3")) == 0 | ||
2124 | 311 | |||
2125 | 312 | def test_filelist_exclude_with_single_quotes(self): | ||
2126 | 313 | """testFilelistExclude2 with modifiers - test unnecessary single quotes are ignored""" | ||
2127 | 314 | fp = StringIO.StringIO("testfiles/select/1/1\n" | ||
2128 | 315 | "- testfiles/select/1/2\n" | ||
2129 | 316 | "+ 'testfiles/select/1/3'\n" | ||
2130 | 317 | "- testfiles/select/3") | ||
2131 | 318 | sf = self.Select.filelist_get_sf(fp, 0, "test1") | ||
2132 | 319 | sf_val1 = sf(self.root) | ||
2133 | 320 | assert sf_val1 == 1 or sf_val1 is None # either is OK | ||
2134 | 321 | sf_val2 = sf(self.makeext("1")) | ||
2135 | 322 | assert sf_val2 == 1 or sf_val2 is None | ||
2136 | 323 | assert sf(self.makeext("1/1")) == 0 | ||
2137 | 324 | assert sf(self.makeext("1/1/2")) == 0 | ||
2138 | 325 | assert sf(self.makeext("1/2")) == 0 | ||
2139 | 326 | assert sf(self.makeext("1/2/3")) == 0 | ||
2140 | 327 | assert sf(self.makeext("1/3")) == 1 | ||
2141 | 328 | assert sf(self.makeext("2")) is None | ||
2142 | 329 | assert sf(self.makeext("3")) == 0 | ||
2143 | 330 | |||
2144 | 331 | def test_filelist_exclude_with_full_line_comment(self): | ||
2145 | 332 | """testFilelistExclude2 with modifiers - test full-line comment is ignored""" | ||
2146 | 333 | fp = StringIO.StringIO("testfiles/select/1/1\n" | ||
2147 | 334 | "- testfiles/select/1/2\n" | ||
2148 | 335 | "# This is a full-line comment\n" | ||
2149 | 336 | "+ testfiles/select/1/3\n" | ||
2150 | 337 | "- testfiles/select/3") | ||
2151 | 338 | sf = self.Select.filelist_get_sf(fp, 0, "test1") | ||
2152 | 339 | sf_val1 = sf(self.root) | ||
2153 | 340 | assert sf_val1 == 1 or sf_val1 is None # either is OK | ||
2154 | 341 | sf_val2 = sf(self.makeext("1")) | ||
2155 | 342 | assert sf_val2 == 1 or sf_val2 is None | ||
2156 | 343 | assert sf(self.makeext("1/1")) == 0 | ||
2157 | 344 | assert sf(self.makeext("1/1/2")) == 0 | ||
2158 | 345 | assert sf(self.makeext("1/2")) == 0 | ||
2159 | 346 | assert sf(self.makeext("1/2/3")) == 0 | ||
2160 | 347 | assert sf(self.makeext("1/3")) == 1 | ||
2161 | 348 | assert sf(self.makeext("2")) is None | ||
2162 | 349 | assert sf(self.makeext("3")) == 0 | ||
2163 | 350 | |||
2164 | 351 | def test_filelist_exclude_with_blank_line(self): | ||
2165 | 352 | """testFilelistExclude2 with modifiers - test blank line is ignored""" | ||
2166 | 353 | fp = StringIO.StringIO("testfiles/select/1/1\n" | ||
2167 | 354 | "- testfiles/select/1/2\n" | ||
2168 | 355 | "\n" | ||
2169 | 356 | "+ testfiles/select/1/3\n" | ||
2170 | 357 | "- testfiles/select/3") | ||
2171 | 358 | sf = self.Select.filelist_get_sf(fp, 0, "test1") | ||
2172 | 359 | sf_val1 = sf(self.root) | ||
2173 | 360 | assert sf_val1 == 1 or sf_val1 is None # either is OK | ||
2174 | 361 | sf_val2 = sf(self.makeext("1")) | ||
2175 | 362 | assert sf_val2 == 1 or sf_val2 is None | ||
2176 | 363 | assert sf(self.makeext("1/1")) == 0 | ||
2177 | 364 | assert sf(self.makeext("1/1/2")) == 0 | ||
2178 | 365 | assert sf(self.makeext("1/2")) == 0 | ||
2179 | 366 | assert sf(self.makeext("1/2/3")) == 0 | ||
2180 | 367 | assert sf(self.makeext("1/3")) == 1 | ||
2181 | 368 | assert sf(self.makeext("2")) is None | ||
2182 | 369 | assert sf(self.makeext("3")) == 0 | ||
2183 | 370 | |||
2184 | 371 | def test_filelist_exclude_with_blank_line_and_whitespace(self): | ||
2185 | 372 | """testFilelistExclude2 with modifiers - test blank line with whitespace is ignored""" | ||
2186 | 373 | fp = StringIO.StringIO("testfiles/select/1/1\n" | ||
2187 | 374 | "- testfiles/select/1/2\n" | ||
2188 | 375 | " \n" | ||
2189 | 376 | "+ testfiles/select/1/3\n" | ||
2190 | 377 | "- testfiles/select/3") | ||
2191 | 378 | sf = self.Select.filelist_get_sf(fp, 0, "test1") | ||
2192 | 379 | sf_val1 = sf(self.root) | ||
2193 | 380 | assert sf_val1 == 1 or sf_val1 is None # either is OK | ||
2194 | 381 | sf_val2 = sf(self.makeext("1")) | ||
2195 | 382 | assert sf_val2 == 1 or sf_val2 is None | ||
2196 | 383 | assert sf(self.makeext("1/1")) == 0 | ||
2197 | 384 | assert sf(self.makeext("1/1/2")) == 0 | ||
2198 | 385 | assert sf(self.makeext("1/2")) == 0 | ||
2199 | 386 | assert sf(self.makeext("1/2/3")) == 0 | ||
2200 | 387 | assert sf(self.makeext("1/3")) == 1 | ||
2201 | 388 | assert sf(self.makeext("2")) is None | ||
2202 | 389 | assert sf(self.makeext("3")) == 0 | ||
2203 | 390 | |||
2204 | 391 | def test_filelist_exclude_with_double_quotes(self): | ||
2205 | 392 | """testFilelistExclude2 with modifiers - test unnecessary double quotes are ignored""" | ||
2206 | 393 | fp = StringIO.StringIO('testfiles/select/1/1\n' | ||
2207 | 394 | '- testfiles/select/1/2\n' | ||
2208 | 395 | '+ "testfiles/select/1/3"\n' | ||
2209 | 396 | '- testfiles/select/3') | ||
2210 | 397 | sf = self.Select.filelist_get_sf(fp, 0, "test1") | ||
2211 | 398 | sf_val1 = sf(self.root) | ||
2212 | 399 | assert sf_val1 == 1 or sf_val1 is None # either is OK | ||
2213 | 400 | sf_val2 = sf(self.makeext("1")) | ||
2214 | 401 | assert sf_val2 == 1 or sf_val2 is None | ||
2215 | 402 | assert sf(self.makeext("1/1")) == 0 | ||
2216 | 403 | assert sf(self.makeext("1/1/2")) == 0 | ||
2217 | 404 | assert sf(self.makeext("1/2")) == 0 | ||
2218 | 405 | assert sf(self.makeext("1/2/3")) == 0 | ||
2219 | 406 | assert sf(self.makeext("1/3")) == 1 | ||
2220 | 407 | assert sf(self.makeext("2")) is None | ||
2221 | 408 | assert sf(self.makeext("3")) == 0 | ||
2222 | 409 | |||
2223 | 410 | def testGlobRE(self): | 105 | def testGlobRE(self): |
2224 | 411 | """testGlobRE - test translation of shell pattern to regular exp""" | 106 | """testGlobRE - test translation of shell pattern to regular exp""" |
2225 | 412 | assert self.Select.glob_to_re("hello") == "hello" | 107 | assert self.Select.glob_to_re("hello") == "hello" |
2226 | @@ -456,12 +151,6 @@ | |||
2227 | 456 | assert select.glob_get_sf("**", 0)(root) == 0 | 151 | assert select.glob_get_sf("**", 0)(root) == 0 |
2228 | 457 | assert select.glob_get_sf("/foo/*", 0)(root) is None | 152 | assert select.glob_get_sf("/foo/*", 0)(root) is None |
2229 | 458 | 153 | ||
2230 | 459 | assert select.filelist_get_sf(StringIO.StringIO("/"), 1, "test")(root) == 1 | ||
2231 | 460 | assert select.filelist_get_sf(StringIO.StringIO("/foo/bar"), 1, "test")(root) == 1 | ||
2232 | 461 | assert select.filelist_get_sf(StringIO.StringIO("/"), 0, "test")(root) == 0 | ||
2233 | 462 | assert select.filelist_get_sf(StringIO.StringIO("/foo/bar"), 0, | ||
2234 | 463 | "test")(root) is None | ||
2235 | 464 | |||
2236 | 465 | def testOtherFilesystems(self): | 154 | def testOtherFilesystems(self): |
2237 | 466 | """Test to see if --exclude-other-filesystems works correctly""" | 155 | """Test to see if --exclude-other-filesystems works correctly""" |
2238 | 467 | root = Path("/") | 156 | root = Path("/") |
2239 | @@ -531,9 +220,9 @@ | |||
2240 | 531 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 220 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2241 | 532 | ('1', '1', '3')]) | 221 | ('1', '1', '3')]) |
2242 | 533 | 222 | ||
2244 | 534 | def test_globbing_filelist(self): | 223 | def test_filelist(self): |
2245 | 535 | """Filelist glob test similar to above testParse2""" | 224 | """Filelist glob test similar to above testParse2""" |
2247 | 536 | self.ParseTest([("--include-globbing-filelist", "file")], | 225 | self.ParseTest([("--include-filelist", "file")], |
2248 | 537 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 226 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2249 | 538 | ('1', '1', '3')], | 227 | ('1', '1', '3')], |
2250 | 539 | ["- testfiles/select/1/1/1\n" | 228 | ["- testfiles/select/1/1/1\n" |
2251 | @@ -541,9 +230,9 @@ | |||
2252 | 541 | "- testfiles/select/1\n" | 230 | "- testfiles/select/1\n" |
2253 | 542 | "- **"]) | 231 | "- **"]) |
2254 | 543 | 232 | ||
2256 | 544 | def test_include_globbing_filelist_1_trailing_whitespace(self): | 233 | def test_include_filelist_1_trailing_whitespace(self): |
2257 | 545 | """Filelist glob test similar to globbing filelist, but with 1 trailing whitespace on include""" | 234 | """Filelist glob test similar to globbing filelist, but with 1 trailing whitespace on include""" |
2259 | 546 | self.ParseTest([("--include-globbing-filelist", "file")], | 235 | self.ParseTest([("--include-filelist", "file")], |
2260 | 547 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 236 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2261 | 548 | ('1', '1', '3')], | 237 | ('1', '1', '3')], |
2262 | 549 | ["- testfiles/select/1/1/1\n" | 238 | ["- testfiles/select/1/1/1\n" |
2263 | @@ -551,9 +240,9 @@ | |||
2264 | 551 | "- testfiles/select/1\n" | 240 | "- testfiles/select/1\n" |
2265 | 552 | "- **"]) | 241 | "- **"]) |
2266 | 553 | 242 | ||
2268 | 554 | def test_include_globbing_filelist_2_trailing_whitespaces(self): | 243 | def test_include_filelist_2_trailing_whitespaces(self): |
2269 | 555 | """Filelist glob test similar to globbing filelist, but with 2 trailing whitespaces on include""" | 244 | """Filelist glob test similar to globbing filelist, but with 2 trailing whitespaces on include""" |
2271 | 556 | self.ParseTest([("--include-globbing-filelist", "file")], | 245 | self.ParseTest([("--include-filelist", "file")], |
2272 | 557 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 246 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2273 | 558 | ('1', '1', '3')], | 247 | ('1', '1', '3')], |
2274 | 559 | ["- testfiles/select/1/1/1\n" | 248 | ["- testfiles/select/1/1/1\n" |
2275 | @@ -561,9 +250,9 @@ | |||
2276 | 561 | "- testfiles/select/1\n" | 250 | "- testfiles/select/1\n" |
2277 | 562 | "- **"]) | 251 | "- **"]) |
2278 | 563 | 252 | ||
2280 | 564 | def test_include_globbing_filelist_1_leading_whitespace(self): | 253 | def test_include_filelist_1_leading_whitespace(self): |
2281 | 565 | """Filelist glob test similar to globbing filelist, but with 1 leading whitespace on include""" | 254 | """Filelist glob test similar to globbing filelist, but with 1 leading whitespace on include""" |
2283 | 566 | self.ParseTest([("--include-globbing-filelist", "file")], | 255 | self.ParseTest([("--include-filelist", "file")], |
2284 | 567 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 256 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2285 | 568 | ('1', '1', '3')], | 257 | ('1', '1', '3')], |
2286 | 569 | ["- testfiles/select/1/1/1\n" | 258 | ["- testfiles/select/1/1/1\n" |
2287 | @@ -571,9 +260,9 @@ | |||
2288 | 571 | "- testfiles/select/1\n" | 260 | "- testfiles/select/1\n" |
2289 | 572 | "- **"]) | 261 | "- **"]) |
2290 | 573 | 262 | ||
2292 | 574 | def test_include_globbing_filelist_2_leading_whitespaces(self): | 263 | def test_include_filelist_2_leading_whitespaces(self): |
2293 | 575 | """Filelist glob test similar to globbing filelist, but with 2 leading whitespaces on include""" | 264 | """Filelist glob test similar to globbing filelist, but with 2 leading whitespaces on include""" |
2295 | 576 | self.ParseTest([("--include-globbing-filelist", "file")], | 265 | self.ParseTest([("--include-filelist", "file")], |
2296 | 577 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 266 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2297 | 578 | ('1', '1', '3')], | 267 | ('1', '1', '3')], |
2298 | 579 | ["- testfiles/select/1/1/1\n" | 268 | ["- testfiles/select/1/1/1\n" |
2299 | @@ -581,9 +270,9 @@ | |||
2300 | 581 | "- testfiles/select/1\n" | 270 | "- testfiles/select/1\n" |
2301 | 582 | "- **"]) | 271 | "- **"]) |
2302 | 583 | 272 | ||
2304 | 584 | def test_include_globbing_filelist_1_trailing_whitespace_exclude(self): | 273 | def test_include_filelist_1_trailing_whitespace_exclude(self): |
2305 | 585 | """Filelist glob test similar to globbing filelist, but with 1 trailing whitespace on exclude""" | 274 | """Filelist glob test similar to globbing filelist, but with 1 trailing whitespace on exclude""" |
2307 | 586 | self.ParseTest([("--include-globbing-filelist", "file")], | 275 | self.ParseTest([("--include-filelist", "file")], |
2308 | 587 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 276 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2309 | 588 | ('1', '1', '3')], | 277 | ('1', '1', '3')], |
2310 | 589 | ["- testfiles/select/1/1/1 \n" | 278 | ["- testfiles/select/1/1/1 \n" |
2311 | @@ -591,9 +280,9 @@ | |||
2312 | 591 | "- testfiles/select/1\n" | 280 | "- testfiles/select/1\n" |
2313 | 592 | "- **"]) | 281 | "- **"]) |
2314 | 593 | 282 | ||
2316 | 594 | def test_include_globbing_filelist_2_trailing_whitespace_exclude(self): | 283 | def test_include_filelist_2_trailing_whitespace_exclude(self): |
2317 | 595 | """Filelist glob test similar to globbing filelist, but with 2 trailing whitespaces on exclude""" | 284 | """Filelist glob test similar to globbing filelist, but with 2 trailing whitespaces on exclude""" |
2319 | 596 | self.ParseTest([("--include-globbing-filelist", "file")], | 285 | self.ParseTest([("--include-filelist", "file")], |
2320 | 597 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 286 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2321 | 598 | ('1', '1', '3')], | 287 | ('1', '1', '3')], |
2322 | 599 | ["- testfiles/select/1/1/1 \n" | 288 | ["- testfiles/select/1/1/1 \n" |
2323 | @@ -601,9 +290,9 @@ | |||
2324 | 601 | "- testfiles/select/1\n" | 290 | "- testfiles/select/1\n" |
2325 | 602 | "- **"]) | 291 | "- **"]) |
2326 | 603 | 292 | ||
2328 | 604 | def test_include_globbing_filelist_1_leading_whitespace_exclude(self): | 293 | def test_include_filelist_1_leading_whitespace_exclude(self): |
2329 | 605 | """Filelist glob test similar to globbing filelist, but with 1 leading whitespace on exclude""" | 294 | """Filelist glob test similar to globbing filelist, but with 1 leading whitespace on exclude""" |
2331 | 606 | self.ParseTest([("--include-globbing-filelist", "file")], | 295 | self.ParseTest([("--include-filelist", "file")], |
2332 | 607 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 296 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2333 | 608 | ('1', '1', '3')], | 297 | ('1', '1', '3')], |
2334 | 609 | [" - testfiles/select/1/1/1\n" | 298 | [" - testfiles/select/1/1/1\n" |
2335 | @@ -611,9 +300,9 @@ | |||
2336 | 611 | "- testfiles/select/1\n" | 300 | "- testfiles/select/1\n" |
2337 | 612 | "- **"]) | 301 | "- **"]) |
2338 | 613 | 302 | ||
2340 | 614 | def test_include_globbing_filelist_2_leading_whitespaces_exclude(self): | 303 | def test_include_filelist_2_leading_whitespaces_exclude(self): |
2341 | 615 | """Filelist glob test similar to globbing filelist, but with 2 leading whitespaces on exclude""" | 304 | """Filelist glob test similar to globbing filelist, but with 2 leading whitespaces on exclude""" |
2343 | 616 | self.ParseTest([("--include-globbing-filelist", "file")], | 305 | self.ParseTest([("--include-filelist", "file")], |
2344 | 617 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 306 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2345 | 618 | ('1', '1', '3')], | 307 | ('1', '1', '3')], |
2346 | 619 | [" - testfiles/select/1/1/1\n" | 308 | [" - testfiles/select/1/1/1\n" |
2347 | @@ -621,9 +310,9 @@ | |||
2348 | 621 | "- testfiles/select/1\n" | 310 | "- testfiles/select/1\n" |
2349 | 622 | "- **"]) | 311 | "- **"]) |
2350 | 623 | 312 | ||
2352 | 624 | def test_include_globbing_filelist_check_excluded_folder_included_for_contents(self): | 313 | def test_include_filelist_check_excluded_folder_included_for_contents(self): |
2353 | 625 | """Filelist glob test to check excluded folder is included if contents are""" | 314 | """Filelist glob test to check excluded folder is included if contents are""" |
2355 | 626 | self.ParseTest([("--include-globbing-filelist", "file")], | 315 | self.ParseTest([("--include-filelist", "file")], |
2356 | 627 | [(), ('1',), ('1', '1'), ('1', '1', '1'), ('1', '1', '2'), | 316 | [(), ('1',), ('1', '1'), ('1', '1', '1'), ('1', '1', '2'), |
2357 | 628 | ('1', '1', '3'), ('1', '2'), ('1', '2', '1'), ('1', '3'), ('1', '3', '1'), ('1', '3', '2'), | 317 | ('1', '1', '3'), ('1', '2'), ('1', '2', '1'), ('1', '3'), ('1', '3', '1'), ('1', '3', '2'), |
2358 | 629 | ('1', '3', '3')], | 318 | ('1', '3', '3')], |
2359 | @@ -632,9 +321,9 @@ | |||
2360 | 632 | "testfiles/select/1\n" | 321 | "testfiles/select/1\n" |
2361 | 633 | "- **"]) | 322 | "- **"]) |
2362 | 634 | 323 | ||
2364 | 635 | def test_include_globbing_filelist_with_unnecessary_quotes(self): | 324 | def test_include_filelist_with_unnecessary_quotes(self): |
2365 | 636 | """Filelist glob test similar to globbing filelist, but with quotes around one of the paths.""" | 325 | """Filelist glob test similar to globbing filelist, but with quotes around one of the paths.""" |
2367 | 637 | self.ParseTest([("--include-globbing-filelist", "file")], | 326 | self.ParseTest([("--include-filelist", "file")], |
2368 | 638 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 327 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2369 | 639 | ('1', '1', '3')], | 328 | ('1', '1', '3')], |
2370 | 640 | ["- 'testfiles/select/1/1/1'\n" | 329 | ["- 'testfiles/select/1/1/1'\n" |
2371 | @@ -642,9 +331,9 @@ | |||
2372 | 642 | "- testfiles/select/1\n" | 331 | "- testfiles/select/1\n" |
2373 | 643 | "- **"]) | 332 | "- **"]) |
2374 | 644 | 333 | ||
2376 | 645 | def test_include_globbing_filelist_with_unnecessary_double_quotes(self): | 334 | def test_include_filelist_with_unnecessary_double_quotes(self): |
2377 | 646 | """Filelist glob test similar to globbing filelist, but with double quotes around one of the paths.""" | 335 | """Filelist glob test similar to globbing filelist, but with double quotes around one of the paths.""" |
2379 | 647 | self.ParseTest([("--include-globbing-filelist", "file")], | 336 | self.ParseTest([("--include-filelist", "file")], |
2380 | 648 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 337 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2381 | 649 | ('1', '1', '3')], | 338 | ('1', '1', '3')], |
2382 | 650 | ['- "testfiles/select/1/1/1"\n' | 339 | ['- "testfiles/select/1/1/1"\n' |
2383 | @@ -652,9 +341,9 @@ | |||
2384 | 652 | '- testfiles/select/1\n' | 341 | '- testfiles/select/1\n' |
2385 | 653 | '- **']) | 342 | '- **']) |
2386 | 654 | 343 | ||
2388 | 655 | def test_include_globbing_filelist_with_full_line_comment(self): | 344 | def test_include_filelist_with_full_line_comment(self): |
2389 | 656 | """Filelist glob test similar to globbing filelist, but with a full-line comment.""" | 345 | """Filelist glob test similar to globbing filelist, but with a full-line comment.""" |
2391 | 657 | self.ParseTest([("--include-globbing-filelist", "file")], | 346 | self.ParseTest([("--include-filelist", "file")], |
2392 | 658 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 347 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2393 | 659 | ('1', '1', '3')], | 348 | ('1', '1', '3')], |
2394 | 660 | ['- testfiles/select/1/1/1\n' | 349 | ['- testfiles/select/1/1/1\n' |
2395 | @@ -663,9 +352,9 @@ | |||
2396 | 663 | '- testfiles/select/1\n' | 352 | '- testfiles/select/1\n' |
2397 | 664 | '- **']) | 353 | '- **']) |
2398 | 665 | 354 | ||
2400 | 666 | def test_include_globbing_filelist_with_blank_line(self): | 355 | def test_include_filelist_with_blank_line(self): |
2401 | 667 | """Filelist glob test similar to globbing filelist, but with a blank line.""" | 356 | """Filelist glob test similar to globbing filelist, but with a blank line.""" |
2403 | 668 | self.ParseTest([("--include-globbing-filelist", "file")], | 357 | self.ParseTest([("--include-filelist", "file")], |
2404 | 669 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 358 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2405 | 670 | ('1', '1', '3')], | 359 | ('1', '1', '3')], |
2406 | 671 | ['- testfiles/select/1/1/1\n' | 360 | ['- testfiles/select/1/1/1\n' |
2407 | @@ -674,9 +363,9 @@ | |||
2408 | 674 | '- testfiles/select/1\n' | 363 | '- testfiles/select/1\n' |
2409 | 675 | '- **']) | 364 | '- **']) |
2410 | 676 | 365 | ||
2412 | 677 | def test_include_globbing_filelist_with_blank_line_and_whitespace(self): | 366 | def test_include_filelist_with_blank_line_and_whitespace(self): |
2413 | 678 | """Filelist glob test similar to globbing filelist, but with a blank line and whitespace.""" | 367 | """Filelist glob test similar to globbing filelist, but with a blank line and whitespace.""" |
2415 | 679 | self.ParseTest([("--include-globbing-filelist", "file")], | 368 | self.ParseTest([("--include-filelist", "file")], |
2416 | 680 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 369 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2417 | 681 | ('1', '1', '3')], | 370 | ('1', '1', '3')], |
2418 | 682 | ['- testfiles/select/1/1/1\n' | 371 | ['- testfiles/select/1/1/1\n' |
2419 | @@ -685,19 +374,19 @@ | |||
2420 | 685 | '- testfiles/select/1\n' | 374 | '- testfiles/select/1\n' |
2421 | 686 | '- **']) | 375 | '- **']) |
2422 | 687 | 376 | ||
2424 | 688 | def test_include_globbing_filelist_asterisk(self): | 377 | def test_include_filelist_asterisk(self): |
2425 | 689 | """Filelist glob test with * instead of 'testfiles'""" | 378 | """Filelist glob test with * instead of 'testfiles'""" |
2426 | 690 | # Thank you to Elifarley Cruz for this test case | 379 | # Thank you to Elifarley Cruz for this test case |
2427 | 691 | # (https://bugs.launchpad.net/duplicity/+bug/884371). | 380 | # (https://bugs.launchpad.net/duplicity/+bug/884371). |
2429 | 692 | self.ParseTest([("--include-globbing-filelist", "file")], | 381 | self.ParseTest([("--include-filelist", "file")], |
2430 | 693 | [(), ('1',), ('1', '1'), ('1', '1', '1'), | 382 | [(), ('1',), ('1', '1'), ('1', '1', '1'), |
2431 | 694 | ('1', '1', '2'), ('1', '1', '3')], | 383 | ('1', '1', '2'), ('1', '1', '3')], |
2432 | 695 | ["*/select/1/1\n" | 384 | ["*/select/1/1\n" |
2433 | 696 | "- **"]) | 385 | "- **"]) |
2434 | 697 | 386 | ||
2438 | 698 | def test_include_globbing_filelist_asterisk_2(self): | 387 | def test_include_filelist_asterisk_2(self): |
2439 | 699 | """Identical to test_globbing_filelist, but with the exclude 'select' replaced with '*'""" | 388 | """Identical to test_filelist, but with the exclude 'select' replaced with '*'""" |
2440 | 700 | self.ParseTest([("--include-globbing-filelist", "file")], | 389 | self.ParseTest([("--include-filelist", "file")], |
2441 | 701 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 390 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2442 | 702 | ('1', '1', '3')], | 391 | ('1', '1', '3')], |
2443 | 703 | ["- testfiles/*/1/1/1\n" | 392 | ["- testfiles/*/1/1/1\n" |
2444 | @@ -706,10 +395,10 @@ | |||
2445 | 706 | "- **"]) | 395 | "- **"]) |
2446 | 707 | 396 | ||
2447 | 708 | @unittest.expectedFailure | 397 | @unittest.expectedFailure |
2450 | 709 | def test_include_globbing_filelist_asterisk_3(self): | 398 | def test_include_filelist_asterisk_3(self): |
2451 | 710 | """Identical to test_globbing_filelist, but with the auto-include 'select' replaced with '*'""" | 399 | """Identical to test_filelist, but with the auto-include 'select' replaced with '*'""" |
2452 | 711 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) | 400 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) |
2454 | 712 | self.ParseTest([("--include-globbing-filelist", "file")], | 401 | self.ParseTest([("--include-filelist", "file")], |
2455 | 713 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 402 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2456 | 714 | ('1', '1', '3')], | 403 | ('1', '1', '3')], |
2457 | 715 | ["- testfiles/select/1/1/1\n" | 404 | ["- testfiles/select/1/1/1\n" |
2458 | @@ -718,10 +407,10 @@ | |||
2459 | 718 | "- **"]) | 407 | "- **"]) |
2460 | 719 | 408 | ||
2461 | 720 | @unittest.expectedFailure | 409 | @unittest.expectedFailure |
2464 | 721 | def test_include_globbing_filelist_asterisk_4(self): | 410 | def test_include_filelist_asterisk_4(self): |
2465 | 722 | """Identical to test_globbing_filelist, but with a specific include 'select' replaced with '*'""" | 411 | """Identical to test_filelist, but with a specific include 'select' replaced with '*'""" |
2466 | 723 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) | 412 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) |
2468 | 724 | self.ParseTest([("--include-globbing-filelist", "file")], | 413 | self.ParseTest([("--include-filelist", "file")], |
2469 | 725 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 414 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2470 | 726 | ('1', '1', '3')], | 415 | ('1', '1', '3')], |
2471 | 727 | ["- testfiles/select/1/1/1\n" | 416 | ["- testfiles/select/1/1/1\n" |
2472 | @@ -730,10 +419,10 @@ | |||
2473 | 730 | "- **"]) | 419 | "- **"]) |
2474 | 731 | 420 | ||
2475 | 732 | @unittest.expectedFailure | 421 | @unittest.expectedFailure |
2478 | 733 | def test_include_globbing_filelist_asterisk_5(self): | 422 | def test_include_filelist_asterisk_5(self): |
2479 | 734 | """Identical to test_globbing_filelist, but with all 'select's replaced with '*'""" | 423 | """Identical to test_filelist, but with all 'select's replaced with '*'""" |
2480 | 735 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) | 424 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) |
2482 | 736 | self.ParseTest([("--include-globbing-filelist", "file")], | 425 | self.ParseTest([("--include-filelist", "file")], |
2483 | 737 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 426 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2484 | 738 | ('1', '1', '3')], | 427 | ('1', '1', '3')], |
2485 | 739 | ["- testfiles/*/1/1/1\n" | 428 | ["- testfiles/*/1/1/1\n" |
2486 | @@ -741,9 +430,9 @@ | |||
2487 | 741 | "- testfiles/*/1\n" | 430 | "- testfiles/*/1\n" |
2488 | 742 | "- **"]) | 431 | "- **"]) |
2489 | 743 | 432 | ||
2493 | 744 | def test_include_globbing_filelist_asterisk_6(self): | 433 | def test_include_filelist_asterisk_6(self): |
2494 | 745 | """Identical to test_globbing_filelist, but with numerous excluded folders replaced with '*'""" | 434 | """Identical to test_filelist, but with numerous excluded folders replaced with '*'""" |
2495 | 746 | self.ParseTest([("--include-globbing-filelist", "file")], | 435 | self.ParseTest([("--include-filelist", "file")], |
2496 | 747 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 436 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2497 | 748 | ('1', '1', '3')], | 437 | ('1', '1', '3')], |
2498 | 749 | ["- */*/1/1/1\n" | 438 | ["- */*/1/1/1\n" |
2499 | @@ -752,10 +441,10 @@ | |||
2500 | 752 | "- **"]) | 441 | "- **"]) |
2501 | 753 | 442 | ||
2502 | 754 | @unittest.expectedFailure | 443 | @unittest.expectedFailure |
2505 | 755 | def test_include_globbing_filelist_asterisk_7(self): | 444 | def test_include_filelist_asterisk_7(self): |
2506 | 756 | """Identical to test_globbing_filelist, but with numerous included/excluded folders replaced with '*'""" | 445 | """Identical to test_filelist, but with numerous included/excluded folders replaced with '*'""" |
2507 | 757 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) | 446 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) |
2509 | 758 | self.ParseTest([("--include-globbing-filelist", "file")], | 447 | self.ParseTest([("--include-filelist", "file")], |
2510 | 759 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 448 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2511 | 760 | ('1', '1', '3')], | 449 | ('1', '1', '3')], |
2512 | 761 | ["- */*/1/1/1\n" | 450 | ["- */*/1/1/1\n" |
2513 | @@ -763,9 +452,9 @@ | |||
2514 | 763 | "- */*/1\n" | 452 | "- */*/1\n" |
2515 | 764 | "- **"]) | 453 | "- **"]) |
2516 | 765 | 454 | ||
2520 | 766 | def test_include_globbing_filelist_double_asterisk_1(self): | 455 | def test_include_filelist_double_asterisk_1(self): |
2521 | 767 | """Identical to test_globbing_filelist, but with the exclude 'select' replaced with '**'""" | 456 | """Identical to test_filelist, but with the exclude 'select' replaced with '**'""" |
2522 | 768 | self.ParseTest([("--include-globbing-filelist", "file")], | 457 | self.ParseTest([("--include-filelist", "file")], |
2523 | 769 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 458 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2524 | 770 | ('1', '1', '3')], | 459 | ('1', '1', '3')], |
2525 | 771 | ["- testfiles/**/1/1/1\n" | 460 | ["- testfiles/**/1/1/1\n" |
2526 | @@ -774,10 +463,10 @@ | |||
2527 | 774 | "- **"]) | 463 | "- **"]) |
2528 | 775 | 464 | ||
2529 | 776 | @unittest.expectedFailure | 465 | @unittest.expectedFailure |
2532 | 777 | def test_include_globbing_filelist_double_asterisk_2(self): | 466 | def test_include_filelist_double_asterisk_2(self): |
2533 | 778 | """Identical to test_globbing_filelist, but with the include 'select' replaced with '**'""" | 467 | """Identical to test_filelist, but with the include 'select' replaced with '**'""" |
2534 | 779 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) | 468 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) |
2536 | 780 | self.ParseTest([("--include-globbing-filelist", "file")], | 469 | self.ParseTest([("--include-filelist", "file")], |
2537 | 781 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 470 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2538 | 782 | ('1', '1', '3')], | 471 | ('1', '1', '3')], |
2539 | 783 | ["- testfiles/select/1/1/1\n" | 472 | ["- testfiles/select/1/1/1\n" |
2540 | @@ -785,9 +474,9 @@ | |||
2541 | 785 | "- testfiles/select/1\n" | 474 | "- testfiles/select/1\n" |
2542 | 786 | "- **"]) | 475 | "- **"]) |
2543 | 787 | 476 | ||
2547 | 788 | def test_include_globbing_filelist_double_asterisk_3(self): | 477 | def test_include_filelist_double_asterisk_3(self): |
2548 | 789 | """Identical to test_globbing_filelist, but with the exclude 'testfiles/select' replaced with '**'""" | 478 | """Identical to test_filelist, but with the exclude 'testfiles/select' replaced with '**'""" |
2549 | 790 | self.ParseTest([("--include-globbing-filelist", "file")], | 479 | self.ParseTest([("--include-filelist", "file")], |
2550 | 791 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 480 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2551 | 792 | ('1', '1', '3')], | 481 | ('1', '1', '3')], |
2552 | 793 | ["- **/1/1/1\n" | 482 | ["- **/1/1/1\n" |
2553 | @@ -796,10 +485,10 @@ | |||
2554 | 796 | "- **"]) | 485 | "- **"]) |
2555 | 797 | 486 | ||
2556 | 798 | @unittest.expectedFailure | 487 | @unittest.expectedFailure |
2559 | 799 | def test_include_globbing_filelist_double_asterisk_4(self): | 488 | def test_include_filelist_double_asterisk_4(self): |
2560 | 800 | """Identical to test_globbing_filelist, but with the include 'testfiles/select' replaced with '**'""" | 489 | """Identical to test_filelist, but with the include 'testfiles/select' replaced with '**'""" |
2561 | 801 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) | 490 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) |
2563 | 802 | self.ParseTest([("--include-globbing-filelist", "file")], | 491 | self.ParseTest([("--include-filelist", "file")], |
2564 | 803 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 492 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2565 | 804 | ('1', '1', '3')], | 493 | ('1', '1', '3')], |
2566 | 805 | ["- testfiles/select/1/1/1\n" | 494 | ["- testfiles/select/1/1/1\n" |
2567 | @@ -808,10 +497,10 @@ | |||
2568 | 808 | "- **"]) | 497 | "- **"]) |
2569 | 809 | 498 | ||
2570 | 810 | @unittest.expectedFailure | 499 | @unittest.expectedFailure |
2573 | 811 | def test_include_globbing_filelist_double_asterisk_5(self): | 500 | def test_include_filelist_double_asterisk_5(self): |
2574 | 812 | """Identical to test_globbing_filelist, but with all 'testfiles/select's replaced with '**'""" | 501 | """Identical to test_filelist, but with all 'testfiles/select's replaced with '**'""" |
2575 | 813 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) | 502 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) |
2577 | 814 | self.ParseTest([("--include-globbing-filelist", "file")], | 503 | self.ParseTest([("--include-filelist", "file")], |
2578 | 815 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 504 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2579 | 816 | ('1', '1', '3')], | 505 | ('1', '1', '3')], |
2580 | 817 | ["- **/1/1/1\n" | 506 | ["- **/1/1/1\n" |
2581 | @@ -819,9 +508,9 @@ | |||
2582 | 819 | "- **/1\n" | 508 | "- **/1\n" |
2583 | 820 | "- **"]) | 509 | "- **"]) |
2584 | 821 | 510 | ||
2586 | 822 | def test_include_globbing_filelist_trailing_slashes(self): | 511 | def test_include_filelist_trailing_slashes(self): |
2587 | 823 | """Filelist glob test similar to globbing filelist, but with trailing slashes""" | 512 | """Filelist glob test similar to globbing filelist, but with trailing slashes""" |
2589 | 824 | self.ParseTest([("--include-globbing-filelist", "file")], | 513 | self.ParseTest([("--include-filelist", "file")], |
2590 | 825 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 514 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2591 | 826 | ('1', '1', '3')], | 515 | ('1', '1', '3')], |
2592 | 827 | ["- testfiles/select/1/1/1/\n" | 516 | ["- testfiles/select/1/1/1/\n" |
2593 | @@ -830,10 +519,10 @@ | |||
2594 | 830 | "- **"]) | 519 | "- **"]) |
2595 | 831 | 520 | ||
2596 | 832 | @unittest.expectedFailure | 521 | @unittest.expectedFailure |
2598 | 833 | def test_include_globbing_filelist_trailing_slashes_and_single_asterisks(self): | 522 | def test_include_filelist_trailing_slashes_and_single_asterisks(self): |
2599 | 834 | """Filelist glob test similar to globbing filelist, but with trailing slashes and single asterisks""" | 523 | """Filelist glob test similar to globbing filelist, but with trailing slashes and single asterisks""" |
2600 | 835 | # Todo: Bug #932482 (https://bugs.launchpad.net/duplicity/+bug/932482) | 524 | # Todo: Bug #932482 (https://bugs.launchpad.net/duplicity/+bug/932482) |
2602 | 836 | self.ParseTest([("--include-globbing-filelist", "file")], | 525 | self.ParseTest([("--include-filelist", "file")], |
2603 | 837 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 526 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2604 | 838 | ('1', '1', '3')], | 527 | ('1', '1', '3')], |
2605 | 839 | ["- */select/1/1/1/\n" | 528 | ["- */select/1/1/1/\n" |
2606 | @@ -842,10 +531,10 @@ | |||
2607 | 842 | "- **"]) | 531 | "- **"]) |
2608 | 843 | 532 | ||
2609 | 844 | @unittest.expectedFailure | 533 | @unittest.expectedFailure |
2611 | 845 | def test_include_globbing_filelist_trailing_slashes_and_double_asterisks(self): | 534 | def test_include_filelist_trailing_slashes_and_double_asterisks(self): |
2612 | 846 | """Filelist glob test similar to globbing filelist, but with trailing slashes and double asterisks""" | 535 | """Filelist glob test similar to globbing filelist, but with trailing slashes and double asterisks""" |
2613 | 847 | # Todo: Bug #932482 (https://bugs.launchpad.net/duplicity/+bug/932482) | 536 | # Todo: Bug #932482 (https://bugs.launchpad.net/duplicity/+bug/932482) |
2615 | 848 | self.ParseTest([("--include-globbing-filelist", "file")], | 537 | self.ParseTest([("--include-filelist", "file")], |
2616 | 849 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 538 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2617 | 850 | ('1', '1', '3')], | 539 | ('1', '1', '3')], |
2618 | 851 | ["- **/1/1/1/\n" | 540 | ["- **/1/1/1/\n" |
2619 | @@ -853,9 +542,18 @@ | |||
2620 | 853 | "- **/1/\n" | 542 | "- **/1/\n" |
2621 | 854 | "- **"]) | 543 | "- **"]) |
2622 | 855 | 544 | ||
2626 | 856 | def test_exclude_globbing_filelist(self): | 545 | |
2627 | 857 | """Exclude version of test_globbing_filelist""" | 546 | def test_filelist_null_separator(self): |
2628 | 858 | self.ParseTest([("--exclude-globbing-filelist", "file")], | 547 | """test_filelist, but with null_separator set""" |
2629 | 548 | self.set_global('null_separator', 1) | ||
2630 | 549 | self.ParseTest([("--include-filelist", "file")], | ||
2631 | 550 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | ||
2632 | 551 | ('1', '1', '3')], | ||
2633 | 552 | ["\0- testfiles/select/1/1/1\0testfiles/select/1/1\0- testfiles/select/1\0- **\0"]) | ||
2634 | 553 | |||
2635 | 554 | def test_exclude_filelist(self): | ||
2636 | 555 | """Exclude version of test_filelist""" | ||
2637 | 556 | self.ParseTest([("--exclude-filelist", "file")], | ||
2638 | 859 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 557 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2639 | 860 | ('1', '1', '3')], | 558 | ('1', '1', '3')], |
2640 | 861 | ["testfiles/select/1/1/1\n" | 559 | ["testfiles/select/1/1/1\n" |
2641 | @@ -863,17 +561,17 @@ | |||
2642 | 863 | "testfiles/select/1\n" | 561 | "testfiles/select/1\n" |
2643 | 864 | "- **"]) | 562 | "- **"]) |
2644 | 865 | 563 | ||
2648 | 866 | def test_exclude_globbing_filelist_asterisk_1(self): | 564 | def test_exclude_filelist_asterisk_1(self): |
2649 | 867 | """Exclude version of test_include_globbing_filelist_asterisk""" | 565 | """Exclude version of test_include_filelist_asterisk""" |
2650 | 868 | self.ParseTest([("--exclude-globbing-filelist", "file")], | 566 | self.ParseTest([("--exclude-filelist", "file")], |
2651 | 869 | [(), ('1',), ('1', '1'), ('1', '1', '1'), | 567 | [(), ('1',), ('1', '1'), ('1', '1', '1'), |
2652 | 870 | ('1', '1', '2'), ('1', '1', '3')], | 568 | ('1', '1', '2'), ('1', '1', '3')], |
2653 | 871 | ["+ */select/1/1\n" | 569 | ["+ */select/1/1\n" |
2654 | 872 | "- **"]) | 570 | "- **"]) |
2655 | 873 | 571 | ||
2659 | 874 | def test_exclude_globbing_filelist_asterisk_2(self): | 572 | def test_exclude_filelist_asterisk_2(self): |
2660 | 875 | """Identical to test_exclude_globbing_filelist, but with the exclude 'select' replaced with '*'""" | 573 | """Identical to test_exclude_filelist, but with the exclude 'select' replaced with '*'""" |
2661 | 876 | self.ParseTest([("--exclude-globbing-filelist", "file")], | 574 | self.ParseTest([("--exclude-filelist", "file")], |
2662 | 877 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 575 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2663 | 878 | ('1', '1', '3')], | 576 | ('1', '1', '3')], |
2664 | 879 | ["testfiles/*/1/1/1\n" | 577 | ["testfiles/*/1/1/1\n" |
2665 | @@ -882,10 +580,10 @@ | |||
2666 | 882 | "- **"]) | 580 | "- **"]) |
2667 | 883 | 581 | ||
2668 | 884 | @unittest.expectedFailure | 582 | @unittest.expectedFailure |
2671 | 885 | def test_exclude_globbing_filelist_asterisk_3(self): | 583 | def test_exclude_filelist_asterisk_3(self): |
2672 | 886 | """Identical to test_exclude_globbing_filelist, but with the include 'select' replaced with '*'""" | 584 | """Identical to test_exclude_filelist, but with the include 'select' replaced with '*'""" |
2673 | 887 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) | 585 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) |
2675 | 888 | self.ParseTest([("--exclude-globbing-filelist", "file")], | 586 | self.ParseTest([("--exclude-filelist", "file")], |
2676 | 889 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 587 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2677 | 890 | ('1', '1', '3')], | 588 | ('1', '1', '3')], |
2678 | 891 | ["testfiles/select/1/1/1\n" | 589 | ["testfiles/select/1/1/1\n" |
2679 | @@ -893,9 +591,9 @@ | |||
2680 | 893 | "testfiles/select/1\n" | 591 | "testfiles/select/1\n" |
2681 | 894 | "- **"]) | 592 | "- **"]) |
2682 | 895 | 593 | ||
2686 | 896 | def test_exclude_globbing_filelist_asterisk_4(self): | 594 | def test_exclude_filelist_asterisk_4(self): |
2687 | 897 | """Identical to test_exclude_globbing_filelist, but with numerous excluded folders replaced with '*'""" | 595 | """Identical to test_exclude_filelist, but with numerous excluded folders replaced with '*'""" |
2688 | 898 | self.ParseTest([("--exclude-globbing-filelist", "file")], | 596 | self.ParseTest([("--exclude-filelist", "file")], |
2689 | 899 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 597 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2690 | 900 | ('1', '1', '3')], | 598 | ('1', '1', '3')], |
2691 | 901 | ["*/select/1/1/1\n" | 599 | ["*/select/1/1/1\n" |
2692 | @@ -904,10 +602,10 @@ | |||
2693 | 904 | "- **"]) | 602 | "- **"]) |
2694 | 905 | 603 | ||
2695 | 906 | @unittest.expectedFailure | 604 | @unittest.expectedFailure |
2698 | 907 | def test_exclude_globbing_filelist_asterisk_5(self): | 605 | def test_exclude_filelist_asterisk_5(self): |
2699 | 908 | """Identical to test_exclude_globbing_filelist, but with numerous included/excluded folders replaced with '*'""" | 606 | """Identical to test_exclude_filelist, but with numerous included/excluded folders replaced with '*'""" |
2700 | 909 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) | 607 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) |
2702 | 910 | self.ParseTest([("--exclude-globbing-filelist", "file")], | 608 | self.ParseTest([("--exclude-filelist", "file")], |
2703 | 911 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 609 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2704 | 912 | ('1', '1', '3')], | 610 | ('1', '1', '3')], |
2705 | 913 | ["*/select/1/1/1\n" | 611 | ["*/select/1/1/1\n" |
2706 | @@ -916,10 +614,10 @@ | |||
2707 | 916 | "- **"]) | 614 | "- **"]) |
2708 | 917 | 615 | ||
2709 | 918 | @unittest.expectedFailure | 616 | @unittest.expectedFailure |
2712 | 919 | def test_exclude_globbing_filelist_double_asterisk(self): | 617 | def test_exclude_filelist_double_asterisk(self): |
2713 | 920 | """Identical to test_exclude_globbing_filelist, but with all included/excluded folders replaced with '**'""" | 618 | """Identical to test_exclude_filelist, but with all included/excluded folders replaced with '**'""" |
2714 | 921 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) | 619 | # Todo: Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371) |
2716 | 922 | self.ParseTest([("--exclude-globbing-filelist", "file")], | 620 | self.ParseTest([("--exclude-filelist", "file")], |
2717 | 923 | [(), ('1',), ('1', '1'), ('1', '1', '2'), | 621 | [(), ('1',), ('1', '1'), ('1', '1', '2'), |
2718 | 924 | ('1', '1', '3')], | 622 | ('1', '1', '3')], |
2719 | 925 | ["**/1/1/1\n" | 623 | ["**/1/1/1\n" |
2720 | @@ -956,9 +654,9 @@ | |||
2721 | 956 | ('3', '3'), | 654 | ('3', '3'), |
2722 | 957 | ('3', '3', '2')]) | 655 | ('3', '3', '2')]) |
2723 | 958 | 656 | ||
2725 | 959 | def test_globbing_filelist2(self): | 657 | def test_filelist2(self): |
2726 | 960 | """Filelist glob test similar to above testGlob""" | 658 | """Filelist glob test similar to above testGlob""" |
2728 | 961 | self.ParseTest([("--exclude-globbing-filelist", "asoeuth")], | 659 | self.ParseTest([("--exclude-filelist", "asoeuth")], |
2729 | 962 | [(), ('1',), ('1', '1'), | 660 | [(), ('1',), ('1', '1'), |
2730 | 963 | ('1', '1', '1'), ('1', '1', '2'), | 661 | ('1', '1', '1'), ('1', '1', '2'), |
2731 | 964 | ('1', '2'), ('1', '2', '1'), ('1', '2', '2')], | 662 | ('1', '2'), ('1', '2', '1'), ('1', '2', '2')], |
2732 | @@ -967,7 +665,7 @@ | |||
2733 | 967 | + testfiles/select/1 | 665 | + testfiles/select/1 |
2734 | 968 | ** | 666 | ** |
2735 | 969 | """]) | 667 | """]) |
2737 | 970 | self.ParseTest([("--include-globbing-filelist", "file")], | 668 | self.ParseTest([("--include-filelist", "file")], |
2738 | 971 | [(), ('1',), ('1', '1'), | 669 | [(), ('1',), ('1', '1'), |
2739 | 972 | ('1', '1', '2'), | 670 | ('1', '1', '2'), |
2740 | 973 | ('1', '2'), | 671 | ('1', '2'), |
three point
1. wouldn't it make sense to either depreciate in-/exclude or in/exclude-globbing as they afre functional identical
2. not sure if we should want to have keep the old non-globbing selection for simple setups. easier to understand and done.
3. your branch clashes with the current dev branch. you probably need to rebase your changes.
..ede/duply.net