Wildcards in exclude not working

Bug #604783 reported by Graham Cobb
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Duplicity
New
Undecided
Unassigned

Bug Description

Duplicity version: 0.6.04-1
Python version: 2.5.4-2
OS Distro and version: Debian Squeeze
Type of target filesystem: Linux
Log output on request.

The following command works correctly:

set -f

/usr/bin/duplicity full -v3 --exclude /home/cobb/.kde/share/apps/kmail/imap/ --include /home/cobb/.kde --exclude=** / file:///tmp/dupltest/

In other words, it backs up /home/cobb/.kde excluding the /home/cobb/.kde/share/apps/kmail/imap/ tree.

However, the following command:

set -f

/usr/bin/duplicity full -v3 --exclude /home/*/.kde/share/apps/kmail/imap/ --include /home/cobb/.kde --exclude=** / file:///tmp/dupltest/

Does not work. It fails to exclude the /home/cobb/.kde/share/apps/kmail/imap/ tree.

Note that other wildcard --exclude options, such as /**/.kde/share/apps/kmail/imap/ also fail.

Revision history for this message
Graham Cobb (g+launchpad) wrote :

The following variant seems to work:

/usr/bin/duplicity full -v3 --exclude /home/*/.kde/share/apps/kmail/imap/** --include /home/cobb/.kde --exclude=** / file:///tmp/dupltest/

It seems that, in order to honour the promise in the documentation that:

The --exclude pattern option matches a file if
...
2. the file is inside a directory matched by the option.

duplicity should automatically add another exclude spec which is the same text followed by /** (or just ** if the existing spec already ends with /).

Presumably the fact that it works today if the exclude spec does not contain a wildcard means the current code is trying to check if the exclude spec specifies a directory or not and then doing something similar if it is a directory. That does not work for wildcards but I believe the rule above would work for wildcard or non-wildcard and directory or non-directory cases.

There is a similar wildcard-related problem with directory handling for --include but I haven't had time to track it down. It might be worth adding an option (--strict-selection or something) which would change the rules to be the same as the existing rsync rules and get rid of the attempt to simplify directory handling. More complex for the user but it gives the user full control in complex selection cases.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.