Globbing patterns fail to include some files if include contains "*" or "**"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Duplicity doesn't include some files if "**" is used as prefix.
Duplicity 0.6.15
Python 2.7.2
ArchLinux x64
Linux filesystem
In the example below, I would expect to have all 3 files from folder-c included in the backup, but they are not:
-------
BASE=/tmp
mkdir -p $BASE/test-
touch $BASE/test-
touch $BASE/test-
touch $BASE/test-
touch $BASE/test-
tree /tmp/test-dup/
# result:
/tmp/test-dup/
+-- file-1.txt
+-- file-2.jpg
+-- file-3.tmp
+-- folder-a
¦ +-- file-4.txt
¦ +-- file-5.jpg
¦ +-- file-6.tmp
+-- folder-b
¦ +-- file-7.txt
¦ +-- file-8.jpg
¦ +-- file-9.tmp
+-- folder-c
+-- file-10.txt
+-- file-11.jpg
+-- file-12.tmp
cat my-file-list
# result:
- **/test-
**/test-
- **/test-
duplicity --name test-dup --include-
$BASE/test-dup/ file://
duplicity --name test-dup list-current-files file://
# result:
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: Mon Oct 31 13:31:33 2011
Mon Oct 31 13:15:04 2011 .
Mon Oct 31 13:15:04 2011 folder-b
Mon Oct 31 13:15:04 2011 folder-b/file-7.txt
Related branches
- duplicity-team: Pending requested
-
Diff: 324 lines (+297/-0)2 files modifiedtesting/functional/test_selection.py (+88/-0)
testing/unit/test_selection.py (+209/-0)
- duplicity-team: Pending requested
-
Diff: 933 lines (+387/-97)5 files modified.bzrignore (+2/-0)
duplicity/selection.py (+20/-5)
po/duplicity.pot (+7/-7)
testing/functional/test_selection.py (+86/-19)
testing/unit/test_selection.py (+272/-66)
description: | updated |
summary: |
- Globbing patterns fail to include some files + Globbing patterns fail to include some files if prefix is "**" |
description: | updated |
Changed in duplicity: | |
importance: | Undecided → Medium |
milestone: | none → 0.6.18 |
status: | New → Triaged |
Changed in duplicity: | |
milestone: | 0.6.18 → none |
Changed in duplicity: | |
assignee: | nobody → Aaron Whitehouse (aaron-whitehouse) |
Changed in duplicity: | |
assignee: | Aaron Whitehouse (aaron-whitehouse) → nobody |
milestone: | none → 0.7.04 |
status: | Triaged → Fix Committed |
Changed in duplicity: | |
status: | Fix Committed → Fix Released |
Here's some actual test code to show the bug.
This bug only happens when I use '**' as prefix, instead of 'testfiles'. Please see below for details.
This method already exists in selectiontest.py, and it works just fine: filelist( self):
self.ParseTest ([("--include- globbing- filelist" , "file")],
[(), ('1',), ('1', '1'), ('1', '1', '2'),
('1' , '1', '3')],
[""" select/ 1/1/1 select/ 1/1
def test_globbing_
"""Filelist glob test similar to above testParse2"""
- testfiles/
testfiles/
- testfiles/select/1
- **
"""])
I have added this method, which also works:
def test_globbing_ filelist_ bug_884371_ a(self) :
self.ParseTest ([("--include- globbing- filelist" , "file")],
[(), ('1',), ('1', '1'), ('1', '1', '1'),
('1' , '1', '2'), ('1', '1', '3')],
["""
"""Filelist glob test related to bug 884371"""
**/select/1/1
- **
"""])
The one below doesn't work, and it's simply a modified version of 'test_globbing_ filelist' (with the string 'testfiles' replaced by '**'):
def test_globbing_ filelist_ bug_884371_ b(self) : filelist'
self.ParseTest ([("--include- globbing- filelist" , "file")],
[(), ('1',), ('1', '1'), ('1', '1', '2'),
('1' , '1', '3')],
["""
"""
Modified version of 'test_globbing_
(with the string 'testfiles' replaced by '**')
"""
- **/select/1/1/1
**/select/1/1
- **/select/1
- **
"""])
Here are the results of the tests:
======= ======= ======= ======= ======= ===== filelist (__main_ _.ParseArgsTest ) filelist_ bug_884371_ a (__main_ _.ParseArgsTest ) filelist_ bug_884371_ b (__main_ _.ParseArgsTest ) ======= ======= ======= ======= =====
test_globbing_
Filelist glob test similar to above testParse2 ...
self.Select:
()
('1',)
('1', '1')
('1', '1', '2')
('1', '1', '3')
ok
test_globbing_
Filelist glob test related to bug 884371 ...
self.Select:
()
('1',)
('1', '1')
('1', '1', '1')
('1', '1', '2')
('1', '1', '3')
ok
test_globbing_
Filelist glob test related to bug 884371 ...
self.Select:
()
End when i2 = ('1',)
FAIL
=======